We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Use this data source to access information about an existing Microsoft SQL Server.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Azure.MSSql.GetServer.InvokeAsync(new Azure.MSSql.GetServerArgs
{
Name = "existingMsSqlServer",
ResourceGroupName = "existingResGroup",
}));
this.Id = example.Apply(example => example.Id);
}
[Output("id")]
public Output<string> Id { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v4/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
})
}
Example coming soon!
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);
import pulumi
import pulumi_azure as azure
example = azure.mssql.get_server(name="existingMsSqlServer",
resource_group_name="existingResGroup")
pulumi.export("id", example.id)
Example coming soon!
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)
public static Output<GetServerResult> getServer(GetServerArgs args, InvokeOptions options)
fn::invoke:
function: azure:mssql/getServer:getServer
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The name of this Microsoft SQL Server.
- Resource
Group stringName - The name of the Resource Group where the Microsoft SQL Server exists.
- Name string
- The name of this Microsoft SQL Server.
- Resource
Group stringName - The name of the Resource Group where the Microsoft SQL Server exists.
- name String
- The name of this Microsoft SQL Server.
- resource
Group StringName - The name of the Resource Group where the Microsoft SQL Server exists.
- name string
- The name of this Microsoft SQL Server.
- resource
Group stringName - The name of the Resource Group where the Microsoft SQL Server exists.
- name str
- The name of this Microsoft SQL Server.
- resource_
group_ strname - The name of the Resource Group where the Microsoft SQL Server exists.
- name String
- The name of this Microsoft SQL Server.
- resource
Group StringName - The name of the Resource Group where the Microsoft SQL Server exists.
getServer Result
The following output properties are available:
- Administrator
Login string - The server's administrator login name.
- Fully
Qualified stringDomain Name - The fully qualified domain name of the Azure SQL Server.
- Id string
- The provider-assigned unique ID for this managed resource.
- Identities
List<Get
Server Identity> - A
identityblock as defined below. - Location string
- The Azure Region where the Microsoft SQL Server exists.
- Name string
- Resource
Group stringName - Restorable
Dropped List<string>Database Ids - A list of dropped restorable database IDs on the server.
- Dictionary<string, string>
- A mapping of tags assigned to this Microsoft SQL Server.
- Version string
- This servers MS SQL version.
- Administrator
Login string - The server's administrator login name.
- Fully
Qualified stringDomain Name - The fully qualified domain name of the Azure SQL Server.
- Id string
- The provider-assigned unique ID for this managed resource.
- Identities
[]Get
Server Identity - A
identityblock as defined below. - Location string
- The Azure Region where the Microsoft SQL Server exists.
- Name string
- Resource
Group stringName - Restorable
Dropped []stringDatabase Ids - A list of dropped restorable database IDs on the server.
- map[string]string
- A mapping of tags assigned to this Microsoft SQL Server.
- Version string
- This servers MS SQL version.
- administrator
Login String - The server's administrator login name.
- fully
Qualified StringDomain Name - The fully qualified domain name of the Azure SQL Server.
- id String
- The provider-assigned unique ID for this managed resource.
- identities
List<Get
Server Identity> - A
identityblock as defined below. - location String
- The Azure Region where the Microsoft SQL Server exists.
- name String
- resource
Group StringName - restorable
Dropped List<String>Database Ids - A list of dropped restorable database IDs on the server.
- Map<String,String>
- A mapping of tags assigned to this Microsoft SQL Server.
- version String
- This servers MS SQL version.
- administrator
Login string - The server's administrator login name.
- fully
Qualified stringDomain Name - The fully qualified domain name of the Azure SQL Server.
- id string
- The provider-assigned unique ID for this managed resource.
- identities
Get
Server Identity[] - A
identityblock as defined below. - location string
- The Azure Region where the Microsoft SQL Server exists.
- name string
- resource
Group stringName - restorable
Dropped string[]Database Ids - A list of dropped restorable database IDs on the server.
- {[key: string]: string}
- A mapping of tags assigned to this Microsoft SQL Server.
- version string
- This servers MS SQL version.
- administrator_
login str - The server's administrator login name.
- fully_
qualified_ strdomain_ name - The fully qualified domain name of the Azure SQL Server.
- id str
- The provider-assigned unique ID for this managed resource.
- identities
Sequence[Get
Server Identity] - A
identityblock as defined below. - location str
- The Azure Region where the Microsoft SQL Server exists.
- name str
- resource_
group_ strname - restorable_
dropped_ Sequence[str]database_ ids - A list of dropped restorable database IDs on the server.
- Mapping[str, str]
- A mapping of tags assigned to this Microsoft SQL Server.
- version str
- This servers MS SQL version.
- administrator
Login String - The server's administrator login name.
- fully
Qualified StringDomain Name - 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
identityblock as defined below. - location String
- The Azure Region where the Microsoft SQL Server exists.
- name String
- resource
Group StringName - restorable
Dropped List<String>Database Ids - A list of dropped restorable database IDs on the server.
- Map<String>
- A mapping of tags assigned to this Microsoft SQL Server.
- version String
- This servers MS SQL version.
Supporting Types
GetServerIdentity
- Principal
Id string - The Principal ID for the Service Principal associated with the Identity of this SQL Server.
- Tenant
Id string - The Tenant ID for the Service Principal associated with the Identity of this SQL Server.
- Type string
- The identity type of the Microsoft SQL Server.
- User
Assigned List<string>Identity Ids - A list of the User Assigned Identities of this SQL Server.
- Principal
Id string - The Principal ID for the Service Principal associated with the Identity of this SQL Server.
- Tenant
Id string - The Tenant ID for the Service Principal associated with the Identity of this SQL Server.
- Type string
- The identity type of the Microsoft SQL Server.
- User
Assigned []stringIdentity Ids - A list of the User Assigned Identities of this SQL Server.
- principal
Id String - The Principal ID for the Service Principal associated with the Identity of this SQL Server.
- tenant
Id String - The Tenant ID for the Service Principal associated with the Identity of this SQL Server.
- type String
- The identity type of the Microsoft SQL Server.
- user
Assigned List<String>Identity Ids - A list of the User Assigned Identities of this SQL Server.
- principal
Id string - The Principal ID for the Service Principal associated with the Identity of this SQL Server.
- tenant
Id string - The Tenant ID for the Service Principal associated with the Identity of this SQL Server.
- type string
- The identity type of the Microsoft SQL Server.
- user
Assigned string[]Identity Ids - A list of the User Assigned Identities of this SQL Server.
- principal_
id str - The Principal ID for the Service Principal associated with the Identity of this SQL Server.
- tenant_
id str - The Tenant ID for the Service Principal associated with the Identity of this SQL Server.
- type str
- The identity type of the Microsoft SQL Server.
- user_
assigned_ Sequence[str]identity_ ids - A list of the User Assigned Identities of this SQL Server.
- principal
Id String - The Principal ID for the Service Principal associated with the Identity of this SQL Server.
- tenant
Id String - The Tenant ID for the Service Principal associated with the Identity of this SQL Server.
- type String
- The identity type of the Microsoft SQL Server.
- user
Assigned List<String>Identity Ids - A list of the User Assigned Identities of this SQL Server.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
