1. Packages
  2. Azure Classic
  3. API Docs
  4. sql
  5. getSqlManagedInstance

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

azure.sql.getSqlManagedInstance

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

    Use this data source to access information about an existing SQL Managed Instance.

    Note: The azure.sql.ManagedInstance data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the azure.mssql.ManagedInstance data source instead.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.sql.getSqlManagedInstance({
        name: "example_mi",
        resourceGroupName: "example-resources",
    });
    export const sqlInstanceId = example.then(example => example.id);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.sql.get_sql_managed_instance(name="example_mi",
        resource_group_name="example-resources")
    pulumi.export("sqlInstanceId", example.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := sql.GetSqlManagedInstance(ctx, &sql.GetSqlManagedInstanceArgs{
    			Name:              "example_mi",
    			ResourceGroupName: "example-resources",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("sqlInstanceId", example.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.Sql.GetSqlManagedInstance.Invoke(new()
        {
            Name = "example_mi",
            ResourceGroupName = "example-resources",
        });
    
        return new Dictionary<string, object?>
        {
            ["sqlInstanceId"] = example.Apply(getSqlManagedInstanceResult => getSqlManagedInstanceResult.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.sql.SqlFunctions;
    import com.pulumi.azure.sql.inputs.GetSqlManagedInstanceArgs;
    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 = SqlFunctions.getSqlManagedInstance(GetSqlManagedInstanceArgs.builder()
                .name("example_mi")
                .resourceGroupName("example-resources")
                .build());
    
            ctx.export("sqlInstanceId", example.applyValue(getSqlManagedInstanceResult -> getSqlManagedInstanceResult.id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:sql:getSqlManagedInstance
          Arguments:
            name: example_mi
            resourceGroupName: example-resources
    outputs:
      sqlInstanceId: ${example.id}
    

    Using getSqlManagedInstance

    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 getSqlManagedInstance(args: GetSqlManagedInstanceArgs, opts?: InvokeOptions): Promise<GetSqlManagedInstanceResult>
    function getSqlManagedInstanceOutput(args: GetSqlManagedInstanceOutputArgs, opts?: InvokeOptions): Output<GetSqlManagedInstanceResult>
    def get_sql_managed_instance(name: Optional[str] = None,
                                 resource_group_name: Optional[str] = None,
                                 tags: Optional[Mapping[str, str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetSqlManagedInstanceResult
    def get_sql_managed_instance_output(name: Optional[pulumi.Input[str]] = None,
                                 resource_group_name: Optional[pulumi.Input[str]] = None,
                                 tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetSqlManagedInstanceResult]
    func GetSqlManagedInstance(ctx *Context, args *GetSqlManagedInstanceArgs, opts ...InvokeOption) (*GetSqlManagedInstanceResult, error)
    func GetSqlManagedInstanceOutput(ctx *Context, args *GetSqlManagedInstanceOutputArgs, opts ...InvokeOption) GetSqlManagedInstanceResultOutput

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

    public static class GetSqlManagedInstance 
    {
        public static Task<GetSqlManagedInstanceResult> InvokeAsync(GetSqlManagedInstanceArgs args, InvokeOptions? opts = null)
        public static Output<GetSqlManagedInstanceResult> Invoke(GetSqlManagedInstanceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSqlManagedInstanceResult> getSqlManagedInstance(GetSqlManagedInstanceArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:sql/getSqlManagedInstance:getSqlManagedInstance
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the SQL Managed Instance.
    ResourceGroupName string
    The name of the Resource Group in which the SQL Managed Instance exists.
    Tags Dictionary<string, string>
    A mapping of tags assigned to the resource.
    Name string
    The name of the SQL Managed Instance.
    ResourceGroupName string
    The name of the Resource Group in which the SQL Managed Instance exists.
    Tags map[string]string
    A mapping of tags assigned to the resource.
    name String
    The name of the SQL Managed Instance.
    resourceGroupName String
    The name of the Resource Group in which the SQL Managed Instance exists.
    tags Map<String,String>
    A mapping of tags assigned to the resource.
    name string
    The name of the SQL Managed Instance.
    resourceGroupName string
    The name of the Resource Group in which the SQL Managed Instance exists.
    tags {[key: string]: string}
    A mapping of tags assigned to the resource.
    name str
    The name of the SQL Managed Instance.
    resource_group_name str
    The name of the Resource Group in which the SQL Managed Instance exists.
    tags Mapping[str, str]
    A mapping of tags assigned to the resource.
    name String
    The name of the SQL Managed Instance.
    resourceGroupName String
    The name of the Resource Group in which the SQL Managed Instance exists.
    tags Map<String>
    A mapping of tags assigned to the resource.

    getSqlManagedInstance Result

    The following output properties are available:

    AdministratorLogin string
    The administrator login name for the new server.
    Collation string
    Specifies how the SQL Managed Instance is collated.
    DnsZonePartnerId string
    The ID of the Managed Instance which is sharing the DNS zone.
    Fqdn string
    The fully qualified domain name of the Azure Managed SQL Instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identities List<GetSqlManagedInstanceIdentity>
    An identity block as defined below.
    LicenseType string
    Type of license the Managed Instance uses.
    Location string
    Location where the resource exists.
    MinimumTlsVersion string
    The Minimum TLS Version.
    Name string
    ProxyOverride string
    How the SQL Managed Instance is accessed.
    PublicDataEndpointEnabled bool
    Is the public data endpoint enabled?
    ResourceGroupName string
    SkuName string
    SKU Name for the SQL Managed Instance.
    StorageAccountType string
    Storage account type used to store backups for this SQL Managed Instance.
    StorageSizeInGb int
    Maximum storage space for your instance.
    SubnetId string
    The subnet resource id that the SQL Managed Instance is associated with.
    TimezoneId string
    The TimeZone ID that the SQL Managed Instance is operating in.
    Vcores int
    Number of cores assigned to your instance.
    Tags Dictionary<string, string>
    A mapping of tags assigned to the resource.
    AdministratorLogin string
    The administrator login name for the new server.
    Collation string
    Specifies how the SQL Managed Instance is collated.
    DnsZonePartnerId string
    The ID of the Managed Instance which is sharing the DNS zone.
    Fqdn string
    The fully qualified domain name of the Azure Managed SQL Instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identities []GetSqlManagedInstanceIdentity
    An identity block as defined below.
    LicenseType string
    Type of license the Managed Instance uses.
    Location string
    Location where the resource exists.
    MinimumTlsVersion string
    The Minimum TLS Version.
    Name string
    ProxyOverride string
    How the SQL Managed Instance is accessed.
    PublicDataEndpointEnabled bool
    Is the public data endpoint enabled?
    ResourceGroupName string
    SkuName string
    SKU Name for the SQL Managed Instance.
    StorageAccountType string
    Storage account type used to store backups for this SQL Managed Instance.
    StorageSizeInGb int
    Maximum storage space for your instance.
    SubnetId string
    The subnet resource id that the SQL Managed Instance is associated with.
    TimezoneId string
    The TimeZone ID that the SQL Managed Instance is operating in.
    Vcores int
    Number of cores assigned to your instance.
    Tags map[string]string
    A mapping of tags assigned to the resource.
    administratorLogin String
    The administrator login name for the new server.
    collation String
    Specifies how the SQL Managed Instance is collated.
    dnsZonePartnerId String
    The ID of the Managed Instance which is sharing the DNS zone.
    fqdn String
    The fully qualified domain name of the Azure Managed SQL Instance.
    id String
    The provider-assigned unique ID for this managed resource.
    identities List<GetSqlManagedInstanceIdentity>
    An identity block as defined below.
    licenseType String
    Type of license the Managed Instance uses.
    location String
    Location where the resource exists.
    minimumTlsVersion String
    The Minimum TLS Version.
    name String
    proxyOverride String
    How the SQL Managed Instance is accessed.
    publicDataEndpointEnabled Boolean
    Is the public data endpoint enabled?
    resourceGroupName String
    skuName String
    SKU Name for the SQL Managed Instance.
    storageAccountType String
    Storage account type used to store backups for this SQL Managed Instance.
    storageSizeInGb Integer
    Maximum storage space for your instance.
    subnetId String
    The subnet resource id that the SQL Managed Instance is associated with.
    timezoneId String
    The TimeZone ID that the SQL Managed Instance is operating in.
    vcores Integer
    Number of cores assigned to your instance.
    tags Map<String,String>
    A mapping of tags assigned to the resource.
    administratorLogin string
    The administrator login name for the new server.
    collation string
    Specifies how the SQL Managed Instance is collated.
    dnsZonePartnerId string
    The ID of the Managed Instance which is sharing the DNS zone.
    fqdn string
    The fully qualified domain name of the Azure Managed SQL Instance.
    id string
    The provider-assigned unique ID for this managed resource.
    identities GetSqlManagedInstanceIdentity[]
    An identity block as defined below.
    licenseType string
    Type of license the Managed Instance uses.
    location string
    Location where the resource exists.
    minimumTlsVersion string
    The Minimum TLS Version.
    name string
    proxyOverride string
    How the SQL Managed Instance is accessed.
    publicDataEndpointEnabled boolean
    Is the public data endpoint enabled?
    resourceGroupName string
    skuName string
    SKU Name for the SQL Managed Instance.
    storageAccountType string
    Storage account type used to store backups for this SQL Managed Instance.
    storageSizeInGb number
    Maximum storage space for your instance.
    subnetId string
    The subnet resource id that the SQL Managed Instance is associated with.
    timezoneId string
    The TimeZone ID that the SQL Managed Instance is operating in.
    vcores number
    Number of cores assigned to your instance.
    tags {[key: string]: string}
    A mapping of tags assigned to the resource.
    administrator_login str
    The administrator login name for the new server.
    collation str
    Specifies how the SQL Managed Instance is collated.
    dns_zone_partner_id str
    The ID of the Managed Instance which is sharing the DNS zone.
    fqdn str
    The fully qualified domain name of the Azure Managed SQL Instance.
    id str
    The provider-assigned unique ID for this managed resource.
    identities Sequence[GetSqlManagedInstanceIdentity]
    An identity block as defined below.
    license_type str
    Type of license the Managed Instance uses.
    location str
    Location where the resource exists.
    minimum_tls_version str
    The Minimum TLS Version.
    name str
    proxy_override str
    How the SQL Managed Instance is accessed.
    public_data_endpoint_enabled bool
    Is the public data endpoint enabled?
    resource_group_name str
    sku_name str
    SKU Name for the SQL Managed Instance.
    storage_account_type str
    Storage account type used to store backups for this SQL Managed Instance.
    storage_size_in_gb int
    Maximum storage space for your instance.
    subnet_id str
    The subnet resource id that the SQL Managed Instance is associated with.
    timezone_id str
    The TimeZone ID that the SQL Managed Instance is operating in.
    vcores int
    Number of cores assigned to your instance.
    tags Mapping[str, str]
    A mapping of tags assigned to the resource.
    administratorLogin String
    The administrator login name for the new server.
    collation String
    Specifies how the SQL Managed Instance is collated.
    dnsZonePartnerId String
    The ID of the Managed Instance which is sharing the DNS zone.
    fqdn String
    The fully qualified domain name of the Azure Managed SQL Instance.
    id String
    The provider-assigned unique ID for this managed resource.
    identities List<Property Map>
    An identity block as defined below.
    licenseType String
    Type of license the Managed Instance uses.
    location String
    Location where the resource exists.
    minimumTlsVersion String
    The Minimum TLS Version.
    name String
    proxyOverride String
    How the SQL Managed Instance is accessed.
    publicDataEndpointEnabled Boolean
    Is the public data endpoint enabled?
    resourceGroupName String
    skuName String
    SKU Name for the SQL Managed Instance.
    storageAccountType String
    Storage account type used to store backups for this SQL Managed Instance.
    storageSizeInGb Number
    Maximum storage space for your instance.
    subnetId String
    The subnet resource id that the SQL Managed Instance is associated with.
    timezoneId String
    The TimeZone ID that the SQL Managed Instance is operating in.
    vcores Number
    Number of cores assigned to your instance.
    tags Map<String>
    A mapping of tags assigned to the resource.

    Supporting Types

    GetSqlManagedInstanceIdentity

    PrincipalId string
    The Principal ID for the Service Principal associated with the Identity of this SQL Managed Instance.
    TenantId string
    The Tenant ID for the Service Principal associated with the Identity of this SQL Managed Instance.
    Type string
    PrincipalId string
    The Principal ID for the Service Principal associated with the Identity of this SQL Managed Instance.
    TenantId string
    The Tenant ID for the Service Principal associated with the Identity of this SQL Managed Instance.
    Type string
    principalId String
    The Principal ID for the Service Principal associated with the Identity of this SQL Managed Instance.
    tenantId String
    The Tenant ID for the Service Principal associated with the Identity of this SQL Managed Instance.
    type String
    principalId string
    The Principal ID for the Service Principal associated with the Identity of this SQL Managed Instance.
    tenantId string
    The Tenant ID for the Service Principal associated with the Identity of this SQL Managed Instance.
    type string
    principal_id str
    The Principal ID for the Service Principal associated with the Identity of this SQL Managed Instance.
    tenant_id str
    The Tenant ID for the Service Principal associated with the Identity of this SQL Managed Instance.
    type str
    principalId String
    The Principal ID for the Service Principal associated with the Identity of this SQL Managed Instance.
    tenantId String
    The Tenant ID for the Service Principal associated with the Identity of this SQL Managed Instance.
    type String

    Package Details

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

    We recommend using Azure Native.

    Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi