getServer

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

Example Usage

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()));
}
}

Return

A collection of values returned by getServer.

Parameters

argument

A collection of arguments for invoking getServer.


suspend fun getServer(name: String, resourceGroupName: String): GetServerResult

Return

A collection of values returned by getServer.

See also

Parameters

name

The name of this Microsoft SQL Server.

resourceGroupName

The name of the Resource Group where the Microsoft SQL Server exists.


suspend fun getServer(argument: suspend GetServerPlainArgsBuilder.() -> Unit): GetServerResult

Return

A collection of values returned by getServer.

See also

Parameters

argument

Builder for com.pulumi.azure.mssql.kotlin.inputs.GetServerPlainArgs.