Closed sandykardile closed 11 months ago
This is still an issue with azurerm v3.50. I am not setting event hub details, but it is throwing the same error.
My resource configuration:
resource "azurerm_api_management_diagnostic" "azure_monitor_logger_diagnostic" {
api_management_logger_id = azurerm_api_management_logger.azure_monitor_logger.id
api_management_name = "[apim name]"
identifier = "azuremonitor"
resource_group_name = local.resource_group_name
depends_on = [
azurerm_api_management_logger.azure_monitor_logger,
]
}
When I run the script, it says it will create the following:
# azurerm_api_management_diagnostic.azure_monitor_logger_diagnostic will be created
+ resource "azurerm_api_management_diagnostic" "azure_monitor_logger_diagnostic" {
+ always_log_errors = (known after apply)
+ api_management_logger_id = "[id]"
+ api_management_name = "[apim name]"
+ http_correlation_protocol = (known after apply)
+ id = (known after apply)
+ identifier = "azuremonitor"
+ log_client_ip = (known after apply)
+ operation_name_format = "Name"
+ resource_group_name = "[rg name]"
+ sampling_percentage = (known after apply)
+ verbosity = (known after apply)
}
And the error output is:
│ Error: creating or updating Diagnostic: (Name "azuremonitor" / Service Name "[apim name]" / Resource Group "[rg name]"): apimanagement.DiagnosticClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="ValidationError" Message="One or more fields contain incorrect values:" Details=[{"code":"ValidationError","message":"Property 'OperationNameFormat' is only supported for Application Insights diagnostics.","target":"operationNameFormat"}]
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Is there an existing issue for this?
Community Note
Terraform Version
3.38.0
AzureRM Provider Version
3.38.0
Affected Resource(s)/Data Source(s)
azurerm_api_management_diagnostic
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Azure event hub monitoring could be configured correctly
Actual Behaviour
Error: Apimanagement.DiagnosticClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="ValidationError" Message="One or more fields contain incorrect values:" Details=[{"code":"ValidationError","message":"Property 'OperationNameFormat' is only supported for Application Insights diagnostics.","target":"operationNameFormat"}]
Steps to Reproduce
No response
Important Factoids
No response
References
No response