none
Custom error after policy deny trigger RRS feed

  • Question

  • Hi, 

    I created a policy that a nic requires a NSG. 

    The policy works fine but i want to customize the error in azure so the people who are deploying stuff have a decent error what they are doing wrong. 

    This is the error we are receiving now when the deny policy is triggered:

    Failed to save network security group for network interface 'bartenderprim758'. Error: Resource 'bartenderprim758' was disallowed by policy. Policy identifiers: '[{"policyAssignment":{"name":"Requires a NSG on a NIC","id":"/subscriptions/a6e10cb0-79e5-4b68-af13-d17fc5f7505a/providers/Microsoft.Authorization/policyAssignments/53320b1ce3fe481ab9bb65d3"},"policyDefinition":{"name":"Requires a NSG on a NIC","id":"/subscriptions/a6e10cb0-79e5-4b68-af13-d17fc5f7505a/providers/Microsoft.Authorization/policyDefinitions/ce60a64c-5b4c-4cc6-9363-3d5b620b891e"}}]'.

    Friday, October 18, 2019 8:38 AM

All replies

  • Thanks for reaching out! Perhaps i am missing something, but according to information provided, the error is being displayed correctly("Failed to save network security group for network interface 'bartenderprim758'. Error: Resource 'bartenderprim758' was disallowed by policy") . If you are looking in customizing the error, as of now its not supported.

    I also would recommend you to navigate here and share your feedback or suggestions directly with the responsible Azure feature team and clicking the vote button of your suggestion to raise visibility and priority on it.

    Hope this helps!

    Monday, October 21, 2019 6:03 AM
    Moderator