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

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

    NOTE: This resource has been deprecated in favour of the azure.policy.VirtualMachineConfigurationAssignment resource and will be removed in the next major version of the AzureRM Provider. The new resource shares the same fields as this one, information on migrating can be found in this guide.

    Applies a Configuration Policy to a 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 exampleConfigurationPolicyAssignment = new Azure.Compute.ConfigurationPolicyAssignment("exampleConfigurationPolicyAssignment", new Azure.Compute.ConfigurationPolicyAssignmentArgs
            {
                Location = exampleWindowsVirtualMachine.Location,
                VirtualMachineId = exampleWindowsVirtualMachine.Id,
                Configuration = new Azure.Compute.Inputs.ConfigurationPolicyAssignmentConfigurationArgs
                {
                    Name = "AzureWindowsBaseline",
                    Version = "1.*",
                    Parameters = 
                    {
                        new Azure.Compute.Inputs.ConfigurationPolicyAssignmentConfigurationParameterArgs
                        {
                            Name = "Minimum Password Length;ExpectedValue",
                            Value = "16",
                        },
                        new Azure.Compute.Inputs.ConfigurationPolicyAssignmentConfigurationParameterArgs
                        {
                            Name = "Minimum Password Age;ExpectedValue",
                            Value = "0",
                        },
                        new Azure.Compute.Inputs.ConfigurationPolicyAssignmentConfigurationParameterArgs
                        {
                            Name = "Maximum Password Age;ExpectedValue",
                            Value = "30,45",
                        },
                        new Azure.Compute.Inputs.ConfigurationPolicyAssignmentConfigurationParameterArgs
                        {
                            Name = "Enforce Password History;ExpectedValue",
                            Value = "10",
                        },
                        new Azure.Compute.Inputs.ConfigurationPolicyAssignmentConfigurationParameterArgs
                        {
                            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/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 = compute.NewConfigurationPolicyAssignment(ctx, "exampleConfigurationPolicyAssignment", &compute.ConfigurationPolicyAssignmentArgs{
    			Location:         exampleWindowsVirtualMachine.Location,
    			VirtualMachineId: exampleWindowsVirtualMachine.ID(),
    			Configuration: &compute.ConfigurationPolicyAssignmentConfigurationArgs{
    				Name:    pulumi.String("AzureWindowsBaseline"),
    				Version: pulumi.String("1.*"),
    				Parameters: compute.ConfigurationPolicyAssignmentConfigurationParameterArray{
    					&compute.ConfigurationPolicyAssignmentConfigurationParameterArgs{
    						Name:  pulumi.String("Minimum Password Length;ExpectedValue"),
    						Value: pulumi.String("16"),
    					},
    					&compute.ConfigurationPolicyAssignmentConfigurationParameterArgs{
    						Name:  pulumi.String("Minimum Password Age;ExpectedValue"),
    						Value: pulumi.String("0"),
    					},
    					&compute.ConfigurationPolicyAssignmentConfigurationParameterArgs{
    						Name:  pulumi.String("Maximum Password Age;ExpectedValue"),
    						Value: pulumi.String("30,45"),
    					},
    					&compute.ConfigurationPolicyAssignmentConfigurationParameterArgs{
    						Name:  pulumi.String("Enforce Password History;ExpectedValue"),
    						Value: pulumi.String("10"),
    					},
    					&compute.ConfigurationPolicyAssignmentConfigurationParameterArgs{
    						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 exampleConfigurationPolicyAssignment = new azure.compute.ConfigurationPolicyAssignment("exampleConfigurationPolicyAssignment", {
        location: exampleWindowsVirtualMachine.location,
        virtualMachineId: exampleWindowsVirtualMachine.id,
        configuration: {
            name: "AzureWindowsBaseline",
            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_configuration_policy_assignment = azure.compute.ConfigurationPolicyAssignment("exampleConfigurationPolicyAssignment",
        location=example_windows_virtual_machine.location,
        virtual_machine_id=example_windows_virtual_machine.id,
        configuration=azure.compute.ConfigurationPolicyAssignmentConfigurationArgs(
            name="AzureWindowsBaseline",
            version="1.*",
            parameters=[
                azure.compute.ConfigurationPolicyAssignmentConfigurationParameterArgs(
                    name="Minimum Password Length;ExpectedValue",
                    value="16",
                ),
                azure.compute.ConfigurationPolicyAssignmentConfigurationParameterArgs(
                    name="Minimum Password Age;ExpectedValue",
                    value="0",
                ),
                azure.compute.ConfigurationPolicyAssignmentConfigurationParameterArgs(
                    name="Maximum Password Age;ExpectedValue",
                    value="30,45",
                ),
                azure.compute.ConfigurationPolicyAssignmentConfigurationParameterArgs(
                    name="Enforce Password History;ExpectedValue",
                    value="10",
                ),
                azure.compute.ConfigurationPolicyAssignmentConfigurationParameterArgs(
                    name="Password Must Meet Complexity Requirements;ExpectedValue",
                    value="1",
                ),
            ],
        ))
    

    Example coming soon!

    Create ConfigurationPolicyAssignment Resource

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

    Constructor syntax

    new ConfigurationPolicyAssignment(name: string, args: ConfigurationPolicyAssignmentArgs, opts?: CustomResourceOptions);
    @overload
    def ConfigurationPolicyAssignment(resource_name: str,
                                      args: ConfigurationPolicyAssignmentArgs,
                                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ConfigurationPolicyAssignment(resource_name: str,
                                      opts: Optional[ResourceOptions] = None,
                                      configuration: Optional[ConfigurationPolicyAssignmentConfigurationArgs] = None,
                                      virtual_machine_id: Optional[str] = None,
                                      location: Optional[str] = None,
                                      name: Optional[str] = None)
    func NewConfigurationPolicyAssignment(ctx *Context, name string, args ConfigurationPolicyAssignmentArgs, opts ...ResourceOption) (*ConfigurationPolicyAssignment, error)
    public ConfigurationPolicyAssignment(string name, ConfigurationPolicyAssignmentArgs args, CustomResourceOptions? opts = null)
    public ConfigurationPolicyAssignment(String name, ConfigurationPolicyAssignmentArgs args)
    public ConfigurationPolicyAssignment(String name, ConfigurationPolicyAssignmentArgs args, CustomResourceOptions options)
    
    type: azure:compute:ConfigurationPolicyAssignment
    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 ConfigurationPolicyAssignmentArgs
    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 ConfigurationPolicyAssignmentArgs
    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 ConfigurationPolicyAssignmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConfigurationPolicyAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConfigurationPolicyAssignmentArgs
    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 configurationPolicyAssignmentResource = new Azure.Compute.ConfigurationPolicyAssignment("configurationPolicyAssignmentResource", new()
    {
        Configuration = new Azure.Compute.Inputs.ConfigurationPolicyAssignmentConfigurationArgs
        {
            Name = "string",
            Parameters = new[]
            {
                new Azure.Compute.Inputs.ConfigurationPolicyAssignmentConfigurationParameterArgs
                {
                    Name = "string",
                    Value = "string",
                },
            },
            Version = "string",
        },
        VirtualMachineId = "string",
        Location = "string",
        Name = "string",
    });
    
    example, err := compute.NewConfigurationPolicyAssignment(ctx, "configurationPolicyAssignmentResource", &compute.ConfigurationPolicyAssignmentArgs{
    	Configuration: &compute.ConfigurationPolicyAssignmentConfigurationArgs{
    		Name: pulumi.String("string"),
    		Parameters: compute.ConfigurationPolicyAssignmentConfigurationParameterArray{
    			&compute.ConfigurationPolicyAssignmentConfigurationParameterArgs{
    				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 configurationPolicyAssignmentResource = new ConfigurationPolicyAssignment("configurationPolicyAssignmentResource", ConfigurationPolicyAssignmentArgs.builder()
        .configuration(ConfigurationPolicyAssignmentConfigurationArgs.builder()
            .name("string")
            .parameters(ConfigurationPolicyAssignmentConfigurationParameterArgs.builder()
                .name("string")
                .value("string")
                .build())
            .version("string")
            .build())
        .virtualMachineId("string")
        .location("string")
        .name("string")
        .build());
    
    configuration_policy_assignment_resource = azure.compute.ConfigurationPolicyAssignment("configurationPolicyAssignmentResource",
        configuration={
            "name": "string",
            "parameters": [{
                "name": "string",
                "value": "string",
            }],
            "version": "string",
        },
        virtual_machine_id="string",
        location="string",
        name="string")
    
    const configurationPolicyAssignmentResource = new azure.compute.ConfigurationPolicyAssignment("configurationPolicyAssignmentResource", {
        configuration: {
            name: "string",
            parameters: [{
                name: "string",
                value: "string",
            }],
            version: "string",
        },
        virtualMachineId: "string",
        location: "string",
        name: "string",
    });
    
    type: azure:compute:ConfigurationPolicyAssignment
    properties:
        configuration:
            name: string
            parameters:
                - name: string
                  value: string
            version: string
        location: string
        name: string
        virtualMachineId: string
    

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

    Configuration ConfigurationPolicyAssignmentConfiguration
    A configuration block as defined below.
    VirtualMachineId string
    The resource ID of the 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 Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
    Name string
    The name of the Virtual Machine Configuration Policy Assignment. Changing this forces a new resource to be created.
    Configuration ConfigurationPolicyAssignmentConfigurationArgs
    A configuration block as defined below.
    VirtualMachineId string
    The resource ID of the 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 Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
    Name string
    The name of the Virtual Machine Configuration Policy Assignment. Changing this forces a new resource to be created.
    configuration ConfigurationPolicyAssignmentConfiguration
    A configuration block as defined below.
    virtualMachineId String
    The resource ID of the 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 Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
    name String
    The name of the Virtual Machine Configuration Policy Assignment. Changing this forces a new resource to be created.
    configuration ConfigurationPolicyAssignmentConfiguration
    A configuration block as defined below.
    virtualMachineId string
    The resource ID of the 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 Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
    name string
    The name of the Virtual Machine Configuration Policy Assignment. Changing this forces a new resource to be created.
    configuration ConfigurationPolicyAssignmentConfigurationArgs
    A configuration block as defined below.
    virtual_machine_id str
    The resource ID of the 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 Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
    name str
    The name of the Virtual Machine Configuration Policy 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 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 Virtual Machine Configuration Policy Assignment should exist. Changing this forces a new resource to be created.
    name String
    The name of the Virtual Machine Configuration Policy Assignment. Changing this forces a new resource to be created.

    Outputs

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

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

    Supporting Types

    ConfigurationPolicyAssignmentConfiguration, ConfigurationPolicyAssignmentConfigurationArgs

    Name string
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment.
    Parameters List<ConfigurationPolicyAssignmentConfigurationParameter>
    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.
    Name string
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment.
    Parameters []ConfigurationPolicyAssignmentConfigurationParameter
    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.
    name String
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment.
    parameters List<ConfigurationPolicyAssignmentConfigurationParameter>
    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.
    name string
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment.
    parameters ConfigurationPolicyAssignmentConfigurationParameter[]
    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.
    name str
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment.
    parameters Sequence[ConfigurationPolicyAssignmentConfigurationParameter]
    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.
    name String
    The name of the Guest Configuration that will be assigned in this Guest Configuration Assignment.
    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.

    ConfigurationPolicyAssignmentConfigurationParameter, ConfigurationPolicyAssignmentConfigurationParameterArgs

    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

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

     $ pulumi import azure:compute/configurationPolicyAssignment:ConfigurationPolicyAssignment 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.