1. Packages
  2. Packages
  3. Azure Classic
  4. API Docs
  5. maintenance
  6. AssignmentVirtualMachineScaleSet

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

    Manages a maintenance assignment to a virtual machine scale set.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
            {
                Location = "West Europe",
            });
            var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new Azure.Network.VirtualNetworkArgs
            {
                AddressSpaces = 
                {
                    "10.0.0.0/16",
                },
                Location = exampleResourceGroup.Location,
                ResourceGroupName = exampleResourceGroup.Name,
            });
            var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new Azure.Network.SubnetArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                VirtualNetworkName = exampleVirtualNetwork.Name,
                AddressPrefixes = 
                {
                    "10.0.2.0/24",
                },
            });
            var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new Azure.Network.PublicIpArgs
            {
                Location = exampleResourceGroup.Location,
                ResourceGroupName = exampleResourceGroup.Name,
                AllocationMethod = "Static",
            });
            var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new Azure.Lb.LoadBalancerArgs
            {
                Location = exampleResourceGroup.Location,
                ResourceGroupName = exampleResourceGroup.Name,
                FrontendIpConfigurations = 
                {
                    new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs
                    {
                        Name = "internal",
                        PublicIpAddressId = azurerm_public_ip.Test.Id,
                    },
                },
            });
            var exampleBackendAddressPool = new Azure.Lb.BackendAddressPool("exampleBackendAddressPool", new Azure.Lb.BackendAddressPoolArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                LoadbalancerId = azurerm_lb.Test.Id,
            });
            var exampleProbe = new Azure.Lb.Probe("exampleProbe", new Azure.Lb.ProbeArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                LoadbalancerId = azurerm_lb.Test.Id,
                Port = 22,
                Protocol = "Tcp",
            });
            var exampleRule = new Azure.Lb.Rule("exampleRule", new Azure.Lb.RuleArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                LoadbalancerId = azurerm_lb.Test.Id,
                ProbeId = azurerm_lb_probe.Test.Id,
                BackendAddressPoolId = azurerm_lb_backend_address_pool.Test.Id,
                FrontendIpConfigurationName = "internal",
                Protocol = "Tcp",
                FrontendPort = 22,
                BackendPort = 22,
            });
            var exampleConfiguration = new Azure.Maintenance.Configuration("exampleConfiguration", new Azure.Maintenance.ConfigurationArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                Location = exampleResourceGroup.Location,
                Scope = "OSImage",
                Visibility = "Custom",
                Window = new Azure.Maintenance.Inputs.ConfigurationWindowArgs
                {
                    StartDateTime = "2021-12-31 00:00",
                    ExpirationDateTime = "9999-12-31 00:00",
                    Duration = "06:00",
                    TimeZone = "Pacific Standard Time",
                    RecurEvery = "1Days",
                },
            });
            var exampleLinuxVirtualMachineScaleSet = new Azure.Compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", new Azure.Compute.LinuxVirtualMachineScaleSetArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                Location = exampleResourceGroup.Location,
                Sku = "Standard_F2",
                Instances = 1,
                AdminUsername = "adminuser",
                AdminPassword = "P@ssword1234!",
                UpgradeMode = "Automatic",
                HealthProbeId = exampleProbe.Id,
                DisablePasswordAuthentication = false,
                SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs
                {
                    Publisher = "Canonical",
                    Offer = "UbuntuServer",
                    Sku = "16.04-LTS",
                    Version = "latest",
                },
                OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetOsDiskArgs
                {
                    StorageAccountType = "Standard_LRS",
                    Caching = "ReadWrite",
                },
                NetworkInterfaces = 
                {
                    new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs
                    {
                        Name = "example",
                        Primary = true,
                        IpConfigurations = 
                        {
                            new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs
                            {
                                Name = "internal",
                                Primary = true,
                                SubnetId = exampleSubnet.Id,
                                LoadBalancerBackendAddressPoolIds = 
                                {
                                    exampleBackendAddressPool.Id,
                                },
                            },
                        },
                    },
                },
                AutomaticOsUpgradePolicy = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetAutomaticOsUpgradePolicyArgs
                {
                    DisableAutomaticRollback = true,
                    EnableAutomaticOsUpgrade = true,
                },
                RollingUpgradePolicy = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs
                {
                    MaxBatchInstancePercent = 20,
                    MaxUnhealthyInstancePercent = 20,
                    MaxUnhealthyUpgradedInstancePercent = 20,
                    PauseTimeBetweenBatches = "PT0S",
                },
            }, new CustomResourceOptions
            {
                DependsOn = 
                {
                    "azurerm_lb_rule.example",
                },
            });
            var exampleAssignmentVirtualMachineScaleSet = new Azure.Maintenance.AssignmentVirtualMachineScaleSet("exampleAssignmentVirtualMachineScaleSet", new Azure.Maintenance.AssignmentVirtualMachineScaleSetArgs
            {
                Location = exampleResourceGroup.Location,
                MaintenanceConfigurationId = exampleConfiguration.Id,
                VirtualMachineScaleSetId = azurerm_linux_virtual_machine.Example.Id,
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/compute"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/lb"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/maintenance"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/network"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
    			AddressSpaces: pulumi.StringArray{
    				pulumi.String("10.0.0.0/16"),
    			},
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    		})
    		if err != nil {
    			return err
    		}
    		exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{
    			ResourceGroupName:  exampleResourceGroup.Name,
    			VirtualNetworkName: exampleVirtualNetwork.Name,
    			AddressPrefixes: pulumi.StringArray{
    				pulumi.String("10.0.2.0/24"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    			AllocationMethod:  pulumi.String("Static"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    			FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{
    				&lb.LoadBalancerFrontendIpConfigurationArgs{
    					Name:              pulumi.String("internal"),
    					PublicIpAddressId: pulumi.Any(azurerm_public_ip.Test.Id),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleBackendAddressPool, err := lb.NewBackendAddressPool(ctx, "exampleBackendAddressPool", &lb.BackendAddressPoolArgs{
    			ResourceGroupName: exampleResourceGroup.Name,
    			LoadbalancerId:    pulumi.Any(azurerm_lb.Test.Id),
    		})
    		if err != nil {
    			return err
    		}
    		exampleProbe, err := lb.NewProbe(ctx, "exampleProbe", &lb.ProbeArgs{
    			ResourceGroupName: exampleResourceGroup.Name,
    			LoadbalancerId:    pulumi.Any(azurerm_lb.Test.Id),
    			Port:              pulumi.Int(22),
    			Protocol:          pulumi.String("Tcp"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = lb.NewRule(ctx, "exampleRule", &lb.RuleArgs{
    			ResourceGroupName:           exampleResourceGroup.Name,
    			LoadbalancerId:              pulumi.Any(azurerm_lb.Test.Id),
    			ProbeId:                     pulumi.Any(azurerm_lb_probe.Test.Id),
    			BackendAddressPoolId:        pulumi.Any(azurerm_lb_backend_address_pool.Test.Id),
    			FrontendIpConfigurationName: pulumi.String("internal"),
    			Protocol:                    pulumi.String("Tcp"),
    			FrontendPort:                pulumi.Int(22),
    			BackendPort:                 pulumi.Int(22),
    		})
    		if err != nil {
    			return err
    		}
    		exampleConfiguration, err := maintenance.NewConfiguration(ctx, "exampleConfiguration", &maintenance.ConfigurationArgs{
    			ResourceGroupName: exampleResourceGroup.Name,
    			Location:          exampleResourceGroup.Location,
    			Scope:             pulumi.String("OSImage"),
    			Visibility:        pulumi.String("Custom"),
    			Window: &maintenance.ConfigurationWindowArgs{
    				StartDateTime:      pulumi.String("2021-12-31 00:00"),
    				ExpirationDateTime: pulumi.String("9999-12-31 00:00"),
    				Duration:           pulumi.String("06:00"),
    				TimeZone:           pulumi.String("Pacific Standard Time"),
    				RecurEvery:         pulumi.String("1Days"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewLinuxVirtualMachineScaleSet(ctx, "exampleLinuxVirtualMachineScaleSet", &compute.LinuxVirtualMachineScaleSetArgs{
    			ResourceGroupName:             exampleResourceGroup.Name,
    			Location:                      exampleResourceGroup.Location,
    			Sku:                           pulumi.String("Standard_F2"),
    			Instances:                     pulumi.Int(1),
    			AdminUsername:                 pulumi.String("adminuser"),
    			AdminPassword:                 pulumi.String("P@ssword1234!"),
    			UpgradeMode:                   pulumi.String("Automatic"),
    			HealthProbeId:                 exampleProbe.ID(),
    			DisablePasswordAuthentication: pulumi.Bool(false),
    			SourceImageReference: &compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs{
    				Publisher: pulumi.String("Canonical"),
    				Offer:     pulumi.String("UbuntuServer"),
    				Sku:       pulumi.String("16.04-LTS"),
    				Version:   pulumi.String("latest"),
    			},
    			OsDisk: &compute.LinuxVirtualMachineScaleSetOsDiskArgs{
    				StorageAccountType: pulumi.String("Standard_LRS"),
    				Caching:            pulumi.String("ReadWrite"),
    			},
    			NetworkInterfaces: compute.LinuxVirtualMachineScaleSetNetworkInterfaceArray{
    				&compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs{
    					Name:    pulumi.String("example"),
    					Primary: pulumi.Bool(true),
    					IpConfigurations: compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{
    						&compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{
    							Name:     pulumi.String("internal"),
    							Primary:  pulumi.Bool(true),
    							SubnetId: exampleSubnet.ID(),
    							LoadBalancerBackendAddressPoolIds: pulumi.StringArray{
    								exampleBackendAddressPool.ID(),
    							},
    						},
    					},
    				},
    			},
    			AutomaticOsUpgradePolicy: &compute.LinuxVirtualMachineScaleSetAutomaticOsUpgradePolicyArgs{
    				DisableAutomaticRollback: pulumi.Bool(true),
    				EnableAutomaticOsUpgrade: pulumi.Bool(true),
    			},
    			RollingUpgradePolicy: &compute.LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs{
    				MaxBatchInstancePercent:             pulumi.Int(20),
    				MaxUnhealthyInstancePercent:         pulumi.Int(20),
    				MaxUnhealthyUpgradedInstancePercent: pulumi.Int(20),
    				PauseTimeBetweenBatches:             pulumi.String("PT0S"),
    			},
    		}, pulumi.DependsOn([]pulumi.Resource{
    			pulumi.Resource("azurerm_lb_rule.example"),
    		}))
    		if err != nil {
    			return err
    		}
    		_, err = maintenance.NewAssignmentVirtualMachineScaleSet(ctx, "exampleAssignmentVirtualMachineScaleSet", &maintenance.AssignmentVirtualMachineScaleSetArgs{
    			Location:                   exampleResourceGroup.Location,
    			MaintenanceConfigurationId: exampleConfiguration.ID(),
    			VirtualMachineScaleSetId:   pulumi.Any(azurerm_linux_virtual_machine.Example.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
    const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
        addressSpaces: ["10.0.0.0/16"],
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
    });
    const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
        resourceGroupName: exampleResourceGroup.name,
        virtualNetworkName: exampleVirtualNetwork.name,
        addressPrefixes: ["10.0.2.0/24"],
    });
    const examplePublicIp = new azure.network.PublicIp("examplePublicIp", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        allocationMethod: "Static",
    });
    const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        frontendIpConfigurations: [{
            name: "internal",
            publicIpAddressId: azurerm_public_ip.test.id,
        }],
    });
    const exampleBackendAddressPool = new azure.lb.BackendAddressPool("exampleBackendAddressPool", {
        resourceGroupName: exampleResourceGroup.name,
        loadbalancerId: azurerm_lb.test.id,
    });
    const exampleProbe = new azure.lb.Probe("exampleProbe", {
        resourceGroupName: exampleResourceGroup.name,
        loadbalancerId: azurerm_lb.test.id,
        port: 22,
        protocol: "Tcp",
    });
    const exampleRule = new azure.lb.Rule("exampleRule", {
        resourceGroupName: exampleResourceGroup.name,
        loadbalancerId: azurerm_lb.test.id,
        probeId: azurerm_lb_probe.test.id,
        backendAddressPoolId: azurerm_lb_backend_address_pool.test.id,
        frontendIpConfigurationName: "internal",
        protocol: "Tcp",
        frontendPort: 22,
        backendPort: 22,
    });
    const exampleConfiguration = new azure.maintenance.Configuration("exampleConfiguration", {
        resourceGroupName: exampleResourceGroup.name,
        location: exampleResourceGroup.location,
        scope: "OSImage",
        visibility: "Custom",
        window: {
            startDateTime: "2021-12-31 00:00",
            expirationDateTime: "9999-12-31 00:00",
            duration: "06:00",
            timeZone: "Pacific Standard Time",
            recurEvery: "1Days",
        },
    });
    const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", {
        resourceGroupName: exampleResourceGroup.name,
        location: exampleResourceGroup.location,
        sku: "Standard_F2",
        instances: 1,
        adminUsername: "adminuser",
        adminPassword: "P@ssword1234!",
        upgradeMode: "Automatic",
        healthProbeId: exampleProbe.id,
        disablePasswordAuthentication: false,
        sourceImageReference: {
            publisher: "Canonical",
            offer: "UbuntuServer",
            sku: "16.04-LTS",
            version: "latest",
        },
        osDisk: {
            storageAccountType: "Standard_LRS",
            caching: "ReadWrite",
        },
        networkInterfaces: [{
            name: "example",
            primary: true,
            ipConfigurations: [{
                name: "internal",
                primary: true,
                subnetId: exampleSubnet.id,
                loadBalancerBackendAddressPoolIds: [exampleBackendAddressPool.id],
            }],
        }],
        automaticOsUpgradePolicy: {
            disableAutomaticRollback: true,
            enableAutomaticOsUpgrade: true,
        },
        rollingUpgradePolicy: {
            maxBatchInstancePercent: 20,
            maxUnhealthyInstancePercent: 20,
            maxUnhealthyUpgradedInstancePercent: 20,
            pauseTimeBetweenBatches: "PT0S",
        },
    }, {
        dependsOn: ["azurerm_lb_rule.example"],
    });
    const exampleAssignmentVirtualMachineScaleSet = new azure.maintenance.AssignmentVirtualMachineScaleSet("exampleAssignmentVirtualMachineScaleSet", {
        location: exampleResourceGroup.location,
        maintenanceConfigurationId: exampleConfiguration.id,
        virtualMachineScaleSetId: azurerm_linux_virtual_machine.example.id,
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
    example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
        address_spaces=["10.0.0.0/16"],
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name)
    example_subnet = azure.network.Subnet("exampleSubnet",
        resource_group_name=example_resource_group.name,
        virtual_network_name=example_virtual_network.name,
        address_prefixes=["10.0.2.0/24"])
    example_public_ip = azure.network.PublicIp("examplePublicIp",
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        allocation_method="Static")
    example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer",
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs(
            name="internal",
            public_ip_address_id=azurerm_public_ip["test"]["id"],
        )])
    example_backend_address_pool = azure.lb.BackendAddressPool("exampleBackendAddressPool",
        resource_group_name=example_resource_group.name,
        loadbalancer_id=azurerm_lb["test"]["id"])
    example_probe = azure.lb.Probe("exampleProbe",
        resource_group_name=example_resource_group.name,
        loadbalancer_id=azurerm_lb["test"]["id"],
        port=22,
        protocol="Tcp")
    example_rule = azure.lb.Rule("exampleRule",
        resource_group_name=example_resource_group.name,
        loadbalancer_id=azurerm_lb["test"]["id"],
        probe_id=azurerm_lb_probe["test"]["id"],
        backend_address_pool_id=azurerm_lb_backend_address_pool["test"]["id"],
        frontend_ip_configuration_name="internal",
        protocol="Tcp",
        frontend_port=22,
        backend_port=22)
    example_configuration = azure.maintenance.Configuration("exampleConfiguration",
        resource_group_name=example_resource_group.name,
        location=example_resource_group.location,
        scope="OSImage",
        visibility="Custom",
        window=azure.maintenance.ConfigurationWindowArgs(
            start_date_time="2021-12-31 00:00",
            expiration_date_time="9999-12-31 00:00",
            duration="06:00",
            time_zone="Pacific Standard Time",
            recur_every="1Days",
        ))
    example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet",
        resource_group_name=example_resource_group.name,
        location=example_resource_group.location,
        sku="Standard_F2",
        instances=1,
        admin_username="adminuser",
        admin_password="P@ssword1234!",
        upgrade_mode="Automatic",
        health_probe_id=example_probe.id,
        disable_password_authentication=False,
        source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs(
            publisher="Canonical",
            offer="UbuntuServer",
            sku="16.04-LTS",
            version="latest",
        ),
        os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs(
            storage_account_type="Standard_LRS",
            caching="ReadWrite",
        ),
        network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs(
            name="example",
            primary=True,
            ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs(
                name="internal",
                primary=True,
                subnet_id=example_subnet.id,
                load_balancer_backend_address_pool_ids=[example_backend_address_pool.id],
            )],
        )],
        automatic_os_upgrade_policy=azure.compute.LinuxVirtualMachineScaleSetAutomaticOsUpgradePolicyArgs(
            disable_automatic_rollback=True,
            enable_automatic_os_upgrade=True,
        ),
        rolling_upgrade_policy=azure.compute.LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs(
            max_batch_instance_percent=20,
            max_unhealthy_instance_percent=20,
            max_unhealthy_upgraded_instance_percent=20,
            pause_time_between_batches="PT0S",
        ),
        opts=pulumi.ResourceOptions(depends_on=["azurerm_lb_rule.example"]))
    example_assignment_virtual_machine_scale_set = azure.maintenance.AssignmentVirtualMachineScaleSet("exampleAssignmentVirtualMachineScaleSet",
        location=example_resource_group.location,
        maintenance_configuration_id=example_configuration.id,
        virtual_machine_scale_set_id=azurerm_linux_virtual_machine["example"]["id"])
    

    Example coming soon!

    Create AssignmentVirtualMachineScaleSet Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AssignmentVirtualMachineScaleSet(name: string, args: AssignmentVirtualMachineScaleSetArgs, opts?: CustomResourceOptions);
    @overload
    def AssignmentVirtualMachineScaleSet(resource_name: str,
                                         args: AssignmentVirtualMachineScaleSetArgs,
                                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def AssignmentVirtualMachineScaleSet(resource_name: str,
                                         opts: Optional[ResourceOptions] = None,
                                         maintenance_configuration_id: Optional[str] = None,
                                         virtual_machine_scale_set_id: Optional[str] = None,
                                         location: Optional[str] = None)
    func NewAssignmentVirtualMachineScaleSet(ctx *Context, name string, args AssignmentVirtualMachineScaleSetArgs, opts ...ResourceOption) (*AssignmentVirtualMachineScaleSet, error)
    public AssignmentVirtualMachineScaleSet(string name, AssignmentVirtualMachineScaleSetArgs args, CustomResourceOptions? opts = null)
    public AssignmentVirtualMachineScaleSet(String name, AssignmentVirtualMachineScaleSetArgs args)
    public AssignmentVirtualMachineScaleSet(String name, AssignmentVirtualMachineScaleSetArgs args, CustomResourceOptions options)
    
    type: azure:maintenance:AssignmentVirtualMachineScaleSet
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AssignmentVirtualMachineScaleSetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AssignmentVirtualMachineScaleSetArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AssignmentVirtualMachineScaleSetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AssignmentVirtualMachineScaleSetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AssignmentVirtualMachineScaleSetArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var assignmentVirtualMachineScaleSetResource = new Azure.Maintenance.AssignmentVirtualMachineScaleSet("assignmentVirtualMachineScaleSetResource", new()
    {
        MaintenanceConfigurationId = "string",
        VirtualMachineScaleSetId = "string",
        Location = "string",
    });
    
    example, err := maintenance.NewAssignmentVirtualMachineScaleSet(ctx, "assignmentVirtualMachineScaleSetResource", &maintenance.AssignmentVirtualMachineScaleSetArgs{
    	MaintenanceConfigurationId: pulumi.String("string"),
    	VirtualMachineScaleSetId:   pulumi.String("string"),
    	Location:                   pulumi.String("string"),
    })
    
    var assignmentVirtualMachineScaleSetResource = new AssignmentVirtualMachineScaleSet("assignmentVirtualMachineScaleSetResource", AssignmentVirtualMachineScaleSetArgs.builder()
        .maintenanceConfigurationId("string")
        .virtualMachineScaleSetId("string")
        .location("string")
        .build());
    
    assignment_virtual_machine_scale_set_resource = azure.maintenance.AssignmentVirtualMachineScaleSet("assignmentVirtualMachineScaleSetResource",
        maintenance_configuration_id="string",
        virtual_machine_scale_set_id="string",
        location="string")
    
    const assignmentVirtualMachineScaleSetResource = new azure.maintenance.AssignmentVirtualMachineScaleSet("assignmentVirtualMachineScaleSetResource", {
        maintenanceConfigurationId: "string",
        virtualMachineScaleSetId: "string",
        location: "string",
    });
    
    type: azure:maintenance:AssignmentVirtualMachineScaleSet
    properties:
        location: string
        maintenanceConfigurationId: string
        virtualMachineScaleSetId: string
    

    AssignmentVirtualMachineScaleSet Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The AssignmentVirtualMachineScaleSet resource accepts the following input properties:

    MaintenanceConfigurationId string
    Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
    VirtualMachineScaleSetId string
    Specifies the Virtual Machine Scale Set ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
    Location string
    Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    MaintenanceConfigurationId string
    Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
    VirtualMachineScaleSetId string
    Specifies the Virtual Machine Scale Set ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
    Location string
    Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    maintenanceConfigurationId String
    Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
    virtualMachineScaleSetId String
    Specifies the Virtual Machine Scale Set ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
    location String
    Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    maintenanceConfigurationId string
    Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
    virtualMachineScaleSetId string
    Specifies the Virtual Machine Scale Set ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
    location string
    Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    maintenance_configuration_id str
    Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
    virtual_machine_scale_set_id str
    Specifies the Virtual Machine Scale Set ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
    location str
    Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    maintenanceConfigurationId String
    Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
    virtualMachineScaleSetId String
    Specifies the Virtual Machine Scale Set ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
    location String
    Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AssignmentVirtualMachineScaleSet resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing AssignmentVirtualMachineScaleSet Resource

    Get an existing AssignmentVirtualMachineScaleSet resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: AssignmentVirtualMachineScaleSetState, opts?: CustomResourceOptions): AssignmentVirtualMachineScaleSet
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            location: Optional[str] = None,
            maintenance_configuration_id: Optional[str] = None,
            virtual_machine_scale_set_id: Optional[str] = None) -> AssignmentVirtualMachineScaleSet
    func GetAssignmentVirtualMachineScaleSet(ctx *Context, name string, id IDInput, state *AssignmentVirtualMachineScaleSetState, opts ...ResourceOption) (*AssignmentVirtualMachineScaleSet, error)
    public static AssignmentVirtualMachineScaleSet Get(string name, Input<string> id, AssignmentVirtualMachineScaleSetState? state, CustomResourceOptions? opts = null)
    public static AssignmentVirtualMachineScaleSet get(String name, Output<String> id, AssignmentVirtualMachineScaleSetState state, CustomResourceOptions options)
    resources:  _:    type: azure:maintenance:AssignmentVirtualMachineScaleSet    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Location string
    Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    MaintenanceConfigurationId string
    Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
    VirtualMachineScaleSetId string
    Specifies the Virtual Machine Scale Set ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
    Location string
    Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    MaintenanceConfigurationId string
    Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
    VirtualMachineScaleSetId string
    Specifies the Virtual Machine Scale Set ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
    location String
    Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    maintenanceConfigurationId String
    Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
    virtualMachineScaleSetId String
    Specifies the Virtual Machine Scale Set ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
    location string
    Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    maintenanceConfigurationId string
    Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
    virtualMachineScaleSetId string
    Specifies the Virtual Machine Scale Set ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
    location str
    Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    maintenance_configuration_id str
    Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
    virtual_machine_scale_set_id str
    Specifies the Virtual Machine Scale Set ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
    location String
    Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    maintenanceConfigurationId String
    Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
    virtualMachineScaleSetId String
    Specifies the Virtual Machine Scale Set ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.

    Import

    Maintenance Assignment can be imported using the resource id, e.g.

     $ pulumi import azure:maintenance/assignmentVirtualMachineScaleSet:AssignmentVirtualMachineScaleSet example /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resGroup1/providers/microsoft.compute/virtualMachineScaleSets/vmss1/providers/Microsoft.Maintenance/configurationAssignments/assign1
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.