1. Packages
  2. Packages
  3. Azure Classic
  4. API Docs
  5. compute
  6. getVirtualMachineScaleSet

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Use this data source to access information about an existing Virtual Machine Scale Set.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var example = Output.Create(Azure.Compute.GetVirtualMachineScaleSet.InvokeAsync(new Azure.Compute.GetVirtualMachineScaleSetArgs
            {
                Name = "existing",
                ResourceGroupName = "existing",
            }));
            this.Id = example.Apply(example => example.Id);
        }
    
        [Output("id")]
        public Output<string> Id { get; set; }
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := compute.GetVirtualMachineScaleSet(ctx, &compute.GetVirtualMachineScaleSetArgs{
    			Name:              "existing",
    			ResourceGroupName: "existing",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("id", example.Id)
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.compute.getVirtualMachineScaleSet({
        name: "existing",
        resourceGroupName: "existing",
    });
    export const id = example.then(example => example.id);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.compute.get_virtual_machine_scale_set(name="existing",
        resource_group_name="existing")
    pulumi.export("id", example.id)
    

    Example coming soon!

    Using getVirtualMachineScaleSet

    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 getVirtualMachineScaleSet(args: GetVirtualMachineScaleSetArgs, opts?: InvokeOptions): Promise<GetVirtualMachineScaleSetResult>
    function getVirtualMachineScaleSetOutput(args: GetVirtualMachineScaleSetOutputArgs, opts?: InvokeOptions): Output<GetVirtualMachineScaleSetResult>
    def get_virtual_machine_scale_set(name: Optional[str] = None,
                                      resource_group_name: Optional[str] = None,
                                      opts: Optional[InvokeOptions] = None) -> GetVirtualMachineScaleSetResult
    def get_virtual_machine_scale_set_output(name: Optional[pulumi.Input[str]] = None,
                                      resource_group_name: Optional[pulumi.Input[str]] = None,
                                      opts: Optional[InvokeOptions] = None) -> Output[GetVirtualMachineScaleSetResult]
    func GetVirtualMachineScaleSet(ctx *Context, args *GetVirtualMachineScaleSetArgs, opts ...InvokeOption) (*GetVirtualMachineScaleSetResult, error)
    func GetVirtualMachineScaleSetOutput(ctx *Context, args *GetVirtualMachineScaleSetOutputArgs, opts ...InvokeOption) GetVirtualMachineScaleSetResultOutput

    > Note: This function is named GetVirtualMachineScaleSet in the Go SDK.

    public static class GetVirtualMachineScaleSet 
    {
        public static Task<GetVirtualMachineScaleSetResult> InvokeAsync(GetVirtualMachineScaleSetArgs args, InvokeOptions? opts = null)
        public static Output<GetVirtualMachineScaleSetResult> Invoke(GetVirtualMachineScaleSetInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVirtualMachineScaleSetResult> getVirtualMachineScaleSet(GetVirtualMachineScaleSetArgs args, InvokeOptions options)
    public static Output<GetVirtualMachineScaleSetResult> getVirtualMachineScaleSet(GetVirtualMachineScaleSetArgs args, InvokeOptions options)
    
    fn::invoke:
      function: azure:compute/getVirtualMachineScaleSet:getVirtualMachineScaleSet
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of this Virtual Machine Scale Set.
    ResourceGroupName string
    The name of the Resource Group where the Virtual Machine Scale Set exists.
    Name string
    The name of this Virtual Machine Scale Set.
    ResourceGroupName string
    The name of the Resource Group where the Virtual Machine Scale Set exists.
    name String
    The name of this Virtual Machine Scale Set.
    resourceGroupName String
    The name of the Resource Group where the Virtual Machine Scale Set exists.
    name string
    The name of this Virtual Machine Scale Set.
    resourceGroupName string
    The name of the Resource Group where the Virtual Machine Scale Set exists.
    name str
    The name of this Virtual Machine Scale Set.
    resource_group_name str
    The name of the Resource Group where the Virtual Machine Scale Set exists.
    name String
    The name of this Virtual Machine Scale Set.
    resourceGroupName String
    The name of the Resource Group where the Virtual Machine Scale Set exists.

    getVirtualMachineScaleSet Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Identities List<GetVirtualMachineScaleSetIdentity>
    A identity block as defined below.
    Location string
    Name string
    The name of the public ip address configuration
    NetworkInterfaces List<GetVirtualMachineScaleSetNetworkInterface>
    A list of network_interface blocks as defined below.
    ResourceGroupName string
    Id string
    The provider-assigned unique ID for this managed resource.
    Identities []GetVirtualMachineScaleSetIdentity
    A identity block as defined below.
    Location string
    Name string
    The name of the public ip address configuration
    NetworkInterfaces []GetVirtualMachineScaleSetNetworkInterface
    A list of network_interface blocks as defined below.
    ResourceGroupName string
    id String
    The provider-assigned unique ID for this managed resource.
    identities List<GetVirtualMachineScaleSetIdentity>
    A identity block as defined below.
    location String
    name String
    The name of the public ip address configuration
    networkInterfaces List<GetVirtualMachineScaleSetNetworkInterface>
    A list of network_interface blocks as defined below.
    resourceGroupName String
    id string
    The provider-assigned unique ID for this managed resource.
    identities GetVirtualMachineScaleSetIdentity[]
    A identity block as defined below.
    location string
    name string
    The name of the public ip address configuration
    networkInterfaces GetVirtualMachineScaleSetNetworkInterface[]
    A list of network_interface blocks as defined below.
    resourceGroupName string
    id str
    The provider-assigned unique ID for this managed resource.
    identities Sequence[GetVirtualMachineScaleSetIdentity]
    A identity block as defined below.
    location str
    name str
    The name of the public ip address configuration
    network_interfaces Sequence[GetVirtualMachineScaleSetNetworkInterface]
    A list of network_interface blocks as defined below.
    resource_group_name str
    id String
    The provider-assigned unique ID for this managed resource.
    identities List<Property Map>
    A identity block as defined below.
    location String
    name String
    The name of the public ip address configuration
    networkInterfaces List<Property Map>
    A list of network_interface blocks as defined below.
    resourceGroupName String

    Supporting Types

    GetVirtualMachineScaleSetIdentity

    IdentityIds List<string>
    The list of User Managed Identity ID's which are assigned to the Virtual Machine Scale Set.
    PrincipalId string
    The ID of the System Managed Service Principal assigned to the Virtual Machine Scale Set.
    TenantId string
    Type string
    The identity type of the Managed Identity assigned to the Virtual Machine Scale Set.
    IdentityIds []string
    The list of User Managed Identity ID's which are assigned to the Virtual Machine Scale Set.
    PrincipalId string
    The ID of the System Managed Service Principal assigned to the Virtual Machine Scale Set.
    TenantId string
    Type string
    The identity type of the Managed Identity assigned to the Virtual Machine Scale Set.
    identityIds List<String>
    The list of User Managed Identity ID's which are assigned to the Virtual Machine Scale Set.
    principalId String
    The ID of the System Managed Service Principal assigned to the Virtual Machine Scale Set.
    tenantId String
    type String
    The identity type of the Managed Identity assigned to the Virtual Machine Scale Set.
    identityIds string[]
    The list of User Managed Identity ID's which are assigned to the Virtual Machine Scale Set.
    principalId string
    The ID of the System Managed Service Principal assigned to the Virtual Machine Scale Set.
    tenantId string
    type string
    The identity type of the Managed Identity assigned to the Virtual Machine Scale Set.
    identity_ids Sequence[str]
    The list of User Managed Identity ID's which are assigned to the Virtual Machine Scale Set.
    principal_id str
    The ID of the System Managed Service Principal assigned to the Virtual Machine Scale Set.
    tenant_id str
    type str
    The identity type of the Managed Identity assigned to the Virtual Machine Scale Set.
    identityIds List<String>
    The list of User Managed Identity ID's which are assigned to the Virtual Machine Scale Set.
    principalId String
    The ID of the System Managed Service Principal assigned to the Virtual Machine Scale Set.
    tenantId String
    type String
    The identity type of the Managed Identity assigned to the Virtual Machine Scale Set.

    GetVirtualMachineScaleSetNetworkInterface

    DnsServers List<string>
    The dns servers in use.
    EnableAcceleratedNetworking bool
    EnableIpForwarding bool
    IpConfigurations List<GetVirtualMachineScaleSetNetworkInterfaceIpConfiguration>
    An ip_configuration block as documented below.
    Name string
    The name of this Virtual Machine Scale Set.
    NetworkSecurityGroupId string
    The identifier for the network security group.
    Primary bool
    If this ip_configuration is the primary one.
    DnsServers []string
    The dns servers in use.
    EnableAcceleratedNetworking bool
    EnableIpForwarding bool
    IpConfigurations []GetVirtualMachineScaleSetNetworkInterfaceIpConfiguration
    An ip_configuration block as documented below.
    Name string
    The name of this Virtual Machine Scale Set.
    NetworkSecurityGroupId string
    The identifier for the network security group.
    Primary bool
    If this ip_configuration is the primary one.
    dnsServers List<String>
    The dns servers in use.
    enableAcceleratedNetworking Boolean
    enableIpForwarding Boolean
    ipConfigurations List<GetVirtualMachineScaleSetNetworkInterfaceIpConfiguration>
    An ip_configuration block as documented below.
    name String
    The name of this Virtual Machine Scale Set.
    networkSecurityGroupId String
    The identifier for the network security group.
    primary Boolean
    If this ip_configuration is the primary one.
    dnsServers string[]
    The dns servers in use.
    enableAcceleratedNetworking boolean
    enableIpForwarding boolean
    ipConfigurations GetVirtualMachineScaleSetNetworkInterfaceIpConfiguration[]
    An ip_configuration block as documented below.
    name string
    The name of this Virtual Machine Scale Set.
    networkSecurityGroupId string
    The identifier for the network security group.
    primary boolean
    If this ip_configuration is the primary one.
    dns_servers Sequence[str]
    The dns servers in use.
    enable_accelerated_networking bool
    enable_ip_forwarding bool
    ip_configurations Sequence[GetVirtualMachineScaleSetNetworkInterfaceIpConfiguration]
    An ip_configuration block as documented below.
    name str
    The name of this Virtual Machine Scale Set.
    network_security_group_id str
    The identifier for the network security group.
    primary bool
    If this ip_configuration is the primary one.
    dnsServers List<String>
    The dns servers in use.
    enableAcceleratedNetworking Boolean
    enableIpForwarding Boolean
    ipConfigurations List<Property Map>
    An ip_configuration block as documented below.
    name String
    The name of this Virtual Machine Scale Set.
    networkSecurityGroupId String
    The identifier for the network security group.
    primary Boolean
    If this ip_configuration is the primary one.

    GetVirtualMachineScaleSetNetworkInterfaceIpConfiguration

    ApplicationGatewayBackendAddressPoolIds List<string>
    An array of references to backend address pools of application gateways.
    ApplicationSecurityGroupIds List<string>
    The application security group IDs to use.
    LoadBalancerBackendAddressPoolIds List<string>
    An array of references to backend address pools of load balancers.
    LoadBalancerInboundNatRulesIds List<string>
    An array of references to inbound NAT pools for load balancers.
    Name string
    The name of this Virtual Machine Scale Set.
    Primary bool
    If this ip_configuration is the primary one.
    PublicIpAddresses List<GetVirtualMachineScaleSetNetworkInterfaceIpConfigurationPublicIpAddress>
    SubnetId string
    The the identifier of the subnet.
    Version string
    ApplicationGatewayBackendAddressPoolIds []string
    An array of references to backend address pools of application gateways.
    ApplicationSecurityGroupIds []string
    The application security group IDs to use.
    LoadBalancerBackendAddressPoolIds []string
    An array of references to backend address pools of load balancers.
    LoadBalancerInboundNatRulesIds []string
    An array of references to inbound NAT pools for load balancers.
    Name string
    The name of this Virtual Machine Scale Set.
    Primary bool
    If this ip_configuration is the primary one.
    PublicIpAddresses []GetVirtualMachineScaleSetNetworkInterfaceIpConfigurationPublicIpAddress
    SubnetId string
    The the identifier of the subnet.
    Version string
    applicationGatewayBackendAddressPoolIds List<String>
    An array of references to backend address pools of application gateways.
    applicationSecurityGroupIds List<String>
    The application security group IDs to use.
    loadBalancerBackendAddressPoolIds List<String>
    An array of references to backend address pools of load balancers.
    loadBalancerInboundNatRulesIds List<String>
    An array of references to inbound NAT pools for load balancers.
    name String
    The name of this Virtual Machine Scale Set.
    primary Boolean
    If this ip_configuration is the primary one.
    publicIpAddresses List<GetVirtualMachineScaleSetNetworkInterfaceIpConfigurationPublicIpAddress>
    subnetId String
    The the identifier of the subnet.
    version String
    applicationGatewayBackendAddressPoolIds string[]
    An array of references to backend address pools of application gateways.
    applicationSecurityGroupIds string[]
    The application security group IDs to use.
    loadBalancerBackendAddressPoolIds string[]
    An array of references to backend address pools of load balancers.
    loadBalancerInboundNatRulesIds string[]
    An array of references to inbound NAT pools for load balancers.
    name string
    The name of this Virtual Machine Scale Set.
    primary boolean
    If this ip_configuration is the primary one.
    publicIpAddresses GetVirtualMachineScaleSetNetworkInterfaceIpConfigurationPublicIpAddress[]
    subnetId string
    The the identifier of the subnet.
    version string
    application_gateway_backend_address_pool_ids Sequence[str]
    An array of references to backend address pools of application gateways.
    application_security_group_ids Sequence[str]
    The application security group IDs to use.
    load_balancer_backend_address_pool_ids Sequence[str]
    An array of references to backend address pools of load balancers.
    load_balancer_inbound_nat_rules_ids Sequence[str]
    An array of references to inbound NAT pools for load balancers.
    name str
    The name of this Virtual Machine Scale Set.
    primary bool
    If this ip_configuration is the primary one.
    public_ip_addresses Sequence[GetVirtualMachineScaleSetNetworkInterfaceIpConfigurationPublicIpAddress]
    subnet_id str
    The the identifier of the subnet.
    version str
    applicationGatewayBackendAddressPoolIds List<String>
    An array of references to backend address pools of application gateways.
    applicationSecurityGroupIds List<String>
    The application security group IDs to use.
    loadBalancerBackendAddressPoolIds List<String>
    An array of references to backend address pools of load balancers.
    loadBalancerInboundNatRulesIds List<String>
    An array of references to inbound NAT pools for load balancers.
    name String
    The name of this Virtual Machine Scale Set.
    primary Boolean
    If this ip_configuration is the primary one.
    publicIpAddresses List<Property Map>
    subnetId String
    The the identifier of the subnet.
    version String

    GetVirtualMachineScaleSetNetworkInterfaceIpConfigurationPublicIpAddress

    DomainNameLabel string
    The domain name label for the dns settings.
    IdleTimeoutInMinutes int
    IpTags List<GetVirtualMachineScaleSetNetworkInterfaceIpConfigurationPublicIpAddressIpTag>
    Name string
    The name of this Virtual Machine Scale Set.
    PublicIpPrefixId string
    DomainNameLabel string
    The domain name label for the dns settings.
    IdleTimeoutInMinutes int
    IpTags []GetVirtualMachineScaleSetNetworkInterfaceIpConfigurationPublicIpAddressIpTag
    Name string
    The name of this Virtual Machine Scale Set.
    PublicIpPrefixId string
    domainNameLabel String
    The domain name label for the dns settings.
    idleTimeoutInMinutes Integer
    ipTags List<GetVirtualMachineScaleSetNetworkInterfaceIpConfigurationPublicIpAddressIpTag>
    name String
    The name of this Virtual Machine Scale Set.
    publicIpPrefixId String
    domainNameLabel string
    The domain name label for the dns settings.
    idleTimeoutInMinutes number
    ipTags GetVirtualMachineScaleSetNetworkInterfaceIpConfigurationPublicIpAddressIpTag[]
    name string
    The name of this Virtual Machine Scale Set.
    publicIpPrefixId string
    domainNameLabel String
    The domain name label for the dns settings.
    idleTimeoutInMinutes Number
    ipTags List<Property Map>
    name String
    The name of this Virtual Machine Scale Set.
    publicIpPrefixId String

    GetVirtualMachineScaleSetNetworkInterfaceIpConfigurationPublicIpAddressIpTag

    Tag string
    Type string
    The identity type of the Managed Identity assigned to the Virtual Machine Scale Set.
    Tag string
    Type string
    The identity type of the Managed Identity assigned to the Virtual Machine Scale Set.
    tag String
    type String
    The identity type of the Managed Identity assigned to the Virtual Machine Scale Set.
    tag string
    type string
    The identity type of the Managed Identity assigned to the Virtual Machine Scale Set.
    tag str
    type str
    The identity type of the Managed Identity assigned to the Virtual Machine Scale Set.
    tag String
    type String
    The identity type of the Managed Identity assigned to the Virtual Machine Scale Set.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial