MonitorClient.diagnosticSettings.list(resource)` returns empty when it should return settings
See original GitHub issue- Package Name: @azure/arm-monitor
- Package Version: 7.0.0
- Operating system: MacOS
- nodejs
- version: v16.15.0
- browser
- name/version:
- typescript
- version: v10.7.0
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug
I have created a ‘Diagnostic setting’ in the Azure Web Console for Key Vault. When I run both the Azure CLI and the corresponding MonitorClient.diagnosticSettings.list(resource)
in this package I get the response:
{"value":[]}}
When I hit the same endpoint with the a new API version I get a response:
az rest --method get --url "https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP_NAME>/providers/Microsoft.KeyVault/vaults/<KEY_VAULT_NAME>/providers/Microsoft.Insights/diagnosticSettings?api-version=2021-05-01-preview"
I suspect it’s related to the same API issue here: https://github.com/Azure/azure-powershell/issues/18334
To Reproduce Steps to reproduce the behavior:
- Create a key vault
- On the ‘Monitor’ page on the web console create a diagnostic setting for the key vault
- Call the
list
method of thediagnosticSettings
interface from theMonitorClient
and pass in the resource ID of the previously created
Expected behavior It should return the diagnostic setting of the key vault
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
if we could pass in api-version
to our MonitorClient
client then i think that would be able to fix this problem?
Issue Analytics
- State:
- Created a year ago
- Comments:11 (7 by maintainers)
@itamarazulay-wiz Unfortunately, we do not give an easy way to set api-version in Go SDK. Besides changing the source code directly, you could accomplish it by add a special policy to the diagnostics client. Something like the following:
@edmundcong @itamarazulay-wiz I will close this issue now as the JS SDK issue should have been resolved . Feel free to open a new issue in Go SDK repo if you still want to discuss this. Thanks