# Timed out whilst waiting for new service principal to be replicated in Azure AD

**URL:** <https://discuss.hashicorp.com/t/timed-out-whilst-waiting-for-new-service-principal-to-be-replicated-in-azure-ad/76819>\
**Category:** Terraform Providers\
**Created:** [November 21, 2025, 10:14am UTC](https://discuss.hashicorp.com/t/timed-out-whilst-waiting-for-new-service-principal-to-be-replicated-in-azure-ad/76819 "2025-11-21T10:14:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewToTerraform](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/newtoterraform/32/15999_2.png) [@NewToTerraform](https://discuss.hashicorp.com/u/NewToTerraform)\
**Post date:** [November 21, 2025, 10:14am UTC](https://discuss.hashicorp.com/t/timed-out-whilst-waiting-for-new-service-principal-to-be-replicated-in-azure-ad/76819/1 "2025-11-21T10:14:53Z")

</div>

Using Azure AD provider 3.7.0. While trying to create app registration or service principal getting error - **Timed out whilst waiting for new service principal to be replicated in Azure AD.**

```auto
terraform {

  required_providers {

    azurerm = {

      source = "hashicorp/azurerm"

      version = ">= 3.116.0, < 4.21.1"

    }

    azuread = {

      source = "hashicorp/azuread"

      version = "~> 3.7.0" #earlier version was 3.1.0

    }

    azuredevops = {

      source = "microsoft/azuredevops"

      version = ">= 1.6.0"

    }

  }

  backend "azurerm" {}

}

```

> # Create app registration
> 
> resource “azuread\_application” “appreg” {
> 
> display\_name = var.application\_name
> 
> prevent\_duplicate\_names = true
> 
> sign\_in\_audience = “AzureADMyOrg”
> 
> lifecycle {
> 
> ```
> ignore_changes = \[
> 
> required_resource_access,
> 
> api,
> 
> web
> 
> \]
> 
> ```
> 
> }
> 
> owners = [data.azurerm\_client\_config.current.object\_id]
> 
> }
> 
> resource “time\_sleep” “wait\_for\_replication\_60s” {
> 
> depends\_on = [azuread\_application.appreg]
> 
> create\_duration = “60s”
> 
> }
> 
> # Set rotation for spn secret
> 
> resource “time\_rotating” “secret\_time” {
> 
> rotation\_months = var.secret\_rotation\_in\_months # default is 6 months
> 
> }
> 
> # Create service principal for this app registration
> 
> resource “azuread\_service\_principal” “spn” {
> 
> client\_id = azuread\_application.appreg.client\_id
> 
> use\_existing = true
> 
> depends\_on = [time\_sleep.wait\_for\_replication\_60s]
> 
> }

│ **Error: Provider produced inconsistent result after apply**

│ When applying changes to

module.data.module.project[0].module.spn[0].module.spn.azuread\_application.appreg,

│ provider "provider[\“[Terraform Registry](http://registry.terraform.io/hashicorp/azuread)"]” produced

│ an unexpected new value: Root object was present, but now absent.

│ This is a bug in the provider, which should be reported in the provider’s

│ own issue tracker.

│ **Error: Timed out whilst waiting for new service principal to be replicated in Azure AD**

│ with module.data.module.project[0].module.spn2[0].module.spn2.azuread\_service\_principal.spn,

│ on .terraform\modules\data\spn\main.tf line 45, in resource “azuread\_service\_principal” “spn”:

│ 45: resource “azuread\_service\_principal” “spn” {

│ unexpected status 404 (404 Not Found) with error: Request\_ResourceNotFound:

│ Resource ‘b5fexxxx-xxxx-2343-z3214-xxxxxxxxxxxxxxxx’ does not exist or one of

│ its queried reference-property objects are not present.

---

<div class="post-metadata">

**Author:** ![evangk2016](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/evangk2016/32/46768_2.png) [@evangk2016](https://discuss.hashicorp.com/u/evangk2016)\
**Post date:** [November 25, 2025, 2:47pm UTC](https://discuss.hashicorp.com/t/timed-out-whilst-waiting-for-new-service-principal-to-be-replicated-in-azure-ad/76819/2 "2025-11-25T14:47:55Z")

</div>

i am having the exact same issue as of today
