Skip to content

Commit

Permalink
DenyAction sample
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthebrit committed Dec 7, 2022
1 parent 85aa8e6 commit 0153069
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions AzurePolicy/DenyActionSample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"mode": "Indexed",
"policyRule": {
"if": {
"anyOf": [
{
"field": "tags.lockstatus",
"equals": "lock"
},
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"value": "[take(field('name'),9)]",
"match": "stg##prod"
}
]
}
]
},
"then": {
"effect": "DenyAction",
"details": {
"actionNames": [
"delete"
],
"cascadeBehaviors": {
"resourceGroup": "deny"
}
}
}
}
,
"parameters": {}
}

0 comments on commit 0153069

Please sign in to comment.