Azure policy to deny public access when creating a storage account

MrFlinstone 581 Reputation points
2024-10-03T14:41:10.21+00:00

I am trying to create a solution that will prevent the creation of storage account unless a private endpoint is in place.

Its the section below

User's image

I have used the built in policy definition in Azure, and I am still able to create a storage account with public access enabled.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,149 questions
Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
883 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 14,051 Reputation points MVP
    2024-10-03T15:36:01.2433333+00:00

    Hello @MrFlinstone

    Follow the below steps.

    • Disable public access to the storage account in the Azure portal: 
      1. Go to your storage account in the Azure portal 
      2. Locate the Configuration setting under Settings 
      3. Set Allow Blob anonymous access to Disabled 

    User's image

    Any storage accounts you establish or modify will be affected by this, allowing you to choose Public Network Access - Disabled. You cannot set up virtual network rules or firewall rules while public network access is disabled since such are not applicable in that situation. In addition to setting up the private endpoint, you also need to disable access to the public network when configuring private endpoints.


    If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.


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.