Summary
I am using the ARM template provided in this repository to deploy the Azure log forwarder to New Relic. Instead of using arm template directly I am doing deployment via Terraform (using azurerm_resource_group_template_deployment), the deployment fails intermittently due to missing dependencies between resources.
error
│ Error: waiting for creation of Template Deployment "newrelic-log-forwarder" (Resource Group "NewRelic-Log-Forwarder-RG-EU"): Code="DeploymentFailed" Message="At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details." Details=[{"code":"NotFound","message":"{\r\n "error": {\r\n "code": "ParentResourceNotFound",\r\n "message": "Failed to perform 'write' on resource(s) of type 'namespaces/eventhubs/consumergroups', because the parent resource '/subscriptions/xxxx-xxx-xxx-xx-xxx/resourceGroups/NewRelic-Log-Forwarder-RG-EU/providers/Microsoft.EventHub/namespaces/newreliclogforwarder/eventhubs/newreliclogforwarder' could not be found."\r\n }\r\n}"},{"code":"NotFound","message":"{\r\n "error": {\r\n "code": "ParentResourceNotFound",\r\n "message": "Failed to perform 'write' on resource(s) of type 'namespaces/authorizationrules', because the parent resource '/subscriptions/xxxx-xxx-xxx-xx-xxx/resourceGroups/NewRelic-Log-Forwarder-RG-EU/providers/Microsoft.EventHub/namespaces/newreliclogforwarder' could not be found."\r\n }\r\n}"}]
│
Desired Behaviour
It should be able to deploy without issues.
Possible Solution
I have added a dependency on consumergroups and it worked
"[resourceId('Microsoft.EventHub/namespaces/', variables('eventHubNamespaceName'))]"
Additional context
We have fully automated system to deploy newrelic config using terraform.
Summary
I am using the ARM template provided in this repository to deploy the Azure log forwarder to New Relic. Instead of using arm template directly I am doing deployment via Terraform (using azurerm_resource_group_template_deployment), the deployment fails intermittently due to missing dependencies between resources.
error
│ Error: waiting for creation of Template Deployment "newrelic-log-forwarder" (Resource Group "NewRelic-Log-Forwarder-RG-EU"): Code="DeploymentFailed" Message="At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details." Details=[{"code":"NotFound","message":"{\r\n "error": {\r\n "code": "ParentResourceNotFound",\r\n "message": "Failed to perform 'write' on resource(s) of type 'namespaces/eventhubs/consumergroups', because the parent resource '/subscriptions/xxxx-xxx-xxx-xx-xxx/resourceGroups/NewRelic-Log-Forwarder-RG-EU/providers/Microsoft.EventHub/namespaces/newreliclogforwarder/eventhubs/newreliclogforwarder' could not be found."\r\n }\r\n}"},{"code":"NotFound","message":"{\r\n "error": {\r\n "code": "ParentResourceNotFound",\r\n "message": "Failed to perform 'write' on resource(s) of type 'namespaces/authorizationrules', because the parent resource '/subscriptions/xxxx-xxx-xxx-xx-xxx/resourceGroups/NewRelic-Log-Forwarder-RG-EU/providers/Microsoft.EventHub/namespaces/newreliclogforwarder' could not be found."\r\n }\r\n}"}]
│
Desired Behaviour
It should be able to deploy without issues.
Possible Solution
I have added a dependency on consumergroups and it worked
"[resourceId('Microsoft.EventHub/namespaces/', variables('eventHubNamespaceName'))]"
Additional context
We have fully automated system to deploy newrelic config using terraform.