Azure-cli: [Monitor] cannot create diagnostics-settings

Created on 19 Apr 2018  路  9Comments  路  Source: Azure/azure-cli

Installed via apt.

In my command below, $group_name, $diagnostics_name and $eventhub_name are all short (single-segment) names. $eh_authzrule_id and $storage_account_id are full resource paths (aka ids). I tried alternate combinations of short and long names too and still get the same error, I think it's something intrinsic to building the request payload.

Here's the command and trimmed debug output:

az monitor diagnostic-settings create \
    --name $diagnostics_name \
    --event-hub $eventhub_name \
    --event-hub-rule $eh_authzrule_id \
    --resource $storage_account_id

Event: CommandInvoker.OnPostCommandTableCreate [<function add_id_parameters at 0x7fad87aa5620>]                 
Event: CommandInvoker.OnCommandTableLoaded []                                                                   
Event: CommandInvoker.OnPreParseArgs [<function _documentdb_deprecate at 0x7fad878e90d0>]                       
Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7fad88a929d8>, <function CLIQuery.handle_query_parameter at 0x7fad88ab1510>, <function handler at 0x7fad87820598>]                    
usage: az monitor diagnostic-settings create [-h] [--verbose] [--debug]                                         
                                             [--output {json,jsonc,table,tsv}]                                  
                                             [--query JMESPATH] --name NAME                                     
                                             <snip>                     
az monitor diagnostic-settings create: error: 'Namespace' object has no attribute 'event_hub_name'  

related: https://github.com/Azure/azure-cli/issues/5698

Monitor bug

All 9 comments

@tjprescott looks like a bug. Is it a regression?

Same issue here trying to activate redis diagnostics -> eventhub

azure-cli (2.0.31)
monitor (0.1.5)

Are there any known workarounds like switching to older CLI versions? (except powershell 馃槵)

@troydai it's not technically a regression. A review of PR #5424 makes it clear that it never worked. The custom command signature and validator don't match, and this scenario was not covered by a test.

@troydai : can you please pick this?

I'll take a look today.

It's a problem in the validator. I will roll out a fix today.

Roll out as in release a new version or just bring it in the codebase? 馃憖

In codebase. It will show up in the next release (check: https://github.com/Azure/azure-cli/milestone/38). If you want to use it right now, you can use the edge build (https://github.com/azure/azure-cli/#edge-builds).

Was this page helpful?
0 / 5 - 0 ratings