Home > Net >  NotificationHUB issue with terraform azure_RM version
NotificationHUB issue with terraform azure_RM version

Time:10-19

I am new to terraform and trying to configure the notificationHUB with terraform 0.14.5 and we are getting error as notificaitonid not found

enter image description here

Error:

enter image description here

"id":/subscriptions/XXXXXXXX/resourceGroups/XXXX/providers/Microsoft.Notificationhubs/namespaces/XXX/notificationhubs/xxxx"

when it was apply the latest provider it was showing as Microsoft.NotificationHubs

CodePudding user response:

The issue was caused due to Azure version, since it was an old version (2.44.0). The latest fix will be in the 3.18.0 version.

Solution:

  1. Update the azurem version under provider.tf from 2.44.0 to 3.18.0.

enter image description here

        azurerm = { source = "hashicorp/azurerm" version = "=3.18.0" }
  1. Run “terraform init -upgrade

enter image description here enter image description here

  1. Run terraform plan.

  2. Run terraform apply.

enter image description here

Note: -var-file <.tfvar File> is optional. this new version 3.18.0 azurerm will take the providers/Microsoft.NotificationHubs namespace automatically and id will reflect on statefile.

  • Related