Facing "Unauthorized error (403)" while creating container in storage account that is behind firewall.
As per solution described here, I confirm that Terraform cloud Public IP is getting whitelisted under Networking --> Firewall of storage account. Service Principal of Terraform cloud is having Contributor as well as Storage Blob Data Owner permissions under Access Control (IAM). However, I am still facing the "Unauthorized error (403)" during the creation of Container. Am I missing something from configuration perspective ?
ERROR message: containers.Client#GetProperties: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: Service returned an error. Status=403 Code="AuthorizationFailure" Message="This request is not authorized to perform this operation.
Any help would be appreciated.
I tried to reproduce the same issue in my environment and got the below results
I have the below script to create the storage account and the storage container
I have taken the example script from this URL
When I run the script I got the same error as shown below
To resolve this error I have modified the settings in the azure portal like below
Go-To Portal => storage-account => networking => add the client IP address under the firewall check the below steps to added on the screenshot and saved the modifications.
I have the contributor role and data owner permissions under the access control
Again I ran the terraform script now I am able to see the expected output