Greetings!
The error "Public access is not permitted on this storage account" indicates that your storage account settings do not allow any form of public (anonymous) access. In this particular scenario, the error was encountered while trying to create a container with public access, but the storage account was configured to only allow private access.
To address this issue, you need to change the container access type to private, aligning with the storage account's policy that disallows public access.
Steps to resolve:
- Modify Container Access Type:
- Adjust your Terraform configuration or update it through the Azure portal to set the container access type to private.
- Check Storage Account Settings:
- Confirm that the "Allow Blob Public Access" setting for your storage account is set to false if you want to enforce private access on all containers.
Example Terraform script for setting container access type to private:
resource "azurerm_storage_container" "example" {
name = "your-container-name"
storage_account_name = azurerm_storage_account.example.name
container_access_type = "private"
}
For more details, consult the following resources:
#Resources
- Configure anonymous read access for containers and blobs - Azure Storage | Microsoft Learn
- Authorize operations for data access - Azure Storage | Microsoft Learn
- Public access is not permitted on this storage account - Microsoft Learn
Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.
Please do not forget to "up-vote" wherever the information provided helps you, as this can be beneficial to other community members.