We recommend using Azure Native.
Azure v6.28.0 published on Friday, Oct 3, 2025 by Pulumi
azure.mssql.getFailoverGroup
Start a Neo task
Explain and create an azure.mssql.getFailoverGroup resource
Use this data source to access information about an existing Microsoft Azure SQL Failover Group.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.mssql.getFailoverGroup({
name: "example",
serverId: "example-sql-server",
});
export const mssqlFailoverGroupId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.mssql.get_failover_group(name="example",
server_id="example-sql-server")
pulumi.export("mssqlFailoverGroupId", example.id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/mssql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := mssql.LookupFailoverGroup(ctx, &mssql.LookupFailoverGroupArgs{
Name: "example",
ServerId: "example-sql-server",
}, nil)
if err != nil {
return err
}
ctx.Export("mssqlFailoverGroupId", example.Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.MSSql.GetFailoverGroup.Invoke(new()
{
Name = "example",
ServerId = "example-sql-server",
});
return new Dictionary<string, object?>
{
["mssqlFailoverGroupId"] = example.Apply(getFailoverGroupResult => getFailoverGroupResult.Id),
};
});
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.GetFailoverGroupArgs;
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.getFailoverGroup(GetFailoverGroupArgs.builder()
.name("example")
.serverId("example-sql-server")
.build());
ctx.export("mssqlFailoverGroupId", example.id());
}
}
variables:
example:
fn::invoke:
function: azure:mssql:getFailoverGroup
arguments:
name: example
serverId: example-sql-server
outputs:
mssqlFailoverGroupId: ${example.id}
API Providers
This data source uses the following Azure API Providers:
Microsoft.Sql- 2023-08-01-preview
Using getFailoverGroup
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 getFailoverGroup(args: GetFailoverGroupArgs, opts?: InvokeOptions): Promise<GetFailoverGroupResult>
function getFailoverGroupOutput(args: GetFailoverGroupOutputArgs, opts?: InvokeOptions): Output<GetFailoverGroupResult>def get_failover_group(name: Optional[str] = None,
server_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetFailoverGroupResult
def get_failover_group_output(name: Optional[pulumi.Input[str]] = None,
server_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetFailoverGroupResult]func LookupFailoverGroup(ctx *Context, args *LookupFailoverGroupArgs, opts ...InvokeOption) (*LookupFailoverGroupResult, error)
func LookupFailoverGroupOutput(ctx *Context, args *LookupFailoverGroupOutputArgs, opts ...InvokeOption) LookupFailoverGroupResultOutput> Note: This function is named LookupFailoverGroup in the Go SDK.
public static class GetFailoverGroup
{
public static Task<GetFailoverGroupResult> InvokeAsync(GetFailoverGroupArgs args, InvokeOptions? opts = null)
public static Output<GetFailoverGroupResult> Invoke(GetFailoverGroupInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetFailoverGroupResult> getFailoverGroup(GetFailoverGroupArgs args, InvokeOptions options)
public static Output<GetFailoverGroupResult> getFailoverGroup(GetFailoverGroupArgs args, InvokeOptions options)
fn::invoke:
function: azure:mssql/getFailoverGroup:getFailoverGroup
arguments:
# arguments dictionaryThe following arguments are supported:
getFailoverGroup Result
The following output properties are available:
- Databases List<string>
- A set of database names in the Failover Group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Partner
Servers List<GetFailover Group Partner Server> - A
partner_serverblock as defined below. - Read
Write List<GetEndpoint Failover Policies Failover Group Read Write Endpoint Failover Policy> - A
read_write_endpoint_failover_policyblock as defined below. - Readonly
Endpoint boolFailover Policy Enabled - Whether failover is enabled for the readonly endpoint.
- Server
Id string - Dictionary<string, string>
- A mapping of tags which are assigned to the resource.
- Databases []string
- A set of database names in the Failover Group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Partner
Servers []GetFailover Group Partner Server - A
partner_serverblock as defined below. - Read
Write []GetEndpoint Failover Policies Failover Group Read Write Endpoint Failover Policy - A
read_write_endpoint_failover_policyblock as defined below. - Readonly
Endpoint boolFailover Policy Enabled - Whether failover is enabled for the readonly endpoint.
- Server
Id string - map[string]string
- A mapping of tags which are assigned to the resource.
- databases List<String>
- A set of database names in the Failover Group.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- partner
Servers List<GetFailover Group Partner Server> - A
partner_serverblock as defined below. - read
Write List<GetEndpoint Failover Policies Failover Group Read Write Endpoint Failover Policy> - A
read_write_endpoint_failover_policyblock as defined below. - readonly
Endpoint BooleanFailover Policy Enabled - Whether failover is enabled for the readonly endpoint.
- server
Id String - Map<String,String>
- A mapping of tags which are assigned to the resource.
- databases string[]
- A set of database names in the Failover Group.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- partner
Servers GetFailover Group Partner Server[] - A
partner_serverblock as defined below. - read
Write GetEndpoint Failover Policies Failover Group Read Write Endpoint Failover Policy[] - A
read_write_endpoint_failover_policyblock as defined below. - readonly
Endpoint booleanFailover Policy Enabled - Whether failover is enabled for the readonly endpoint.
- server
Id string - {[key: string]: string}
- A mapping of tags which are assigned to the resource.
- databases Sequence[str]
- A set of database names in the Failover Group.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- partner_
servers Sequence[GetFailover Group Partner Server] - A
partner_serverblock as defined below. - read_
write_ Sequence[Getendpoint_ failover_ policies Failover Group Read Write Endpoint Failover Policy] - A
read_write_endpoint_failover_policyblock as defined below. - readonly_
endpoint_ boolfailover_ policy_ enabled - Whether failover is enabled for the readonly endpoint.
- server_
id str - Mapping[str, str]
- A mapping of tags which are assigned to the resource.
- databases List<String>
- A set of database names in the Failover Group.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- partner
Servers List<Property Map> - A
partner_serverblock as defined below. - read
Write List<Property Map>Endpoint Failover Policies - A
read_write_endpoint_failover_policyblock as defined below. - readonly
Endpoint BooleanFailover Policy Enabled - Whether failover is enabled for the readonly endpoint.
- server
Id String - Map<String>
- A mapping of tags which are assigned to the resource.
Supporting Types
GetFailoverGroupPartnerServer
GetFailoverGroupReadWriteEndpointFailoverPolicy
- Grace
Minutes int - The grace period in minutes, before failover with data loss is attempted for the read-write endpoint.
- Mode string
- The failover policy of the read-write endpoint for the Failover Group.
- Grace
Minutes int - The grace period in minutes, before failover with data loss is attempted for the read-write endpoint.
- Mode string
- The failover policy of the read-write endpoint for the Failover Group.
- grace
Minutes Integer - The grace period in minutes, before failover with data loss is attempted for the read-write endpoint.
- mode String
- The failover policy of the read-write endpoint for the Failover Group.
- grace
Minutes number - The grace period in minutes, before failover with data loss is attempted for the read-write endpoint.
- mode string
- The failover policy of the read-write endpoint for the Failover Group.
- grace_
minutes int - The grace period in minutes, before failover with data loss is attempted for the read-write endpoint.
- mode str
- The failover policy of the read-write endpoint for the Failover Group.
- grace
Minutes Number - The grace period in minutes, before failover with data loss is attempted for the read-write endpoint.
- mode String
- The failover policy of the read-write endpoint for the Failover Group.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
