Enterprise-Scale/examples/policies/policy-definition
Kevin Rowlandson fc93df704a
Update contributing guidance (#1095)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: JamJarchitect <53943045+JamJarchitect@users.noreply.github.com>
Co-authored-by: Jack Tracey <41163455+jtracey93@users.noreply.github.com>
2022-12-28 11:11:42 +00:00
..
README.md Update contributing guidance (#1095) 2022-12-28 11:11:42 +00:00
policy-definition.json create mg example (#375) 2020-12-25 18:30:01 +01:00

README.md

Create new policy definition

The ARM template provided in this folder shows how a new policy definition is created at the targeted scope.

Parameters

  • "policyName": Provide a name for the policyDefinition
  • "policyDescription": Provide a description for the policy
  • "namePattern": Provide the naming pattern for this policy to ensure naming convention for all resource names

    "parameters": {
        "policyName": {
            "type": "string",
            "metadata": {
                "description": "Provide name for the policyDefinition."
            }
        },
        "policyDescription": {
            "type": "string",
            "metadata": {
                "description": "Provide a description for the policy."
            }
        },
        "namePattern": {
            "type": "string",
            "metadata": {
                "description": "Provide naming pattern."
            }
        }
    },

Deploy using AzOps

See these instructions for how to deploy ARM templates with the AzOps GitHub Actions/DevOps pipeline.

Deploy using Azure PowerShell

New-AzManagementGroupDeployment `
            -Name <name of deployment> `
            -Location <location> `
            -ManagementGroupId <mgmtGroupId> `
            -TemplateUri "https://raw.githubusercontent.com/Azure/Enterprise-Scale/main/examples/policies/policy-definition/policy-definition.json" `
            -policyName <policy name> `
            -policyDescription <policy description> `
            -namePattern <name pattern>

            

Deploy using Azure CLI (Bash in Cloud Shell)

az deployment mg create \
  --name <name of deployment> \
  --location <location> \
  --management-group-id <mgmtGroupId> \
  --template-uri "https://raw.githubusercontent.com/Azure/Enterprise-Scale/main/examples/policies/policy-definition/policy-definition.json" \
  --parameters "{ \"policyName\": { \"value\": \"<policy name>\" }, \"policyDescription\": { \"value\": \"<policy description>\" }, \"namePattern\": { \"value\": \"<name pattern>\" }}"