1. Packages
  2. Packages
  3. Azure Classic
  4. API Docs
  5. management
  6. GroupPolicyAssignment

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 Policy Assignment to a Management Group.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var exampleGroup = new Azure.Management.Group("exampleGroup", new Azure.Management.GroupArgs
            {
                DisplayName = "Some Management Group",
            });
            var exampleDefinition = new Azure.Policy.Definition("exampleDefinition", new Azure.Policy.DefinitionArgs
            {
                PolicyType = "Custom",
                Mode = "All",
                ManagementGroupId = exampleGroup.GroupId,
                PolicyRule = @"	{
        ""if"": {
          ""not"": {
            ""field"": ""location"",
            ""equals"": ""westeurope""
          }
        },
        ""then"": {
          ""effect"": ""Deny""
        }
      }
    ",
            });
            var exampleGroupPolicyAssignment = new Azure.Management.GroupPolicyAssignment("exampleGroupPolicyAssignment", new Azure.Management.GroupPolicyAssignmentArgs
            {
                PolicyDefinitionId = exampleDefinition.Id,
                ManagementGroupId = exampleGroup.Id,
            });
        }
    
    }
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/management"
    	"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 {
    		exampleGroup, err := management.NewGroup(ctx, "exampleGroup", &management.GroupArgs{
    			DisplayName: pulumi.String("Some Management Group"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleDefinition, err := policy.NewDefinition(ctx, "exampleDefinition", &policy.DefinitionArgs{
    			PolicyType:        pulumi.String("Custom"),
    			Mode:              pulumi.String("All"),
    			ManagementGroupId: exampleGroup.GroupId,
    			PolicyRule: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v", "	{\n", "    \"if\": {\n", "      \"not\": {\n", "        \"field\": \"location\",\n", "        \"equals\": \"westeurope\"\n", "      }\n", "    },\n", "    \"then\": {\n", "      \"effect\": \"Deny\"\n", "    }\n", "  }\n")),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = management.NewGroupPolicyAssignment(ctx, "exampleGroupPolicyAssignment", &management.GroupPolicyAssignmentArgs{
    			PolicyDefinitionId: exampleDefinition.ID(),
    			ManagementGroupId:  exampleGroup.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const exampleGroup = new azure.management.Group("exampleGroup", {displayName: "Some Management Group"});
    const exampleDefinition = new azure.policy.Definition("exampleDefinition", {
        policyType: "Custom",
        mode: "All",
        managementGroupId: exampleGroup.groupId,
        policyRule: `	{
        "if": {
          "not": {
            "field": "location",
            "equals": "westeurope"
          }
        },
        "then": {
          "effect": "Deny"
        }
      }
    `,
    });
    const exampleGroupPolicyAssignment = new azure.management.GroupPolicyAssignment("exampleGroupPolicyAssignment", {
        policyDefinitionId: exampleDefinition.id,
        managementGroupId: exampleGroup.id,
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example_group = azure.management.Group("exampleGroup", display_name="Some Management Group")
    example_definition = azure.policy.Definition("exampleDefinition",
        policy_type="Custom",
        mode="All",
        management_group_id=example_group.group_id,
        policy_rule="""	{
        "if": {
          "not": {
            "field": "location",
            "equals": "westeurope"
          }
        },
        "then": {
          "effect": "Deny"
        }
      }
    """)
    example_group_policy_assignment = azure.management.GroupPolicyAssignment("exampleGroupPolicyAssignment",
        policy_definition_id=example_definition.id,
        management_group_id=example_group.id)
    

    Example coming soon!

    Create GroupPolicyAssignment Resource

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

    Constructor syntax

    new GroupPolicyAssignment(name: string, args: GroupPolicyAssignmentArgs, opts?: CustomResourceOptions);
    @overload
    def GroupPolicyAssignment(resource_name: str,
                              args: GroupPolicyAssignmentArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def GroupPolicyAssignment(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              management_group_id: Optional[str] = None,
                              policy_definition_id: Optional[str] = None,
                              description: Optional[str] = None,
                              display_name: Optional[str] = None,
                              enforce: Optional[bool] = None,
                              identity: Optional[GroupPolicyAssignmentIdentityArgs] = None,
                              location: Optional[str] = None,
                              metadata: Optional[str] = None,
                              name: Optional[str] = None,
                              non_compliance_messages: Optional[Sequence[GroupPolicyAssignmentNonComplianceMessageArgs]] = None,
                              not_scopes: Optional[Sequence[str]] = None,
                              parameters: Optional[str] = None)
    func NewGroupPolicyAssignment(ctx *Context, name string, args GroupPolicyAssignmentArgs, opts ...ResourceOption) (*GroupPolicyAssignment, error)
    public GroupPolicyAssignment(string name, GroupPolicyAssignmentArgs args, CustomResourceOptions? opts = null)
    public GroupPolicyAssignment(String name, GroupPolicyAssignmentArgs args)
    public GroupPolicyAssignment(String name, GroupPolicyAssignmentArgs args, CustomResourceOptions options)
    
    type: azure:management:GroupPolicyAssignment
    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 GroupPolicyAssignmentArgs
    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 GroupPolicyAssignmentArgs
    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 GroupPolicyAssignmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GroupPolicyAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GroupPolicyAssignmentArgs
    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 groupPolicyAssignmentResource = new Azure.Management.GroupPolicyAssignment("groupPolicyAssignmentResource", new()
    {
        ManagementGroupId = "string",
        PolicyDefinitionId = "string",
        Description = "string",
        DisplayName = "string",
        Enforce = false,
        Identity = new Azure.Management.Inputs.GroupPolicyAssignmentIdentityArgs
        {
            Type = "string",
            PrincipalId = "string",
            TenantId = "string",
        },
        Location = "string",
        Metadata = "string",
        Name = "string",
        NonComplianceMessages = new[]
        {
            new Azure.Management.Inputs.GroupPolicyAssignmentNonComplianceMessageArgs
            {
                Content = "string",
                PolicyDefinitionReferenceId = "string",
            },
        },
        NotScopes = new[]
        {
            "string",
        },
        Parameters = "string",
    });
    
    example, err := management.NewGroupPolicyAssignment(ctx, "groupPolicyAssignmentResource", &management.GroupPolicyAssignmentArgs{
    	ManagementGroupId:  pulumi.String("string"),
    	PolicyDefinitionId: pulumi.String("string"),
    	Description:        pulumi.String("string"),
    	DisplayName:        pulumi.String("string"),
    	Enforce:            pulumi.Bool(false),
    	Identity: &management.GroupPolicyAssignmentIdentityArgs{
    		Type:        pulumi.String("string"),
    		PrincipalId: pulumi.String("string"),
    		TenantId:    pulumi.String("string"),
    	},
    	Location: pulumi.String("string"),
    	Metadata: pulumi.String("string"),
    	Name:     pulumi.String("string"),
    	NonComplianceMessages: management.GroupPolicyAssignmentNonComplianceMessageArray{
    		&management.GroupPolicyAssignmentNonComplianceMessageArgs{
    			Content:                     pulumi.String("string"),
    			PolicyDefinitionReferenceId: pulumi.String("string"),
    		},
    	},
    	NotScopes: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Parameters: pulumi.String("string"),
    })
    
    var groupPolicyAssignmentResource = new GroupPolicyAssignment("groupPolicyAssignmentResource", GroupPolicyAssignmentArgs.builder()
        .managementGroupId("string")
        .policyDefinitionId("string")
        .description("string")
        .displayName("string")
        .enforce(false)
        .identity(GroupPolicyAssignmentIdentityArgs.builder()
            .type("string")
            .principalId("string")
            .tenantId("string")
            .build())
        .location("string")
        .metadata("string")
        .name("string")
        .nonComplianceMessages(GroupPolicyAssignmentNonComplianceMessageArgs.builder()
            .content("string")
            .policyDefinitionReferenceId("string")
            .build())
        .notScopes("string")
        .parameters("string")
        .build());
    
    group_policy_assignment_resource = azure.management.GroupPolicyAssignment("groupPolicyAssignmentResource",
        management_group_id="string",
        policy_definition_id="string",
        description="string",
        display_name="string",
        enforce=False,
        identity={
            "type": "string",
            "principal_id": "string",
            "tenant_id": "string",
        },
        location="string",
        metadata="string",
        name="string",
        non_compliance_messages=[{
            "content": "string",
            "policy_definition_reference_id": "string",
        }],
        not_scopes=["string"],
        parameters="string")
    
    const groupPolicyAssignmentResource = new azure.management.GroupPolicyAssignment("groupPolicyAssignmentResource", {
        managementGroupId: "string",
        policyDefinitionId: "string",
        description: "string",
        displayName: "string",
        enforce: false,
        identity: {
            type: "string",
            principalId: "string",
            tenantId: "string",
        },
        location: "string",
        metadata: "string",
        name: "string",
        nonComplianceMessages: [{
            content: "string",
            policyDefinitionReferenceId: "string",
        }],
        notScopes: ["string"],
        parameters: "string",
    });
    
    type: azure:management:GroupPolicyAssignment
    properties:
        description: string
        displayName: string
        enforce: false
        identity:
            principalId: string
            tenantId: string
            type: string
        location: string
        managementGroupId: string
        metadata: string
        name: string
        nonComplianceMessages:
            - content: string
              policyDefinitionReferenceId: string
        notScopes:
            - string
        parameters: string
        policyDefinitionId: string
    

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

    ManagementGroupId string
    The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
    PolicyDefinitionId string
    The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
    Description string
    A description which should be used for this Policy Assignment.
    DisplayName string
    The Display Name for this Policy Assignment.
    Enforce bool
    Specifies if this Policy should be enforced or not?
    Identity GroupPolicyAssignmentIdentity
    An identity block as defined below.
    Location string
    The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
    Metadata string
    A JSON mapping of any Metadata for this Policy.
    Name string
    The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
    NonComplianceMessages List<GroupPolicyAssignmentNonComplianceMessage>
    One or more non_compliance_message blocks as defined below.
    NotScopes List<string>
    Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
    Parameters string
    A JSON mapping of any Parameters for this Policy.
    ManagementGroupId string
    The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
    PolicyDefinitionId string
    The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
    Description string
    A description which should be used for this Policy Assignment.
    DisplayName string
    The Display Name for this Policy Assignment.
    Enforce bool
    Specifies if this Policy should be enforced or not?
    Identity GroupPolicyAssignmentIdentityArgs
    An identity block as defined below.
    Location string
    The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
    Metadata string
    A JSON mapping of any Metadata for this Policy.
    Name string
    The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
    NonComplianceMessages []GroupPolicyAssignmentNonComplianceMessageArgs
    One or more non_compliance_message blocks as defined below.
    NotScopes []string
    Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
    Parameters string
    A JSON mapping of any Parameters for this Policy.
    managementGroupId String
    The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
    policyDefinitionId String
    The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
    description String
    A description which should be used for this Policy Assignment.
    displayName String
    The Display Name for this Policy Assignment.
    enforce Boolean
    Specifies if this Policy should be enforced or not?
    identity GroupPolicyAssignmentIdentity
    An identity block as defined below.
    location String
    The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
    metadata String
    A JSON mapping of any Metadata for this Policy.
    name String
    The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
    nonComplianceMessages List<GroupPolicyAssignmentNonComplianceMessage>
    One or more non_compliance_message blocks as defined below.
    notScopes List<String>
    Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
    parameters String
    A JSON mapping of any Parameters for this Policy.
    managementGroupId string
    The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
    policyDefinitionId string
    The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
    description string
    A description which should be used for this Policy Assignment.
    displayName string
    The Display Name for this Policy Assignment.
    enforce boolean
    Specifies if this Policy should be enforced or not?
    identity GroupPolicyAssignmentIdentity
    An identity block as defined below.
    location string
    The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
    metadata string
    A JSON mapping of any Metadata for this Policy.
    name string
    The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
    nonComplianceMessages GroupPolicyAssignmentNonComplianceMessage[]
    One or more non_compliance_message blocks as defined below.
    notScopes string[]
    Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
    parameters string
    A JSON mapping of any Parameters for this Policy.
    management_group_id str
    The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
    policy_definition_id str
    The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
    description str
    A description which should be used for this Policy Assignment.
    display_name str
    The Display Name for this Policy Assignment.
    enforce bool
    Specifies if this Policy should be enforced or not?
    identity GroupPolicyAssignmentIdentityArgs
    An identity block as defined below.
    location str
    The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
    metadata str
    A JSON mapping of any Metadata for this Policy.
    name str
    The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
    non_compliance_messages Sequence[GroupPolicyAssignmentNonComplianceMessageArgs]
    One or more non_compliance_message blocks as defined below.
    not_scopes Sequence[str]
    Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
    parameters str
    A JSON mapping of any Parameters for this Policy.
    managementGroupId String
    The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
    policyDefinitionId String
    The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
    description String
    A description which should be used for this Policy Assignment.
    displayName String
    The Display Name for this Policy Assignment.
    enforce Boolean
    Specifies if this Policy should be enforced or not?
    identity Property Map
    An identity block as defined below.
    location String
    The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
    metadata String
    A JSON mapping of any Metadata for this Policy.
    name String
    The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
    nonComplianceMessages List<Property Map>
    One or more non_compliance_message blocks as defined below.
    notScopes List<String>
    Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
    parameters String
    A JSON mapping of any Parameters for this Policy.

    Outputs

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

    Get an existing GroupPolicyAssignment 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?: GroupPolicyAssignmentState, opts?: CustomResourceOptions): GroupPolicyAssignment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            display_name: Optional[str] = None,
            enforce: Optional[bool] = None,
            identity: Optional[GroupPolicyAssignmentIdentityArgs] = None,
            location: Optional[str] = None,
            management_group_id: Optional[str] = None,
            metadata: Optional[str] = None,
            name: Optional[str] = None,
            non_compliance_messages: Optional[Sequence[GroupPolicyAssignmentNonComplianceMessageArgs]] = None,
            not_scopes: Optional[Sequence[str]] = None,
            parameters: Optional[str] = None,
            policy_definition_id: Optional[str] = None) -> GroupPolicyAssignment
    func GetGroupPolicyAssignment(ctx *Context, name string, id IDInput, state *GroupPolicyAssignmentState, opts ...ResourceOption) (*GroupPolicyAssignment, error)
    public static GroupPolicyAssignment Get(string name, Input<string> id, GroupPolicyAssignmentState? state, CustomResourceOptions? opts = null)
    public static GroupPolicyAssignment get(String name, Output<String> id, GroupPolicyAssignmentState state, CustomResourceOptions options)
    resources:  _:    type: azure:management:GroupPolicyAssignment    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:
    Description string
    A description which should be used for this Policy Assignment.
    DisplayName string
    The Display Name for this Policy Assignment.
    Enforce bool
    Specifies if this Policy should be enforced or not?
    Identity GroupPolicyAssignmentIdentity
    An identity block as defined below.
    Location string
    The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
    ManagementGroupId string
    The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
    Metadata string
    A JSON mapping of any Metadata for this Policy.
    Name string
    The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
    NonComplianceMessages List<GroupPolicyAssignmentNonComplianceMessage>
    One or more non_compliance_message blocks as defined below.
    NotScopes List<string>
    Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
    Parameters string
    A JSON mapping of any Parameters for this Policy.
    PolicyDefinitionId string
    The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
    Description string
    A description which should be used for this Policy Assignment.
    DisplayName string
    The Display Name for this Policy Assignment.
    Enforce bool
    Specifies if this Policy should be enforced or not?
    Identity GroupPolicyAssignmentIdentityArgs
    An identity block as defined below.
    Location string
    The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
    ManagementGroupId string
    The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
    Metadata string
    A JSON mapping of any Metadata for this Policy.
    Name string
    The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
    NonComplianceMessages []GroupPolicyAssignmentNonComplianceMessageArgs
    One or more non_compliance_message blocks as defined below.
    NotScopes []string
    Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
    Parameters string
    A JSON mapping of any Parameters for this Policy.
    PolicyDefinitionId string
    The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
    description String
    A description which should be used for this Policy Assignment.
    displayName String
    The Display Name for this Policy Assignment.
    enforce Boolean
    Specifies if this Policy should be enforced or not?
    identity GroupPolicyAssignmentIdentity
    An identity block as defined below.
    location String
    The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
    managementGroupId String
    The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
    metadata String
    A JSON mapping of any Metadata for this Policy.
    name String
    The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
    nonComplianceMessages List<GroupPolicyAssignmentNonComplianceMessage>
    One or more non_compliance_message blocks as defined below.
    notScopes List<String>
    Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
    parameters String
    A JSON mapping of any Parameters for this Policy.
    policyDefinitionId String
    The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
    description string
    A description which should be used for this Policy Assignment.
    displayName string
    The Display Name for this Policy Assignment.
    enforce boolean
    Specifies if this Policy should be enforced or not?
    identity GroupPolicyAssignmentIdentity
    An identity block as defined below.
    location string
    The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
    managementGroupId string
    The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
    metadata string
    A JSON mapping of any Metadata for this Policy.
    name string
    The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
    nonComplianceMessages GroupPolicyAssignmentNonComplianceMessage[]
    One or more non_compliance_message blocks as defined below.
    notScopes string[]
    Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
    parameters string
    A JSON mapping of any Parameters for this Policy.
    policyDefinitionId string
    The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
    description str
    A description which should be used for this Policy Assignment.
    display_name str
    The Display Name for this Policy Assignment.
    enforce bool
    Specifies if this Policy should be enforced or not?
    identity GroupPolicyAssignmentIdentityArgs
    An identity block as defined below.
    location str
    The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
    management_group_id str
    The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
    metadata str
    A JSON mapping of any Metadata for this Policy.
    name str
    The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
    non_compliance_messages Sequence[GroupPolicyAssignmentNonComplianceMessageArgs]
    One or more non_compliance_message blocks as defined below.
    not_scopes Sequence[str]
    Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
    parameters str
    A JSON mapping of any Parameters for this Policy.
    policy_definition_id str
    The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.
    description String
    A description which should be used for this Policy Assignment.
    displayName String
    The Display Name for this Policy Assignment.
    enforce Boolean
    Specifies if this Policy should be enforced or not?
    identity Property Map
    An identity block as defined below.
    location String
    The Azure Region where the Policy Assignment should exist. Changing this forces a new Policy Assignment to be created.
    managementGroupId String
    The ID of the Management Group. Changing this forces a new Policy Assignment to be created.
    metadata String
    A JSON mapping of any Metadata for this Policy.
    name String
    The name which should be used for this Policy Assignment. Changing this forces a new Policy Assignment to be created.
    nonComplianceMessages List<Property Map>
    One or more non_compliance_message blocks as defined below.
    notScopes List<String>
    Specifies a list of Resource Scopes (for example a Subscription, or a Resource Group) within this Management Group which are excluded from this Policy.
    parameters String
    A JSON mapping of any Parameters for this Policy.
    policyDefinitionId String
    The ID of the Policy Definition or Policy Definition Set. Changing this forces a new Policy Assignment to be created.

    Supporting Types

    GroupPolicyAssignmentIdentity, GroupPolicyAssignmentIdentityArgs

    Type string
    The Type of Managed Identity which should be added to this Policy Definition. The only possible value is SystemAssigned.
    PrincipalId string
    The Principal ID of the Policy Assignment for this Management Group.
    TenantId string
    The Tenant ID of the Policy Assignment for this Management Group.
    Type string
    The Type of Managed Identity which should be added to this Policy Definition. The only possible value is SystemAssigned.
    PrincipalId string
    The Principal ID of the Policy Assignment for this Management Group.
    TenantId string
    The Tenant ID of the Policy Assignment for this Management Group.
    type String
    The Type of Managed Identity which should be added to this Policy Definition. The only possible value is SystemAssigned.
    principalId String
    The Principal ID of the Policy Assignment for this Management Group.
    tenantId String
    The Tenant ID of the Policy Assignment for this Management Group.
    type string
    The Type of Managed Identity which should be added to this Policy Definition. The only possible value is SystemAssigned.
    principalId string
    The Principal ID of the Policy Assignment for this Management Group.
    tenantId string
    The Tenant ID of the Policy Assignment for this Management Group.
    type str
    The Type of Managed Identity which should be added to this Policy Definition. The only possible value is SystemAssigned.
    principal_id str
    The Principal ID of the Policy Assignment for this Management Group.
    tenant_id str
    The Tenant ID of the Policy Assignment for this Management Group.
    type String
    The Type of Managed Identity which should be added to this Policy Definition. The only possible value is SystemAssigned.
    principalId String
    The Principal ID of the Policy Assignment for this Management Group.
    tenantId String
    The Tenant ID of the Policy Assignment for this Management Group.

    GroupPolicyAssignmentNonComplianceMessage, GroupPolicyAssignmentNonComplianceMessageArgs

    Content string
    The non-compliance message text. When assigning policy sets (initiatives), unless policy_definition_reference_id is specified then this message will be the default for all policies.
    PolicyDefinitionReferenceId string
    When assigning policy sets (initiatives), this is the ID of the policy definition that the non-compliance message applies to.
    Content string
    The non-compliance message text. When assigning policy sets (initiatives), unless policy_definition_reference_id is specified then this message will be the default for all policies.
    PolicyDefinitionReferenceId string
    When assigning policy sets (initiatives), this is the ID of the policy definition that the non-compliance message applies to.
    content String
    The non-compliance message text. When assigning policy sets (initiatives), unless policy_definition_reference_id is specified then this message will be the default for all policies.
    policyDefinitionReferenceId String
    When assigning policy sets (initiatives), this is the ID of the policy definition that the non-compliance message applies to.
    content string
    The non-compliance message text. When assigning policy sets (initiatives), unless policy_definition_reference_id is specified then this message will be the default for all policies.
    policyDefinitionReferenceId string
    When assigning policy sets (initiatives), this is the ID of the policy definition that the non-compliance message applies to.
    content str
    The non-compliance message text. When assigning policy sets (initiatives), unless policy_definition_reference_id is specified then this message will be the default for all policies.
    policy_definition_reference_id str
    When assigning policy sets (initiatives), this is the ID of the policy definition that the non-compliance message applies to.
    content String
    The non-compliance message text. When assigning policy sets (initiatives), unless policy_definition_reference_id is specified then this message will be the default for all policies.
    policyDefinitionReferenceId String
    When assigning policy sets (initiatives), this is the ID of the policy definition that the non-compliance message applies to.

    Import

    Management Group Policy Assignments can be imported using the resource id, e.g.

     $ pulumi import azure:management/groupPolicyAssignment:GroupPolicyAssignment example /providers/Microsoft.Management/managementGroups/group1/providers/Microsoft.Authorization/policyAssignments/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.