1. Packages
  2. Packages
  3. Azure Classic
  4. API Docs
  5. policy
  6. VirtualMachineConfigurationAssignment

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

    Applies a Guest Configuration Policy to a Virtual Machine.

    NOTE: You can create Guest Configuration Policies without defining a azure.compute.Extension resource, however the policies will not be executed until a azure.compute.Extension has been provisioned to the virtual machine.

    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
            {
                Location = exampleResourceGroup.Location,
                ResourceGroupName = exampleResourceGroup.Name,
                AddressSpaces = 
                {
                    "10.0.0.0/16",
                },
            });
            var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new Azure.Network.SubnetArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                VirtualNetworkName = exampleVirtualNetwork.Name,
                AddressPrefixes = 
                {
                    "10.0.2.0/24",
                },
            });
            var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new Azure.Network.NetworkInterfaceArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                Location = exampleResourceGroup.Location,
                IpConfigurations = 
                {
                    new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs
                    {
                        Name = "internal",
                        SubnetId = exampleSubnet.Id,
                        PrivateIpAddressAllocation = "Dynamic",
                    },
                },
            });
            var exampleWindowsVirtualMachine = new Azure.Compute.WindowsVirtualMachine("exampleWindowsVirtualMachine", new Azure.Compute.WindowsVirtualMachineArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                Location = exampleResourceGroup.Location,
                Size = "Standard_F2",
                AdminUsername = "adminuser",
                AdminPassword = "P@$$w0rd1234!",
                NetworkInterfaceIds = 
                {
                    exampleNetworkInterface.Id,
                },
                Identity = new Azure.Compute.Inputs.WindowsVirtualMachineIdentityArgs
                {
                    Type = "SystemAssigned",
                },
                OsDisk = new Azure.Compute.Inputs.WindowsVirtualMachineOsDiskArgs
                {
                    Caching = "ReadWrite",
                    StorageAccountType = "Standard_LRS",
                },
                SourceImageReference = new Azure.Compute.Inputs.WindowsVirtualMachineSourceImageReferenceArgs
                {
                    Publisher = "MicrosoftWindowsServer",
                    Offer = "WindowsServer",
                    Sku = "2019-Datacenter",
                    Version = "latest",
                },
            });
            var exampleExtension = new Azure.Compute.Extension("exampleExtension", new Azure.Compute.ExtensionArgs
            {
                VirtualMachineId = exampleWindowsVirtualMachine.Id,
                Publisher = "Microsoft.GuestConfiguration",
                Type = "ConfigurationforWindows",
                TypeHandlerVersion = "1.0",
                AutoUpgradeMinorVersion = true,
            });
            var exampleVirtualMachineConfigurationAssignment = new Azure.Policy.VirtualMachineConfigurationAssignment("exampleVirtualMachineConfigurationAssignment", new Azure.Policy.VirtualMachineConfigurationAssignmentArgs
            {
                Location = exampleWindowsVirtualMachine.Location,
                VirtualMachineId = exampleWindowsVirtualMachine.Id,
                Configuration = new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationArgs
                {
                    AssignmentType = "ApplyAndMonitor",
                    Version = "1.*",
                    Parameters = 
                    {
                        new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationParameterArgs
                        {
                            Name = "Minimum Password Length;ExpectedValue",
                            Value = "16",
                        },
                        new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationParameterArgs
                        {
                            Name = "Minimum Password Age;ExpectedValue",
                            Value = "0",
                        },
                        new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationParameterArgs
                        {
                            Name = "Maximum Password Age;ExpectedValue",
                            Value = "30,45",
                        },
                        new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationParameterArgs
                        {
                            Name = "Enforce Password History;ExpectedValue",
                            Value = "10",
                        },
                        new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationParameterArgs
                        {
                            Name = "Password Must Meet Complexity Requirements;ExpectedValue",
                            Value = "1",
                        },
                    },
                },
            });
        }
    
    }
    
    package main
    
    import (
    	"fmt"
    
    	"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/network"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/policy"
    	"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{
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    			AddressSpaces: pulumi.StringArray{
    				pulumi.String("10.0.0.0/16"),
    			},
    		})
    		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
    		}
    		exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{
    			ResourceGroupName: exampleResourceGroup.Name,
    			Location:          exampleResourceGroup.Location,
    			IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
    				&network.NetworkInterfaceIpConfigurationArgs{
    					Name:                       pulumi.String("internal"),
    					SubnetId:                   exampleSubnet.ID(),
    					PrivateIpAddressAllocation: pulumi.String("Dynamic"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleWindowsVirtualMachine, err := compute.NewWindowsVirtualMachine(ctx, "exampleWindowsVirtualMachine", &compute.WindowsVirtualMachineArgs{
    			ResourceGroupName: exampleResourceGroup.Name,
    			Location:          exampleResourceGroup.Location,
    			Size:              pulumi.String("Standard_F2"),
    			AdminUsername:     pulumi.String("adminuser"),
    			AdminPassword:     pulumi.String(fmt.Sprintf("%v%v%v%v", "P@", "$", "$", "w0rd1234!")),
    			NetworkInterfaceIds: pulumi.StringArray{
    				exampleNetworkInterface.ID(),
    			},
    			Identity: &compute.WindowsVirtualMachineIdentityArgs{
    				Type: pulumi.String("SystemAssigned"),
    			},
    			OsDisk: &compute.WindowsVirtualMachineOsDiskArgs{
    				Caching:            pulumi.String("ReadWrite"),
    				StorageAccountType: pulumi.String("Standard_LRS"),
    			},
    			SourceImageReference: &compute.WindowsVirtualMachineSourceImageReferenceArgs{
    				Publisher: pulumi.String("MicrosoftWindowsServer"),
    				Offer:     pulumi.String("WindowsServer"),
    				Sku:       pulumi.String("2019-Datacenter"),
    				Version:   pulumi.String("latest"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewExtension(ctx, "exampleExtension", &compute.ExtensionArgs{
    			VirtualMachineId:        exampleWindowsVirtualMachine.ID(),
    			Publisher:               pulumi.String("Microsoft.GuestConfiguration"),
    			Type:                    pulumi.String("ConfigurationforWindows"),
    			TypeHandlerVersion:      pulumi.String("1.0"),
    			AutoUpgradeMinorVersion: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = policy.NewVirtualMachineConfigurationAssignment(ctx, "exampleVirtualMachineConfigurationAssignment", &policy.VirtualMachineConfigurationAssignmentArgs{
    			Location:         exampleWindowsVirtualMachine.Location,
    			VirtualMachineId: exampleWindowsVirtualMachine.ID(),
    			Configuration: &policy.VirtualMachineConfigurationAssignmentConfigurationArgs{
    				AssignmentType: pulumi.String("ApplyAndMonitor"),
    				Version:        pulumi.String("1.*"),
    				Parameters: policy.VirtualMachineConfigurationAssignmentConfigurationParameterArray{
    					&policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs{
    						Name:  pulumi.String("Minimum Password Length;ExpectedValue"),
    						Value: pulumi.String("16"),
    					},
    					&policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs{
    						Name:  pulumi.String("Minimum Password Age;ExpectedValue"),
    						Value: pulumi.String("0"),
    					},
    					&policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs{
    						Name:  pulumi.String("Maximum Password Age;ExpectedValue"),
    						Value: pulumi.String("30,45"),
    					},
    					&policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs{
    						Name:  pulumi.String("Enforce Password History;ExpectedValue"),
    						Value: pulumi.String("10"),
    					},
    					&policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs{
    						Name:  pulumi.String("Password Must Meet Complexity Requirements;ExpectedValue"),
    						Value: pulumi.String("1"),
    					},
    				},
    			},
    		})
    		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", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        addressSpaces: ["10.0.0.0/16"],
    });
    const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
        resourceGroupName: exampleResourceGroup.name,
        virtualNetworkName: exampleVirtualNetwork.name,
        addressPrefixes: ["10.0.2.0/24"],
    });
    const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", {
        resourceGroupName: exampleResourceGroup.name,
        location: exampleResourceGroup.location,
        ipConfigurations: [{
            name: "internal",
            subnetId: exampleSubnet.id,
            privateIpAddressAllocation: "Dynamic",
        }],
    });
    const exampleWindowsVirtualMachine = new azure.compute.WindowsVirtualMachine("exampleWindowsVirtualMachine", {
        resourceGroupName: exampleResourceGroup.name,
        location: exampleResourceGroup.location,
        size: "Standard_F2",
        adminUsername: "adminuser",
        adminPassword: `P@$$w0rd1234!`,
        networkInterfaceIds: [exampleNetworkInterface.id],
        identity: {
            type: "SystemAssigned",
        },
        osDisk: {
            caching: "ReadWrite",
            storageAccountType: "Standard_LRS",
        },
        sourceImageReference: {
            publisher: "MicrosoftWindowsServer",
            offer: "WindowsServer",
            sku: "2019-Datacenter",
            version: "latest",
        },
    });
    const exampleExtension = new azure.compute.Extension("exampleExtension", {
        virtualMachineId: exampleWindowsVirtualMachine.id,
        publisher: "Microsoft.GuestConfiguration",
        type: "ConfigurationforWindows",
        typeHandlerVersion: "1.0",
        autoUpgradeMinorVersion: "true",
    });
    const exampleVirtualMachineConfigurationAssignment = new azure.policy.VirtualMachineConfigurationAssignment("exampleVirtualMachineConfigurationAssignment", {
        location: exampleWindowsVirtualMachine.location,
        virtualMachineId: exampleWindowsVirtualMachine.id,
        configuration: {
            assignmentType: "ApplyAndMonitor",
            version: "1.*",
            parameters: [
                {
                    name: "Minimum Password Length;ExpectedValue",
                    value: "16",
                },
                {
                    name: "Minimum Password Age;ExpectedValue",
                    value: "0",
                },
                {
                    name: "Maximum Password Age;ExpectedValue",
                    value: "30,45",
                },
                {
                    name: "Enforce Password History;ExpectedValue",
                    value: "10",
                },
                {
                    name: "Password Must Meet Complexity Requirements;ExpectedValue",
                    value: "1",
                },
            ],
        },
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
    example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        address_spaces=["10.0.0.0/16"])
    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_network_interface = azure.network.NetworkInterface("exampleNetworkInterface",
        resource_group_name=example_resource_group.name,
        location=example_resource_group.location,
        ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs(
            name="internal",
            subnet_id=example_subnet.id,
            private_ip_address_allocation="Dynamic",
        )])
    example_windows_virtual_machine = azure.compute.WindowsVirtualMachine("exampleWindowsVirtualMachine",
        resource_group_name=example_resource_group.name,
        location=example_resource_group.location,
        size="Standard_F2",
        admin_username="adminuser",
        admin_password="P@$$w0rd1234!",
        network_interface_ids=[example_network_interface.id],
        identity=azure.compute.WindowsVirtualMachineIdentityArgs(
            type="SystemAssigned",
        ),
        os_disk=azure.compute.WindowsVirtualMachineOsDiskArgs(
            caching="ReadWrite",
            storage_account_type="Standard_LRS",
        ),
        source_image_reference=azure.compute.WindowsVirtualMachineSourceImageReferenceArgs(
            publisher="MicrosoftWindowsServer",
            offer="WindowsServer",
            sku="2019-Datacenter",
            version="latest",
        ))
    example_extension = azure.compute.Extension("exampleExtension",
        virtual_machine_id=example_windows_virtual_machine.id,
        publisher="Microsoft.GuestConfiguration",
        type="ConfigurationforWindows",
        type_handler_version="1.0",
        auto_upgrade_minor_version=True)
    example_virtual_machine_configuration_assignment = azure.policy.VirtualMachineConfigurationAssignment("exampleVirtualMachineConfigurationAssignment",
        location=example_windows_virtual_machine.location,
        virtual_machine_id=example_windows_virtual_machine.id,
        configuration=azure.policy.VirtualMachineConfigurationAssignmentConfigurationArgs(
            assignment_type="ApplyAndMonitor",
            version="1.*",
            parameters=[
                azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs(
                    name="Minimum Password Length;ExpectedValue",
                    value="16",
                ),
                azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs(
                    name="Minimum Password Age;ExpectedValue",
                    value="0",
                ),
                azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs(
                    name="Maximum Password Age;ExpectedValue",
                    value="30,45",
                ),
                azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs(
                    name="Enforce Password History;ExpectedValue",
                    value="10",
                ),
                azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs(
                    name="Password Must Meet Complexity Requirements;ExpectedValue",
                    value="1",
                ),
            ],
        ))
    

    Example coming soon!

    Create VirtualMachineConfigurationAssignment Resource

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

    Constructor syntax

    new VirtualMachineConfigurationAssignment(name: string, args: VirtualMachineConfigurationAssignmentArgs, opts?: CustomResourceOptions);
    @overload
    def VirtualMachineConfigurationAssignment(resource_name: str,
                                              args: VirtualMachineConfigurationAssignmentArgs,
                                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def VirtualMachineConfigurationAssignment(resource_name: str,
                                              opts: Optional[ResourceOptions] = None,
                                              configuration: Optional[VirtualMachineConfigurationAssignmentConfigurationArgs] = None,
                                              virtual_machine_id: Optional[str] = None,
                                              location: Optional[str] = None,
                                              name: Optional[str] = None)
    func NewVirtualMachineConfigurationAssignment(ctx *Context, name string, args VirtualMachineConfigurationAssignmentArgs, opts ...ResourceOption) (*VirtualMachineConfigurationAssignment, error)
    public VirtualMachineConfigurationAssignment(string name, VirtualMachineConfigurationAssignmentArgs args, CustomResourceOptions? opts = null)
    public VirtualMachineConfigurationAssignment(String name, VirtualMachineConfigurationAssignmentArgs args)
    public VirtualMachineConfigurationAssignment(String name, VirtualMachineConfigurationAssignmentArgs args, CustomResourceOptions options)
    
    type: azure:policy:VirtualMachineConfigurationAssignment
    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 VirtualMachineConfigurationAssignmentArgs
    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 VirtualMachineConfigurationAssignmentArgs
    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 VirtualMachineConfigurationAssignmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VirtualMachineConfigurationAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VirtualMachineConfigurationAssignmentArgs
    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 virtualMachineConfigurationAssignmentResource = new Azure.Policy.VirtualMachineConfigurationAssignment("virtualMachineConfigurationAssignmentResource", new()
    {
        Configuration = new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationArgs
        {
            AssignmentType = "string",
            ContentHash = "string",
            ContentUri = "string",
            Parameters = new[]
            {
                new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationParameterArgs
                {
                    Name = "string",
                    Value = "string",
                },
            },
            Version = "string",
        },
        VirtualMachineId = "string",
        Location = "string",
        Name = "string",
    });
    
    example, err := policy.NewVirtualMachineConfigurationAssignment(ctx, "virtualMachineConfigurationAssignmentResource", &policy.VirtualMachineConfigurationAssignmentArgs{
    	Configuration: &policy.VirtualMachineConfigurationAssignmentConfigurationArgs{
    		AssignmentType: pulumi.String("string"),
    		ContentHash:    pulumi.String("string"),
    		ContentUri:     pulumi.String("string"),
    		Parameters: policy.VirtualMachineConfigurationAssignmentConfigurationParameterArray{
    			&policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs{
    				Name:  pulumi.String("string"),
    				Value: pulumi.String("string"),
    			},
    		},
    		Version: pulumi.String("string"),
    	},
    	VirtualMachineId: pulumi.String("string"),
    	Location:         pulumi.String("string"),
    	Name:             pulumi.String("string"),
    })
    
    var virtualMachineConfigurationAssignmentResource = new VirtualMachineConfigurationAssignment("virtualMachineConfigurationAssignmentResource", VirtualMachineConfigurationAssignmentArgs.builder()
        .configuration(VirtualMachineConfigurationAssignmentConfigurationArgs.builder()
            .assignmentType("string")
            .contentHash("string")
            .contentUri("string")
            .parameters(VirtualMachineConfigurationAssignmentConfigurationParameterArgs.builder()
                .name("string")
                .value("string")
                .build())
            .version("string")
            .build())
        .virtualMachineId("string")
        .location("string")
        .name("string")
        .build());
    
    virtual_machine_configuration_assignment_resource = azure.policy.VirtualMachineConfigurationAssignment("virtualMachineConfigurationAssignmentResource",
        configuration={
            "assignment_type": "string",
            "content_hash": "string",
            "content_uri": "string",
            "parameters": [{
                "name": "string",
                "value": "string",
            }],
            "version": "string",
        },
        virtual_machine_id="string",
        location="string",
        name="string")
    
    const virtualMachineConfigurationAssignmentResource = new azure.policy.VirtualMachineConfigurationAssignment("virtualMachineConfigurationAssignmentResource", {
        configuration: {
            assignmentType: "string",
            contentHash: "string",
            contentUri: "string",
            parameters: [{
                name: "string",
                value: "string",
            }],
            version: "string",
        },
        virtualMachineId: "string",
        location: "string",
        name: "string",
    });
    
    type: azure:policy:VirtualMachineConfigurationAssignment
    properties:
        configuration:
            assignmentType: string
            contentHash: string
            contentUri: string
            parameters:
                - name: string
                  value: string
            version: string
        location: string
        name: string
        virtualMachineId: string
    

    VirtualMachineConfigurationAssignment 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 VirtualMachineConfigurationAssignment resource accepts the following input properties:

    Configuration VirtualMachineConfigurationAssignmentConfiguration
    A configuration block as defined below.
    VirtualMachineId string
    The resource ID of the Policy Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
    Location string
    The Azure location where the Policy Virtual Machine Configuration Assignment should exist. Changing this forces a new resource to be created.
    Name string
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment. Changing this forces a new resource to be created.
    Configuration VirtualMachineConfigurationAssignmentConfigurationArgs
    A configuration block as defined below.
    VirtualMachineId string
    The resource ID of the Policy Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
    Location string
    The Azure location where the Policy Virtual Machine Configuration Assignment should exist. Changing this forces a new resource to be created.
    Name string
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment. Changing this forces a new resource to be created.
    configuration VirtualMachineConfigurationAssignmentConfiguration
    A configuration block as defined below.
    virtualMachineId String
    The resource ID of the Policy Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
    location String
    The Azure location where the Policy Virtual Machine Configuration Assignment should exist. Changing this forces a new resource to be created.
    name String
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment. Changing this forces a new resource to be created.
    configuration VirtualMachineConfigurationAssignmentConfiguration
    A configuration block as defined below.
    virtualMachineId string
    The resource ID of the Policy Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
    location string
    The Azure location where the Policy Virtual Machine Configuration Assignment should exist. Changing this forces a new resource to be created.
    name string
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment. Changing this forces a new resource to be created.
    configuration VirtualMachineConfigurationAssignmentConfigurationArgs
    A configuration block as defined below.
    virtual_machine_id str
    The resource ID of the Policy Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
    location str
    The Azure location where the Policy Virtual Machine Configuration Assignment should exist. Changing this forces a new resource to be created.
    name str
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment. Changing this forces a new resource to be created.
    configuration Property Map
    A configuration block as defined below.
    virtualMachineId String
    The resource ID of the Policy Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
    location String
    The Azure location where the Policy Virtual Machine Configuration Assignment should exist. Changing this forces a new resource to be created.
    name String
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment. Changing this forces a new resource to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VirtualMachineConfigurationAssignment 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 VirtualMachineConfigurationAssignment Resource

    Get an existing VirtualMachineConfigurationAssignment 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?: VirtualMachineConfigurationAssignmentState, opts?: CustomResourceOptions): VirtualMachineConfigurationAssignment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            configuration: Optional[VirtualMachineConfigurationAssignmentConfigurationArgs] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            virtual_machine_id: Optional[str] = None) -> VirtualMachineConfigurationAssignment
    func GetVirtualMachineConfigurationAssignment(ctx *Context, name string, id IDInput, state *VirtualMachineConfigurationAssignmentState, opts ...ResourceOption) (*VirtualMachineConfigurationAssignment, error)
    public static VirtualMachineConfigurationAssignment Get(string name, Input<string> id, VirtualMachineConfigurationAssignmentState? state, CustomResourceOptions? opts = null)
    public static VirtualMachineConfigurationAssignment get(String name, Output<String> id, VirtualMachineConfigurationAssignmentState state, CustomResourceOptions options)
    resources:  _:    type: azure:policy:VirtualMachineConfigurationAssignment    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:
    Configuration VirtualMachineConfigurationAssignmentConfiguration
    A configuration block as defined below.
    Location string
    The Azure location where the Policy Virtual Machine Configuration Assignment should exist. Changing this forces a new resource to be created.
    Name string
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment. Changing this forces a new resource to be created.
    VirtualMachineId string
    The resource ID of the Policy Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
    Configuration VirtualMachineConfigurationAssignmentConfigurationArgs
    A configuration block as defined below.
    Location string
    The Azure location where the Policy Virtual Machine Configuration Assignment should exist. Changing this forces a new resource to be created.
    Name string
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment. Changing this forces a new resource to be created.
    VirtualMachineId string
    The resource ID of the Policy Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
    configuration VirtualMachineConfigurationAssignmentConfiguration
    A configuration block as defined below.
    location String
    The Azure location where the Policy Virtual Machine Configuration Assignment should exist. Changing this forces a new resource to be created.
    name String
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment. Changing this forces a new resource to be created.
    virtualMachineId String
    The resource ID of the Policy Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
    configuration VirtualMachineConfigurationAssignmentConfiguration
    A configuration block as defined below.
    location string
    The Azure location where the Policy Virtual Machine Configuration Assignment should exist. Changing this forces a new resource to be created.
    name string
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment. Changing this forces a new resource to be created.
    virtualMachineId string
    The resource ID of the Policy Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
    configuration VirtualMachineConfigurationAssignmentConfigurationArgs
    A configuration block as defined below.
    location str
    The Azure location where the Policy Virtual Machine Configuration Assignment should exist. Changing this forces a new resource to be created.
    name str
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment. Changing this forces a new resource to be created.
    virtual_machine_id str
    The resource ID of the Policy Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.
    configuration Property Map
    A configuration block as defined below.
    location String
    The Azure location where the Policy Virtual Machine Configuration Assignment should exist. Changing this forces a new resource to be created.
    name String
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment. Changing this forces a new resource to be created.
    virtualMachineId String
    The resource ID of the Policy Virtual Machine which this Guest Configuration Assignment should apply to. Changing this forces a new resource to be created.

    Supporting Types

    VirtualMachineConfigurationAssignmentConfiguration, VirtualMachineConfigurationAssignmentConfigurationArgs

    AssignmentType string
    The assignment type for the Guest Configuration Assignment. Possible values are Audit, ApplyAndAutoCorrect, ApplyAndMonitor and DeployAndAutoCorrect.
    ContentHash string
    The content hash for the Guest Configuration package.
    ContentUri string
    The content URI where the Guest Configuration package is stored.
    Name string
    This field is no longer used and will be removed in the next major version of the Azure Provider.

    Deprecated: This field is no longer used and will be removed in the next major version of the Azure Provider

    Parameters List<VirtualMachineConfigurationAssignmentConfigurationParameter>
    One or more parameter blocks which define what configuration parameters and values against.
    Version string
    The version of the Guest Configuration that will be assigned in this Guest Configuration Assignment.
    AssignmentType string
    The assignment type for the Guest Configuration Assignment. Possible values are Audit, ApplyAndAutoCorrect, ApplyAndMonitor and DeployAndAutoCorrect.
    ContentHash string
    The content hash for the Guest Configuration package.
    ContentUri string
    The content URI where the Guest Configuration package is stored.
    Name string
    This field is no longer used and will be removed in the next major version of the Azure Provider.

    Deprecated: This field is no longer used and will be removed in the next major version of the Azure Provider

    Parameters []VirtualMachineConfigurationAssignmentConfigurationParameter
    One or more parameter blocks which define what configuration parameters and values against.
    Version string
    The version of the Guest Configuration that will be assigned in this Guest Configuration Assignment.
    assignmentType String
    The assignment type for the Guest Configuration Assignment. Possible values are Audit, ApplyAndAutoCorrect, ApplyAndMonitor and DeployAndAutoCorrect.
    contentHash String
    The content hash for the Guest Configuration package.
    contentUri String
    The content URI where the Guest Configuration package is stored.
    name String
    This field is no longer used and will be removed in the next major version of the Azure Provider.

    Deprecated: This field is no longer used and will be removed in the next major version of the Azure Provider

    parameters List<VirtualMachineConfigurationAssignmentConfigurationParameter>
    One or more parameter blocks which define what configuration parameters and values against.
    version String
    The version of the Guest Configuration that will be assigned in this Guest Configuration Assignment.
    assignmentType string
    The assignment type for the Guest Configuration Assignment. Possible values are Audit, ApplyAndAutoCorrect, ApplyAndMonitor and DeployAndAutoCorrect.
    contentHash string
    The content hash for the Guest Configuration package.
    contentUri string
    The content URI where the Guest Configuration package is stored.
    name string
    This field is no longer used and will be removed in the next major version of the Azure Provider.

    Deprecated: This field is no longer used and will be removed in the next major version of the Azure Provider

    parameters VirtualMachineConfigurationAssignmentConfigurationParameter[]
    One or more parameter blocks which define what configuration parameters and values against.
    version string
    The version of the Guest Configuration that will be assigned in this Guest Configuration Assignment.
    assignment_type str
    The assignment type for the Guest Configuration Assignment. Possible values are Audit, ApplyAndAutoCorrect, ApplyAndMonitor and DeployAndAutoCorrect.
    content_hash str
    The content hash for the Guest Configuration package.
    content_uri str
    The content URI where the Guest Configuration package is stored.
    name str
    This field is no longer used and will be removed in the next major version of the Azure Provider.

    Deprecated: This field is no longer used and will be removed in the next major version of the Azure Provider

    parameters Sequence[VirtualMachineConfigurationAssignmentConfigurationParameter]
    One or more parameter blocks which define what configuration parameters and values against.
    version str
    The version of the Guest Configuration that will be assigned in this Guest Configuration Assignment.
    assignmentType String
    The assignment type for the Guest Configuration Assignment. Possible values are Audit, ApplyAndAutoCorrect, ApplyAndMonitor and DeployAndAutoCorrect.
    contentHash String
    The content hash for the Guest Configuration package.
    contentUri String
    The content URI where the Guest Configuration package is stored.
    name String
    This field is no longer used and will be removed in the next major version of the Azure Provider.

    Deprecated: This field is no longer used and will be removed in the next major version of the Azure Provider

    parameters List<Property Map>
    One or more parameter blocks which define what configuration parameters and values against.
    version String
    The version of the Guest Configuration that will be assigned in this Guest Configuration Assignment.

    VirtualMachineConfigurationAssignmentConfigurationParameter, VirtualMachineConfigurationAssignmentConfigurationParameterArgs

    Name string
    The name of the configuration parameter to check.
    Value string
    The value to check the configuration parameter with.
    Name string
    The name of the configuration parameter to check.
    Value string
    The value to check the configuration parameter with.
    name String
    The name of the configuration parameter to check.
    value String
    The value to check the configuration parameter with.
    name string
    The name of the configuration parameter to check.
    value string
    The value to check the configuration parameter with.
    name str
    The name of the configuration parameter to check.
    value str
    The value to check the configuration parameter with.
    name String
    The name of the configuration parameter to check.
    value String
    The value to check the configuration parameter with.

    Import

    Policy Virtual Machine Configuration Assignments can be imported using the resource id, e.g.

     $ pulumi import azure:policy/virtualMachineConfigurationAssignment:VirtualMachineConfigurationAssignment example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/assignment1
    

    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.