az monitor diagnostic-settings subscription

Manage diagnostic settings for subscription.

Commands

Name Description Type Status
az monitor diagnostic-settings subscription create

Create subscription diagnostic settings for the specified resource.

Core GA
az monitor diagnostic-settings subscription delete

Deletes existing subscription diagnostic settings for the specified resource.

Core GA
az monitor diagnostic-settings subscription list

Gets the active subscription diagnostic settings list for the specified subscriptionId. :keyword callable cls: A custom type or function that will be passed the direct response:return: SubscriptionDiagnosticSettingsResourceCollection or the result of cls(response):rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResourceCollection:raises ~azure.core.exceptions.HttpResponseError:.

Core GA
az monitor diagnostic-settings subscription show

Gets the active subscription diagnostic settings for the specified resource.

Core GA
az monitor diagnostic-settings subscription update

Update subscription diagnostic settings for the specified resource.

Core GA

az monitor diagnostic-settings subscription create

Create subscription diagnostic settings for the specified resource.

az monitor diagnostic-settings subscription create --name
                                                   [--event-hub-auth-rule]
                                                   [--event-hub-name]
                                                   [--location]
                                                   [--logs]
                                                   [--service-bus-rule]
                                                   [--storage-account]
                                                   [--workspace]

Examples

Create diagnostic settings for a subscription with EventHub.

az monitor diagnostic-settings subscription create -n {name} --location westus --event-hub-auth-rule {eventHubRuleID} --storage-account {storageAccount} --logs "[{category:Security,enabled:true},{category:Administrative,enabled:true},{category:ServiceHealth,enabled:true},{category:Alert,enabled:true},{category:Recommendation,enabled:true},{category:Policy,enabled:true},{category:Autoscale,enabled:true},{category:ResourceHealth,enabled:true}]"

Required Parameters

--name -n

The name of the diagnostic setting.

Optional Parameters

--event-hub-auth-rule

The resource Id for the event hub authorization rule.

--event-hub-name

The name of the event hub. If none is specified, the default event hub will be selected.

--location -l

Location of the resource.

--logs

JSON encoded list of logs settings. Use '@{file}' to load from a file. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--service-bus-rule

The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format '{service bus resourceID}/authorizationrules/{key name}'.

--storage-account

The resource id of the storage account to which you would like to send the Activity Log.

--workspace

The resource id of the log analytics workspace.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az monitor diagnostic-settings subscription delete

Deletes existing subscription diagnostic settings for the specified resource.

az monitor diagnostic-settings subscription delete [--ids]
                                                   [--name]
                                                   [--subscription]
                                                   [--yes]

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the diagnostic setting.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az monitor diagnostic-settings subscription list

Gets the active subscription diagnostic settings list for the specified subscriptionId. :keyword callable cls: A custom type or function that will be passed the direct response:return: SubscriptionDiagnosticSettingsResourceCollection or the result of cls(response):rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResourceCollection:raises ~azure.core.exceptions.HttpResponseError:.

az monitor diagnostic-settings subscription list
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az monitor diagnostic-settings subscription show

Gets the active subscription diagnostic settings for the specified resource.

az monitor diagnostic-settings subscription show [--ids]
                                                 [--name]
                                                 [--subscription]

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the diagnostic setting.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az monitor diagnostic-settings subscription update

Update subscription diagnostic settings for the specified resource.

az monitor diagnostic-settings subscription update [--add]
                                                   [--event-hub-auth-rule]
                                                   [--event-hub-name]
                                                   [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                                   [--ids]
                                                   [--location]
                                                   [--logs]
                                                   [--name]
                                                   [--remove]
                                                   [--service-bus-rule]
                                                   [--set]
                                                   [--storage-account]
                                                   [--subscription]
                                                   [--workspace]

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--event-hub-auth-rule

The resource Id for the event hub authorization rule.

--event-hub-name

The name of the event hub. If none is specified, the default event hub will be selected.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--location -l

Location of the resource.

--logs

JSON encoded list of logs settings. Use '@{file}' to load from a file. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--name -n

The name of the diagnostic setting.

--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

--service-bus-rule

The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format '{service bus resourceID}/authorizationrules/{key name}'.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

--storage-account

The resource id of the storage account to which you would like to send the Activity Log.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--workspace

The resource id of the log analytics workspace.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.