1. Packages
  2. Azure Classic
  3. API Docs
  4. databasemigration
  5. getService

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.databasemigration.getService

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Use this data source to access information about an existing Database Migration Service.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.databasemigration.getService({
    name: "example-dms",
    resourceGroupName: "example-rg",
});
export const azurermDmsId = example.then(example => example.id);
Copy
import pulumi
import pulumi_azure as azure

example = azure.databasemigration.get_service(name="example-dms",
    resource_group_name="example-rg")
pulumi.export("azurermDmsId", example.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/databasemigration"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := databasemigration.LookupService(ctx, &databasemigration.LookupServiceArgs{
			Name:              "example-dms",
			ResourceGroupName: "example-rg",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("azurermDmsId", example.Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.DatabaseMigration.GetService.Invoke(new()
    {
        Name = "example-dms",
        ResourceGroupName = "example-rg",
    });

    return new Dictionary<string, object?>
    {
        ["azurermDmsId"] = example.Apply(getServiceResult => getServiceResult.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.databasemigration.DatabasemigrationFunctions;
import com.pulumi.azure.databasemigration.inputs.GetServiceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = DatabasemigrationFunctions.getService(GetServiceArgs.builder()
            .name("example-dms")
            .resourceGroupName("example-rg")
            .build());

        ctx.export("azurermDmsId", example.applyValue(getServiceResult -> getServiceResult.id()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:databasemigration:getService
      arguments:
        name: example-dms
        resourceGroupName: example-rg
outputs:
  azurermDmsId: ${example.id}
Copy

Using getService

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getService(args: GetServiceArgs, opts?: InvokeOptions): Promise<GetServiceResult>
function getServiceOutput(args: GetServiceOutputArgs, opts?: InvokeOptions): Output<GetServiceResult>
Copy
def get_service(name: Optional[str] = None,
                resource_group_name: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetServiceResult
def get_service_output(name: Optional[pulumi.Input[str]] = None,
                resource_group_name: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetServiceResult]
Copy
func LookupService(ctx *Context, args *LookupServiceArgs, opts ...InvokeOption) (*LookupServiceResult, error)
func LookupServiceOutput(ctx *Context, args *LookupServiceOutputArgs, opts ...InvokeOption) LookupServiceResultOutput
Copy

> Note: This function is named LookupService in the Go SDK.

public static class GetService 
{
    public static Task<GetServiceResult> InvokeAsync(GetServiceArgs args, InvokeOptions? opts = null)
    public static Output<GetServiceResult> Invoke(GetServiceInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
public static Output<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:databasemigration/getService:getService
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Specify the name of the database migration service.
ResourceGroupName This property is required. string
Specifies the Name of the Resource Group within which the database migration service exists
Name This property is required. string
Specify the name of the database migration service.
ResourceGroupName This property is required. string
Specifies the Name of the Resource Group within which the database migration service exists
name This property is required. String
Specify the name of the database migration service.
resourceGroupName This property is required. String
Specifies the Name of the Resource Group within which the database migration service exists
name This property is required. string
Specify the name of the database migration service.
resourceGroupName This property is required. string
Specifies the Name of the Resource Group within which the database migration service exists
name This property is required. str
Specify the name of the database migration service.
resource_group_name This property is required. str
Specifies the Name of the Resource Group within which the database migration service exists
name This property is required. String
Specify the name of the database migration service.
resourceGroupName This property is required. String
Specifies the Name of the Resource Group within which the database migration service exists

getService Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Location string
Azure location where the resource exists.
Name string
ResourceGroupName string
SkuName string
The SKU name of database migration service.
SubnetId string
The ID of the virtual subnet resource to which the database migration service exists.
Tags Dictionary<string, string>
A mapping of tags to assigned to the resource.
Id string
The provider-assigned unique ID for this managed resource.
Location string
Azure location where the resource exists.
Name string
ResourceGroupName string
SkuName string
The SKU name of database migration service.
SubnetId string
The ID of the virtual subnet resource to which the database migration service exists.
Tags map[string]string
A mapping of tags to assigned to the resource.
id String
The provider-assigned unique ID for this managed resource.
location String
Azure location where the resource exists.
name String
resourceGroupName String
skuName String
The SKU name of database migration service.
subnetId String
The ID of the virtual subnet resource to which the database migration service exists.
tags Map<String,String>
A mapping of tags to assigned to the resource.
id string
The provider-assigned unique ID for this managed resource.
location string
Azure location where the resource exists.
name string
resourceGroupName string
skuName string
The SKU name of database migration service.
subnetId string
The ID of the virtual subnet resource to which the database migration service exists.
tags {[key: string]: string}
A mapping of tags to assigned to the resource.
id str
The provider-assigned unique ID for this managed resource.
location str
Azure location where the resource exists.
name str
resource_group_name str
sku_name str
The SKU name of database migration service.
subnet_id str
The ID of the virtual subnet resource to which the database migration service exists.
tags Mapping[str, str]
A mapping of tags to assigned to the resource.
id String
The provider-assigned unique ID for this managed resource.
location String
Azure location where the resource exists.
name String
resourceGroupName String
skuName String
The SKU name of database migration service.
subnetId String
The ID of the virtual subnet resource to which the database migration service exists.
tags Map<String>
A mapping of tags to assigned to the resource.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi