1. Packages
  2. Azure Classic
  3. API Docs
  4. mssql
  5. getServer

We recommend using Azure Native.

Azure Classic v5.67.1 published on Tuesday, Feb 27, 2024 by Pulumi

azure.mssql.getServer

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.67.1 published on Tuesday, Feb 27, 2024 by Pulumi

    Use this data source to access information about an existing Microsoft SQL Server.

    Example Usage

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

    Using getServer

    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 getServer(args: GetServerArgs, opts?: InvokeOptions): Promise<GetServerResult>
    function getServerOutput(args: GetServerOutputArgs, opts?: InvokeOptions): Output<GetServerResult>
    def get_server(name: Optional[str] = None,
                   resource_group_name: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetServerResult
    def get_server_output(name: Optional[pulumi.Input[str]] = None,
                   resource_group_name: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetServerResult]
    func LookupServer(ctx *Context, args *LookupServerArgs, opts ...InvokeOption) (*LookupServerResult, error)
    func LookupServerOutput(ctx *Context, args *LookupServerOutputArgs, opts ...InvokeOption) LookupServerResultOutput

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

    public static class GetServer 
    {
        public static Task<GetServerResult> InvokeAsync(GetServerArgs args, InvokeOptions? opts = null)
        public static Output<GetServerResult> Invoke(GetServerInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServerResult> getServer(GetServerArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:mssql/getServer:getServer
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of this Microsoft SQL Server.
    ResourceGroupName string
    The name of the Resource Group where the Microsoft SQL Server exists.
    Name string
    The name of this Microsoft SQL Server.
    ResourceGroupName string
    The name of the Resource Group where the Microsoft SQL Server exists.
    name String
    The name of this Microsoft SQL Server.
    resourceGroupName String
    The name of the Resource Group where the Microsoft SQL Server exists.
    name string
    The name of this Microsoft SQL Server.
    resourceGroupName string
    The name of the Resource Group where the Microsoft SQL Server exists.
    name str
    The name of this Microsoft SQL Server.
    resource_group_name str
    The name of the Resource Group where the Microsoft SQL Server exists.
    name String
    The name of this Microsoft SQL Server.
    resourceGroupName String
    The name of the Resource Group where the Microsoft SQL Server exists.

    getServer Result

    The following output properties are available:

    AdministratorLogin string
    The server's administrator login name.
    FullyQualifiedDomainName string
    The fully qualified domain name of the Azure SQL Server.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identities List<GetServerIdentity>
    A identity block as defined below.
    Location string
    The Azure Region where the Microsoft SQL Server exists.
    Name string
    ResourceGroupName string
    RestorableDroppedDatabaseIds List<string>
    A list of dropped restorable database IDs on the server.
    Tags Dictionary<string, string>
    A mapping of tags assigned to this Microsoft SQL Server.
    TransparentDataEncryptionKeyVaultKeyId string
    The Key Vault key URI to be used as the Customer Managed Key(CMK/BYOK) for the Transparent Data Encryption(TDE) layer.
    Version string
    This servers MS SQL version.
    AdministratorLogin string
    The server's administrator login name.
    FullyQualifiedDomainName string
    The fully qualified domain name of the Azure SQL Server.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identities []GetServerIdentity
    A identity block as defined below.
    Location string
    The Azure Region where the Microsoft SQL Server exists.
    Name string
    ResourceGroupName string
    RestorableDroppedDatabaseIds []string
    A list of dropped restorable database IDs on the server.
    Tags map[string]string
    A mapping of tags assigned to this Microsoft SQL Server.
    TransparentDataEncryptionKeyVaultKeyId string
    The Key Vault key URI to be used as the Customer Managed Key(CMK/BYOK) for the Transparent Data Encryption(TDE) layer.
    Version string
    This servers MS SQL version.
    administratorLogin String
    The server's administrator login name.
    fullyQualifiedDomainName String
    The fully qualified domain name of the Azure SQL Server.
    id String
    The provider-assigned unique ID for this managed resource.
    identities List<GetServerIdentity>
    A identity block as defined below.
    location String
    The Azure Region where the Microsoft SQL Server exists.
    name String
    resourceGroupName String
    restorableDroppedDatabaseIds List<String>
    A list of dropped restorable database IDs on the server.
    tags Map<String,String>
    A mapping of tags assigned to this Microsoft SQL Server.
    transparentDataEncryptionKeyVaultKeyId String
    The Key Vault key URI to be used as the Customer Managed Key(CMK/BYOK) for the Transparent Data Encryption(TDE) layer.
    version String
    This servers MS SQL version.
    administratorLogin string
    The server's administrator login name.
    fullyQualifiedDomainName string
    The fully qualified domain name of the Azure SQL Server.
    id string
    The provider-assigned unique ID for this managed resource.
    identities GetServerIdentity[]
    A identity block as defined below.
    location string
    The Azure Region where the Microsoft SQL Server exists.
    name string
    resourceGroupName string
    restorableDroppedDatabaseIds string[]
    A list of dropped restorable database IDs on the server.
    tags {[key: string]: string}
    A mapping of tags assigned to this Microsoft SQL Server.
    transparentDataEncryptionKeyVaultKeyId string
    The Key Vault key URI to be used as the Customer Managed Key(CMK/BYOK) for the Transparent Data Encryption(TDE) layer.
    version string
    This servers MS SQL version.
    administrator_login str
    The server's administrator login name.
    fully_qualified_domain_name str
    The fully qualified domain name of the Azure SQL Server.
    id str
    The provider-assigned unique ID for this managed resource.
    identities Sequence[GetServerIdentity]
    A identity block as defined below.
    location str
    The Azure Region where the Microsoft SQL Server exists.
    name str
    resource_group_name str
    restorable_dropped_database_ids Sequence[str]
    A list of dropped restorable database IDs on the server.
    tags Mapping[str, str]
    A mapping of tags assigned to this Microsoft SQL Server.
    transparent_data_encryption_key_vault_key_id str
    The Key Vault key URI to be used as the Customer Managed Key(CMK/BYOK) for the Transparent Data Encryption(TDE) layer.
    version str
    This servers MS SQL version.
    administratorLogin String
    The server's administrator login name.
    fullyQualifiedDomainName String
    The fully qualified domain name of the Azure SQL Server.
    id String
    The provider-assigned unique ID for this managed resource.
    identities List<Property Map>
    A identity block as defined below.
    location String
    The Azure Region where the Microsoft SQL Server exists.
    name String
    resourceGroupName String
    restorableDroppedDatabaseIds List<String>
    A list of dropped restorable database IDs on the server.
    tags Map<String>
    A mapping of tags assigned to this Microsoft SQL Server.
    transparentDataEncryptionKeyVaultKeyId String
    The Key Vault key URI to be used as the Customer Managed Key(CMK/BYOK) for the Transparent Data Encryption(TDE) layer.
    version String
    This servers MS SQL version.

    Supporting Types

    GetServerIdentity

    IdentityIds List<string>
    The list of User Assigned Managed Identity IDs assigned to this Microsoft SQL Server.
    PrincipalId string
    The Principal ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
    TenantId string
    The Tenant ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
    Type string
    The type of Managed Service Identity that is configured on this Microsoft SQL Server.
    IdentityIds []string
    The list of User Assigned Managed Identity IDs assigned to this Microsoft SQL Server.
    PrincipalId string
    The Principal ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
    TenantId string
    The Tenant ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
    Type string
    The type of Managed Service Identity that is configured on this Microsoft SQL Server.
    identityIds List<String>
    The list of User Assigned Managed Identity IDs assigned to this Microsoft SQL Server.
    principalId String
    The Principal ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
    tenantId String
    The Tenant ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
    type String
    The type of Managed Service Identity that is configured on this Microsoft SQL Server.
    identityIds string[]
    The list of User Assigned Managed Identity IDs assigned to this Microsoft SQL Server.
    principalId string
    The Principal ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
    tenantId string
    The Tenant ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
    type string
    The type of Managed Service Identity that is configured on this Microsoft SQL Server.
    identity_ids Sequence[str]
    The list of User Assigned Managed Identity IDs assigned to this Microsoft SQL Server.
    principal_id str
    The Principal ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
    tenant_id str
    The Tenant ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
    type str
    The type of Managed Service Identity that is configured on this Microsoft SQL Server.
    identityIds List<String>
    The list of User Assigned Managed Identity IDs assigned to this Microsoft SQL Server.
    principalId String
    The Principal ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
    tenantId String
    The Tenant ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
    type String
    The type of Managed Service Identity that is configured on this Microsoft SQL Server.

    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.67.1 published on Tuesday, Feb 27, 2024 by Pulumi