Ask Your Question
2

What are the steps to make an Azure policy that restricts the generation of Azure StorageAccount Queues?

asked 2023-07-06 22:29:56 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-07-06 22:53:01 +0000

woof gravatar image

Here are the steps to make an Azure policy that restricts the generation of Azure Storage Account Queues:

  1. Log in to the Azure portal with your account credentials.

  2. In the search bar, type "Policy" to find the Azure Policy service.

  3. Click on "Policy" to open the policy page.

  4. Click on "Definitions" and then "Add."

  5. Select the "Custom Policy" option and give your policy a name.

  6. In the "Policy rule" section, paste the following JSON code:

{ "mode": "All", "policyRule": { "if": { "allOf": [ { "field": "type", "equals": "Microsoft.Storage/storageAccounts/queueServices" }, { "not": { "field": "Microsoft.Storage/storageAccounts/queueServices/defaultEncryptionScope", "exists": "true" } } ] }, "then": { "effect": "deny" } }, "parameters": {} }

This code will deny the creation of queues for storage accounts that do not have encryption enabled by default.

  1. Click on "Review + create" to review your policy.

  2. Click on "Create" to create your policy.

Once your policy is created, it will be enforced on all your Azure storage accounts. Any attempt to create a queue in a storage account without default encryption will be denied.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-06 22:29:56 +0000

Seen: 11 times

Last updated: Jul 06 '23