az monitor diagnostic-settings create will not accept same json as returned by show for 'logs'
See original GitHub issueEnvironment summary
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here: script
CLI Version: What version of the CLI and modules are installed? (Use az --version
)
Answer here: 2.0.3
OS Version: What OS and version are you using?
Answer here: Ubuntu 16.04 x64
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: bash
Description
The input to logs option for monitor create won’t accept the logs array as returned by ‘az monitor diagnostics-settings show’ - you have to strip out the ‘retentionPolicy’ elements. This seems incorrect.
Example in my case:
"logs": [
{
"category": "ApplicationGatewayAccessLog",
"enabled": false,
"retentionPolicy": {
"days": 0,
"enabled": false
}
},
{
"category": "ApplicationGatewayPerformanceLog",
"enabled": false,
"retentionPolicy": {
"days": 0,
"enabled": false
}
},
{
"category": "ApplicationGatewayFirewallLog",
"enabled": true,
"retentionPolicy": {
"days": 0,
"enabled": false
}
}
],
It fails with:
u'retentionPolicy'
Traceback (most recent call last):
File "/users/nneul/lib/azure-cli/local/lib/python2.7/site-packages/azure/cli/main.py", line 36, in main
cmd_result = APPLICATION.execute(args)
File "/users/nneul/lib/azure-cli/local/lib/python2.7/site-packages/azure/cli/core/application.py", line 201, in execute
result = expanded_arg.func(params)
File "/users/nneul/lib/azure-cli/local/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 403, in _execute_command
raise ex
KeyError: u'retentionPolicy'
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
az monitor diagnostic-settings | Microsoft Learn
Commands; az monitor diagnostic-settings create; az monitor ... accepted values: 0, 1, f, false, n, no, t, true, y, yes. --logs. JSON encoded...
Read more >app service create diagnostic settings using az cli
You can use the command az monitor diagnostic-settings categories list ... You can probably try the same JSON response however by replacing ...
Read more >Manual Azure Activity Log Integration | Lacework Documentation
Lacework uses Azure Monitor's Diagnostic Settings, which exports the same type of logs in a folder named "insights-activity-logs". Inside is a folder ...
Read more >azure-cli 2.14.1 - PyPI
Fix #12653: az webapp log config –application-logging false doesn't turn it off (#14929) ... az monitor diagnostic-settings create : support ...
Read more >Six Tips for Azure Cloud Security - LogRhythm
The Azure Activity Log is a core part of Azure Monitor. ... It's a json formatted log, but at a glance, it doesn't...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Confirmed that this is now working. Thank you!
@nneul Closing the bug as PR is merged in. Could please use the nightly tomorrow and let us know whether things are good on you end or not. Appreciate your help.