azurerm version “~> 2.3.0”
terraform version = v0.12.24
azurerm = “>=1.40”
resource “azurerm_resource_group” “test” {
name = “rg-test”
location = “westus”
}
resource “azurerm_application_insights” “main” {
application_type = “web”
location = “westus”
name = format("%s-%s-%s-%s ", “appins”, “cl”, “dr”, “001”)
resource_group_name = azurerm_resource_group.test.name
retention_in_days = 30
daily_data_cap_in_gb = 100
sampling_percentage = 100
}
The above resource creation fails with below error
Error: Error read Application Insights Billing Features "appins-cl-dr-001 " (Resource Group “rg-test”): insights.ComponentCurrentBillingFeaturesClient#Get: Failure responding to request: StatusCode=404 – Original Error: autorest/azure: Service returned an error. Status=404 Code=“ResourceNotFound” Message=“The Resource 'Microsoft.Insights/components/appins-cl-dr-001 ’ under resource group ‘rg-test’ was not found.”
However, if I hard code the name below it works perfectly fine.
name = “appins-cl-dr-001”
Can someone please help here. Not sure if this is a bug or expected behaviour.