Hi
I am using github action for Infra provisioning, Backend is configured as mentioned in code block.
Storage account has Storage account contrinutor role(inherited from Resource group) for Service principle used in backend.
In activity logs i can see "List Storage Account Keys Succeded" using same SP. But in Github action i get the error while performing terraform init.
"Error: Failed to get existing workspaces: containers.Client#ListBlobs: 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."
note: sub1 and sub2 are different
Public network access is disabled.
Instead have private endpoint.
terraform {
required_version = "1.7.1"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=3.89.0"
}
}
backend "azurerm" {
storage_account_name = "NAME"
container_name = "CONTAINER_NAME"
key = "BLOB_KEY"
resource_group_name = "RG_NAME"
use_oidc = true
subscription_id = "MY_SUB_ID_1"
tenant_id = "MY_TENANT_ID"
client_id = "MY_CLIENT_ID"
}
}
provider "azurerm" {
features {}
subscription_id = "MY_SUB_ID_2"
client_id = "MY_CLIENT_ID"
tenant_id = "MY_TENANT_ID"
use_oidc = true
}