Loading...
Loading...
### Terraform Version ```shell I have tried this with multiple version of terraform and multiple versions of the azuread provider - they are all unstable: terraform: 1.11.0, 1.12.0, 1.12.2, 1.13.0-rc1, 1.13.0 azuread: 2.51.0, 3.0.0, 3.1.0, 3.5.0 ``` ### Terraform Configuration Files ``` terraform { required_providers { azurerm = { source = "hashicorp/azurerm" version = "4.0.0" } azuread = { source = "hashicorp/azuread" version = "3.5.0" } } required_version = ">= 1.1.0" } provider "azurerm" { features {} resource_provider_registrations = "none" subscription_id = "XXXXXXXXXXX" } provider "azuread" { tenant_id = "XXXXXXXXXXX" client_id = "XXXXXXXXXXX" client_secret = "XXXXXXXXXXX" } data "azuread_application_published_app_ids" "well_known" {} resource "azuread_application" "service-application" { display_name = "test" sign_in_audience = "AzureADandPersonalMicrosoftAccount" api { requested_access_token_version = 2 } } ``` ### Debug Output https://gist.github.com/hkrazure/fbb09c916b38a1d7789199873318b68f ### Expected Behavior The app registration should be created every time instead of failing some of the time. ### Actual Behavior It fails with the following message: │ unexpected status 409 (409 Conflict) with error: Error_MsaAppDoesNotExist: │ The corresponding MSA application does not exist. Apparently creating an app registration resource results in two calls from terraform - a post and a patch. It appears that the patch request fails because azure schedules creating some resources asynchronously - but this is not awaited before the patch request is executed which results in the failure. ### Steps to Reproduce 1. Initialize terraform 2. Run terraform plan 3. Run terraform apply ### Additional Context This is an issue with sign_in_audience = "AzureADandPersonalMicrosoftAccount". It seems to work with other sign_in_audience values. But we need this specific one in our setup. ### References I can see there is an issue for microsoft graph that fails with the samme message: https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/3380 ### 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.