custom azure policy to create deplioy if not exist policy to add a defult nsg rule on all subnet

Ankita Rani Patro 181 Reputation points
2023-01-10T18:55:53.83+00:00

hi , I wanted to deploy an Azure policy, which deploys a default rule on any NSG attached to a subnet when ran as a remediation task

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
1,014 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Luke Murray 11,436 Reputation points MVP Volunteer Moderator
    2023-01-11T06:38:12.8766667+00:00

    Hi, Ankita

    Take a look at this community-supplied Azure policy: https://github.com/Azure/Community-Policy/tree/master/Policies/Network/Deploy%20NSG%20rule

    It should add a rule and has to deploy if it does not exist. Make sure you test this on a test NSG or subscriptions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.