Azure / Azure/azure-rest-api-specs
Diagnostic Settings Create API Has Inconsistent Behavior On `logAnalyticsDestinationType` for Certain Resource
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
The field `logAnalyticsDestinationType` in the diagnostic setting [Creation API](https://docs.microsoft.com/en-us/rest/api/monitor/diagnosticsettings/createorupdate#request-body) is not consistent and have skew for certain resources.
1. For some certain resource (e.g. `azure app service`), if the user calls diagnostic settings with `logAnalyticsDestinationType` set to `Dedicated`, the API returns successful, but the body of a following `GET` returns that field with null. Is it possible to raise an error if the resource doesn't support the specified destination type?
2. For some other resource (e.g. `azure API management`), if the user calls diagnostic settings with `logAnalyticsDestinationType` absent, the API returns successful, but the body of a following `GET` returns that field with `AzureDiagnostics`, which is not documented. Is it possible to return `nil` as documented?
## Reference
- terraform-providers/terraform-provider-azurerm#6676.
Contributor guide
Assessment
This issue has not been assessed yet.