Skip to content

az monitor diagnostic-settings categories list incorrectly always returns an empty list #10719

@jurjenoskam

Description

@jurjenoskam

(On azure-cli 2.0.74 using the Cloud Shell; I did not try any other versions)

az monitor diagnostic-settings categories list always returns an empty list of categories, even though the resource does have categories. This happens with every resource type I tried. Example:

azureuser@Azure:~$ az monitor diagnostic-settings categories list --resource ${RESOURCE_ID}
{
  "value": []
}
azureuser@Azure:~$ az rest --method get --uri ${RESOURCE_ID}/providers/microsoft.insights/diagnosticSettingsCategories?api-version=2017-05-01-preview --query"value[].[name,properties.categoryType]" --output tsv
This command is in preview. It may be changed/removed in a future release.
VMProtectionAlerts      Logs
AllMetrics      Metrics
azureuser@Azure:~$

I would expect the first command to return the same list of categories as the second command.

I believe this is caused by az monitor diagnostic-settings categories list using an incorrect API call, based on the following command output when adding --debug:

  [...]
urllib3.connectionpool : https://management.azure.com:443 "GET [resource-id-redacted]/providers/microsoft.insights/diagnosticSettings?api-version=2017-05-01-preview HTTP/1.1" 200 None
  [...]

As you can see, it requests diagnosticSettings instead of what I believe to be correct: diagnosticSettingsCategories.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions