We recommend using Azure Native.
azure.mssql.getServer
Explore with Pulumi AI
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.
- 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
identity
block 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
identity
block 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
identity
block 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
identity
block 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
identity
block 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
identity
block 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
- Identity
Ids List<string> The list of User Assigned Managed Identity IDs assigned to this Microsoft SQL Server.
- Principal
Id string The Principal ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
- Tenant
Id 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 []string The list of User Assigned Managed Identity IDs assigned to this Microsoft SQL Server.
- Principal
Id string The Principal ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
- Tenant
Id 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 List<String> The list of User Assigned Managed Identity IDs assigned to this Microsoft SQL Server.
- principal
Id String The Principal ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
- tenant
Id 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 string[] The list of User Assigned Managed Identity IDs assigned to this Microsoft SQL Server.
- principal
Id string The Principal ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
- tenant
Id 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.
- identity
Ids List<String> The list of User Assigned Managed Identity IDs assigned to this Microsoft SQL Server.
- principal
Id String The Principal ID of the System Assigned Managed Service Identity that is configured on this Microsoft SQL Server.
- tenant
Id 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.