Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to limit the resource count created(example vm), but my policy is wrong. please help me. #1421

Open
cmcmmm opened this issue Feb 12, 2025 · 0 comments

Comments

@cmcmmm
Copy link

cmcmmm commented Feb 12, 2025

I want to limit the resource count created(example disk or vm), but my policy is wrong. please help me.

Image

my policy as below:
{
"mode": "All",
"parameters": {
"allowedDiskCount": {
"type": "Integer",
"defaultValue": 5
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Compute/disks"
},
{
"count": {
"field": "Microsoft.Compute/disks[*]"
},
"greater": "[parameters('allowedDiskCount')]"
}
]
},
"then": {
"effect": "deny"
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant