Azure / Azure/azure-rest-api-specs

Diagnostic Settings Create API Has Inconsistent Behavior On `logAnalyticsDestinationType` for Certain Resource

Open
#9,281 10 comments 20 reactions 1 assignee Claimed by @akning-ms View on GitHub
App Services Service Attention
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.