KeyVault in Azure bicep template

Azure Newbie 70 Reputation points
2023-05-25T14:38:11.0766667+00:00

Hi I am building my azure infrastructure using bicep templates

https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/scenarios/cloud-scale-analytics/architectures/deployment-templates

when I run my pipeline in devops I get the following error. What other files should I edit to disable public network access?

Resource xxxx was disallowed by policy. Error Type: PolicyViolation, Policy Definition Name : Azure Key Vault should disable public network access, Policy Assignment Name : Deny-Public-Endpoints.

but my 
Keyvault.bicep file specifies 
 
    publicNetworkAccess: 'Disabled'


Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,114 questions
0 comments No comments
{count} votes

Accepted answer
  1. JamesTran-MSFT 36,366 Reputation points Microsoft Employee
    2023-05-25T20:56:39.2033333+00:00

    @Azure Newbie

    Thank you for your post!

    Error Message:

    Resource xxxx was disallowed by policy. Error Type: PolicyViolation, Policy Definition Name : Azure Key Vault should disable public network access, Policy Assignment Name : Deny-Public-Endpoints.

    I understand that you're building out your Azure Infrastructure using Bicep templates but you're running into the error above when deploying your Key Vault with publicNetworkAccess: 'Disabled'.

    To hopefully help resolve your issue or point you in the right direction, in addition to your bicep file specifying publicNetworkAccess: 'Disabled', you should also ensure that your template has the networkAcls property, and that it's reflecting "Deny".

    NetworkRuleSet:

            "properties": {
                "sku": {
                    "family": "A",
                    "name": "Standard"
                },
                "tenantId": "tenantID",
                "networkAcls": {
                    "bypass": "AzureServices",
                    "defaultAction": "Deny",
                    "ipRules": [],
                    "virtualNetworkRules": []
                },
                "accessPolicies": [
    

    Additional Links:

    I hope this helps!

    If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.


    If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.


0 additional answers

Sort by: Most helpful