Loading...
Loading...
### Terraform Version ```shell $ terraform version Terraform v1.12.2 on linux_amd64 + provider registry.terraform.io/hashicorp/azurerm v4.39.0 + provider registry.terraform.io/hashicorp/null v3.2.4 ``` ### Terraform Configuration Files ```terraform terraform { required_providers { azurerm = { source = "hashicorp/azurerm" version = "~>4.0" } } } provider "azurerm" { features {} subscription_id = "" # Replace with your Azure subscription ID } data "azurerm_client_config" "current" {} resource "azurerm_resource_group" "rg" { name = "weu-rg" location = "westeurope" } resource "azurerm_storage_account" "stg" { name = "uniquestg93939393" location = azurerm_resource_group.rg.location resource_group_name = azurerm_resource_group.rg.name account_tier = "Standard" account_replication_type = "LRS" } resource "azurerm_role_assignment" "role_stg_blob_data_owner" { scope = azurerm_storage_account.stg.id role_definition_name = "Storage Blob Data Owner" principal_id = data.azurerm_client_config.current.client_id # This causes the error, should be object_id but bug happens because I put client_id by mistake timeouts { create = "5m" # Added this to speed up testing } } ``` ### Debug Output ``` azurerm_role_assignment.role_stg_blob_data_owner: Still creating... [04m50s elapsed] azurerm_role_assignment.role_stg_blob_data_owner: Still creating... [05m00s elapsed] ╷ │ Error: unexpected status 400 (400 Bad Request) with error: PrincipalNotFound: Principal does not exist in the directory . Check that you have the correct principal ID. If you are creating this principal and then immediately assigning a role, this error might be related to a replication delay. In this case, set the role assignment principalType property to a value, such as ServicePrincipal, User, or Group. See https://aka.ms/docs-principaltype │ │ with azurerm_role_assignment.role_stg_blob_data_owner, │ on main.tf line 30, in resource "azurerm_role_assignment" "role_stg_blob_data_owner": │ 30: resource "azurerm_role_assignment" "role_stg_blob_data_owner" { │ ╵ ``` ### Expected Behavior Terraform should fail gracefully before the timeout happens. ### Actual Behavior Terraform keeps running indefinitely (or until timeout happens) and notifies about missing principal after we reach a timeout. ### Steps to Reproduce 1. `terraform init` 2. `terraform apply` ### Additional Context _No response_ ### References _No response_ ### Generative AI / LLM assisted development? _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.