We recommend using Azure Native.
Azure v6.28.0 published on Friday, Oct 3, 2025 by Pulumi
azure.compute.getAvailabilitySet
Use this data source to access information about an existing Availability Set.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.compute.getAvailabilitySet({
    name: "tf-appsecuritygroup",
    resourceGroupName: "my-resource-group",
});
export const availabilitySetId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.compute.get_availability_set(name="tf-appsecuritygroup",
    resource_group_name="my-resource-group")
pulumi.export("availabilitySetId", example.id)
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := compute.LookupAvailabilitySet(ctx, &compute.LookupAvailabilitySetArgs{
			Name:              "tf-appsecuritygroup",
			ResourceGroupName: "my-resource-group",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("availabilitySetId", example.Id)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.Compute.GetAvailabilitySet.Invoke(new()
    {
        Name = "tf-appsecuritygroup",
        ResourceGroupName = "my-resource-group",
    });
    return new Dictionary<string, object?>
    {
        ["availabilitySetId"] = example.Apply(getAvailabilitySetResult => getAvailabilitySetResult.Id),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.compute.ComputeFunctions;
import com.pulumi.azure.compute.inputs.GetAvailabilitySetArgs;
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 = ComputeFunctions.getAvailabilitySet(GetAvailabilitySetArgs.builder()
            .name("tf-appsecuritygroup")
            .resourceGroupName("my-resource-group")
            .build());
        ctx.export("availabilitySetId", example.id());
    }
}
variables:
  example:
    fn::invoke:
      function: azure:compute:getAvailabilitySet
      arguments:
        name: tf-appsecuritygroup
        resourceGroupName: my-resource-group
outputs:
  availabilitySetId: ${example.id}
API Providers
This data source uses the following Azure API Providers:
- Microsoft.Compute- 2024-03-01
Using getAvailabilitySet
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 getAvailabilitySet(args: GetAvailabilitySetArgs, opts?: InvokeOptions): Promise<GetAvailabilitySetResult>
function getAvailabilitySetOutput(args: GetAvailabilitySetOutputArgs, opts?: InvokeOptions): Output<GetAvailabilitySetResult>def get_availability_set(name: Optional[str] = None,
                         resource_group_name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetAvailabilitySetResult
def get_availability_set_output(name: Optional[pulumi.Input[str]] = None,
                         resource_group_name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetAvailabilitySetResult]func LookupAvailabilitySet(ctx *Context, args *LookupAvailabilitySetArgs, opts ...InvokeOption) (*LookupAvailabilitySetResult, error)
func LookupAvailabilitySetOutput(ctx *Context, args *LookupAvailabilitySetOutputArgs, opts ...InvokeOption) LookupAvailabilitySetResultOutput> Note: This function is named LookupAvailabilitySet in the Go SDK.
public static class GetAvailabilitySet 
{
    public static Task<GetAvailabilitySetResult> InvokeAsync(GetAvailabilitySetArgs args, InvokeOptions? opts = null)
    public static Output<GetAvailabilitySetResult> Invoke(GetAvailabilitySetInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetAvailabilitySetResult> getAvailabilitySet(GetAvailabilitySetArgs args, InvokeOptions options)
public static Output<GetAvailabilitySetResult> getAvailabilitySet(GetAvailabilitySetArgs args, InvokeOptions options)
fn::invoke:
  function: azure:compute/getAvailabilitySet:getAvailabilitySet
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- The name of the Availability Set.
- ResourceGroup stringName 
- The name of the resource group in which the Availability Set exists.
- Name string
- The name of the Availability Set.
- ResourceGroup stringName 
- The name of the resource group in which the Availability Set exists.
- name String
- The name of the Availability Set.
- resourceGroup StringName 
- The name of the resource group in which the Availability Set exists.
- name string
- The name of the Availability Set.
- resourceGroup stringName 
- The name of the resource group in which the Availability Set exists.
- name str
- The name of the Availability Set.
- resource_group_ strname 
- The name of the resource group in which the Availability Set exists.
- name String
- The name of the Availability Set.
- resourceGroup StringName 
- The name of the resource group in which the Availability Set exists.
getAvailabilitySet Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The supported Azure location where the Availability Set exists.
- Managed bool
- Whether the availability set is managed or not.
- Name string
- PlatformFault stringDomain Count 
- The number of fault domains that are used.
- PlatformUpdate stringDomain Count 
- The number of update domains that are used.
- ResourceGroup stringName 
- Dictionary<string, string>
- A mapping of tags assigned to the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The supported Azure location where the Availability Set exists.
- Managed bool
- Whether the availability set is managed or not.
- Name string
- PlatformFault stringDomain Count 
- The number of fault domains that are used.
- PlatformUpdate stringDomain Count 
- The number of update domains that are used.
- ResourceGroup stringName 
- map[string]string
- A mapping of tags assigned to the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The supported Azure location where the Availability Set exists.
- managed Boolean
- Whether the availability set is managed or not.
- name String
- platformFault StringDomain Count 
- The number of fault domains that are used.
- platformUpdate StringDomain Count 
- The number of update domains that are used.
- resourceGroup StringName 
- Map<String,String>
- A mapping of tags assigned to the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- The supported Azure location where the Availability Set exists.
- managed boolean
- Whether the availability set is managed or not.
- name string
- platformFault stringDomain Count 
- The number of fault domains that are used.
- platformUpdate stringDomain Count 
- The number of update domains that are used.
- resourceGroup stringName 
- {[key: string]: string}
- A mapping of tags assigned to the resource.
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- The supported Azure location where the Availability Set exists.
- managed bool
- Whether the availability set is managed or not.
- name str
- platform_fault_ strdomain_ count 
- The number of fault domains that are used.
- platform_update_ strdomain_ count 
- The number of update domains that are used.
- resource_group_ strname 
- Mapping[str, str]
- A mapping of tags assigned to the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The supported Azure location where the Availability Set exists.
- managed Boolean
- Whether the availability set is managed or not.
- name String
- platformFault StringDomain Count 
- The number of fault domains that are used.
- platformUpdate StringDomain Count 
- The number of update domains that are used.
- resourceGroup StringName 
- Map<String>
- A mapping of tags assigned to the resource.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.
