Open Chasermistrz opened 7 months ago
Hi guys,
We've encountered the exact same thing with the following setup with azurerm_container_app and azurerm_container_app_environment:
Terraform Version 1.7.5
AzureRM Provider Version 3.98.0
Dev Subscription: Container App Environment
We can create the Container App Environment under TF using azurerm linking to the Management Subscription log analytics workspace. Once we then began deploying Container Apps we encountered the exactly same Error: retrieving Log Analytics Workspace: no matching workspace found . We circumvented this by linking the child container app/job to the LAW via ID, e.g.
resource "azurerm_container_app" "some_container_app" {
name = "some-container-app"
container_app_environment_id = "/subscriptions/*****/resourceGroups/some-resource-group/providers/Microsoft.App/managedEnvironments/some-container-app-environment"
resource_group_name = "some-child-resource-group
# The rest of the azurerm_container_app definition
rather than using a data "azurerm_container_app_environment" block
Hope this helps others!
Hello, I have this bug appearing when I try to create a azurerm_container_app_environment_custom_domain to an existing container app environment linked to a LAW in another subscription too. It's anoying because the previous workaround does not seem to work for me.
│ Error: retrieving Log Analytics Workspace: no matching workspace found
│
│ with module.container_apps.azurerm_container_app_environment_custom_domain.container_app_environment_domain,
│ on ../../../../**********/modules/azure/containerapps/container_app_environment.tf line 31, in resource "azurerm_container_app_environment_custom_domain" "container_app_environment_domain":
│ 31: resource "azurerm_container_app_environment_custom_domain" "container_app_environment_domain" {
│
│ retrieving Log Analytics Workspace: no matching workspace found
This bug is still occuring as of azurerm 3.115.0 Any planned resolution?
Any new on this issue? Any idea of a fix?
Is there an existing issue for this?
Community Note
Terraform Version
1.7.5
AzureRM Provider Version
3.97.1
Affected Resource(s)/Data Source(s)
azurerm_container_app_environment
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Data source should be propagated successfully without error.
Actual Behaviour
azurerm_container_app_environment
data source throws error when log analytics workspace assigned to Azure Container Apps environment (Monitoring
->Logging options
->Logs Destination
->Azure Log Analytics
) is located in different subscription. The last working version of provider is 3.73.0, bug was introduced in https://github.com/hashicorp/terraform-provider-azurerm/pull/23298, 3.74.0 and newer versions are affected.Steps to Reproduce
azurerm_container_app_environment
data sourceterraform plan
Important Factoids
No response
References
https://github.com/hashicorp/terraform-provider-azurerm/pull/23298