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
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Azure.Sql.GetServer.InvokeAsync(new Azure.Sql.GetServerArgs
{
Name = "examplesqlservername",
ResourceGroupName = "example-resources",
}));
this.SqlServerId = example.Apply(example => example.Id);
}
[Output("sqlServerId")]
public Output<string> SqlServerId { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/sql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := sql.GetServer(ctx, &sql.GetServerArgs{
Name: "examplesqlservername",
ResourceGroupName: "example-resources",
}, nil)
if err != nil {
return err
}
ctx.Export("sqlServerId", example.Id)
return nil
})
}
Example coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.sql.getServer({
name: "examplesqlservername",
resourceGroupName: "example-resources",
});
export const sqlServerId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.sql.get_server(name="examplesqlservername",
resource_group_name="example-resources")
pulumi.export("sqlServerId", 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 GetServer(ctx *Context, args *GetServerArgs, opts ...InvokeOption) (*GetServerResult, error)
func GetServerOutput(ctx *Context, args *GetServerOutputArgs, opts ...InvokeOption) GetServerResultOutput> Note: This function is named GetServer 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:sql/getServer:getServer
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The name of the SQL Server.
- Resource
Group stringName - Specifies the name of the Resource Group where the SQL Server exists.
- Name string
- The name of the SQL Server.
- Resource
Group stringName - Specifies the name of the Resource Group where the SQL Server exists.
- name String
- The name of the SQL Server.
- resource
Group StringName - Specifies the name of the Resource Group where the SQL Server exists.
- name string
- The name of the SQL Server.
- resource
Group stringName - Specifies the name of the Resource Group where the SQL Server exists.
- name str
- The name of the SQL Server.
- resource_
group_ strname - Specifies the name of the Resource Group where the SQL Server exists.
- name String
- The name of the SQL Server.
- resource
Group StringName - Specifies the name of the Resource Group where the SQL Server exists.
getServer Result
The following output properties are available:
- Administrator
Login string - The administrator username of the SQL Server.
- Fqdn string
- The fully qualified domain name of the SQL Server.
- Id string
- The provider-assigned unique ID for this managed resource.
- Identities
List<Get
Server Identity> - An
identityblock as defined below. - Location string
- The location of the Resource Group in which the SQL Server exists.
- Name string
- Resource
Group stringName - Dictionary<string, string>
- A mapping of tags assigned to the resource.
- Version string
- The version of the SQL Server.
- Administrator
Login string - The administrator username of the SQL Server.
- Fqdn string
- The fully qualified domain name of the SQL Server.
- Id string
- The provider-assigned unique ID for this managed resource.
- Identities
[]Get
Server Identity - An
identityblock as defined below. - Location string
- The location of the Resource Group in which the SQL Server exists.
- Name string
- Resource
Group stringName - map[string]string
- A mapping of tags assigned to the resource.
- Version string
- The version of the SQL Server.
- administrator
Login String - The administrator username of the SQL Server.
- fqdn String
- The fully qualified domain name of the SQL Server.
- id String
- The provider-assigned unique ID for this managed resource.
- identities
List<Get
Server Identity> - An
identityblock as defined below. - location String
- The location of the Resource Group in which the SQL Server exists.
- name String
- resource
Group StringName - Map<String,String>
- A mapping of tags assigned to the resource.
- version String
- The version of the SQL Server.
- administrator
Login string - The administrator username of the SQL Server.
- fqdn string
- The fully qualified domain name of the SQL Server.
- id string
- The provider-assigned unique ID for this managed resource.
- identities
Get
Server Identity[] - An
identityblock as defined below. - location string
- The location of the Resource Group in which the SQL Server exists.
- name string
- resource
Group stringName - {[key: string]: string}
- A mapping of tags assigned to the resource.
- version string
- The version of the SQL Server.
- administrator_
login str - The administrator username of the SQL Server.
- fqdn str
- The fully qualified domain name of the SQL Server.
- id str
- The provider-assigned unique ID for this managed resource.
- identities
Sequence[Get
Server Identity] - An
identityblock as defined below. - location str
- The location of the Resource Group in which the SQL Server exists.
- name str
- resource_
group_ strname - Mapping[str, str]
- A mapping of tags assigned to the resource.
- version str
- The version of the SQL Server.
- administrator
Login String - The administrator username of the SQL Server.
- fqdn String
- The fully qualified domain name of the SQL Server.
- id String
- The provider-assigned unique ID for this managed resource.
- identities List<Property Map>
- An
identityblock as defined below. - location String
- The location of the Resource Group in which the SQL Server exists.
- name String
- resource
Group StringName - Map<String>
- A mapping of tags assigned to the resource.
- version String
- The version of the SQL Server.
Supporting Types
GetServerIdentity
- Principal
Id string - The ID of the Principal (Client) in Azure Active Directory.
- Tenant
Id string - The ID of the Azure Active Directory Tenant.
- Type string
- The identity type of the SQL Server.
- Principal
Id string - The ID of the Principal (Client) in Azure Active Directory.
- Tenant
Id string - The ID of the Azure Active Directory Tenant.
- Type string
- The identity type of the SQL Server.
- principal
Id String - The ID of the Principal (Client) in Azure Active Directory.
- tenant
Id String - The ID of the Azure Active Directory Tenant.
- type String
- The identity type of the SQL Server.
- principal
Id string - The ID of the Principal (Client) in Azure Active Directory.
- tenant
Id string - The ID of the Azure Active Directory Tenant.
- type string
- The identity type of the SQL Server.
- principal_
id str - The ID of the Principal (Client) in Azure Active Directory.
- tenant_
id str - The ID of the Azure Active Directory Tenant.
- type str
- The identity type of the SQL Server.
- principal
Id String - The ID of the Principal (Client) in Azure Active Directory.
- tenant
Id String - The ID of the Azure Active Directory Tenant.
- type String
- The identity type of the 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
