Skip to content

Script for "Create a policy parameter definition." is not working. #24576

@ozcanli

Description

@ozcanli

Hi,

Under the examples given script for "Create a policy parameter definition." is not working.

Wrong part is: parameters('listOfAllowedLocations')
This is supposed to be: parameters('allowedLocations')

az policy definition create --name allowedLocations
--rules "{ "if": { "allOf": [
{ "field": "location","notIn": "[parameters('listOfAllowedLocations')]" },
{ "field": "location", "notEquals": "global" },
{ "field": "type", "notEquals":
"Microsoft.AzureActiveDirectory/b2cDirectories"}
] }, "then": { "effect": "deny" } }"
--params "{ "allowedLocations": {
"type": "array", "metadata": { "description":
"The list of locations that can be specified when deploying resources",
"strongType": "location", "displayName": "Allowed locations" } } }"


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Labels

ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAuto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions