az monitor trace-association
This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Route distributed traces to an Azure Monitor workspace.
A trace association sends the traces of an Application Insights component, or of every component in a resource group or subscription, to an Azure Monitor workspace. Associations are additive: a component sends traces to the workspaces associated with it, its resource group and its subscription.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az monitor trace-association create |
Route the traces of a scope to an Azure Monitor workspace. |
Core | Preview |
| az monitor trace-association delete |
Delete the association of a scope. |
Core | Preview |
| az monitor trace-association list |
List the associations that apply to a scope, including those of its resource group and subscription. |
Core | Preview |
| az monitor trace-association show |
Show the association configured at exactly this scope. |
Core | Preview |
az monitor trace-association create
Command group 'monitor trace-association' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Route the traces of a scope to an Azure Monitor workspace.
Creates the association of the scope, or replaces its workspace. Associations of other scopes are unchanged. If the workspace has no trace container, one is created first. Replacing the workspace of a resource group or subscription asks for confirmation. You need write access on both the scope and the workspace.
az monitor trace-association create --azure-monitor-workspace
--resource-uri
[--acquire-policy-token]
[--change-reference]
[--trace-metrics {Disabled, Enabled}]
[--trace-retention-days]
[--yes]
Examples
Route the traces of an Application Insights component to an Azure Monitor workspace.
az monitor trace-association create --resource-uri /subscriptions/{subscriptionID}/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/MyAppInsights --azure-monitor-workspace /subscriptions/{subscriptionID}/resourceGroups/MyResourceGroup/providers/Microsoft.Monitor/accounts/MyWorkspace
Route the traces of every Application Insights component in a resource group, creating the trace container with 90 days retention if the workspace has none.
az monitor trace-association create --resource-uri /subscriptions/{subscriptionID}/resourceGroups/MyResourceGroup --azure-monitor-workspace /subscriptions/{subscriptionID}/resourceGroups/MyResourceGroup/providers/Microsoft.Monitor/accounts/MyWorkspace --trace-retention-days 90
Required Parameters
Resource ID of the Azure Monitor workspace that receives the traces.
Resource ID of an Application Insights component, a resource group or a subscription.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Trace-derived metrics if the workspace has no trace container yet. Default: Enabled.
| Property | Value |
|---|---|
| Accepted values: | Disabled, Enabled |
Days to keep traces, from 4 to 730, if the workspace has no trace container yet. Default: 30.
Do not prompt for confirmation.
| Property | Value |
|---|---|
| Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az monitor trace-association delete
Command group 'monitor trace-association' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Delete the association of a scope.
Associations of other scopes, the Azure Monitor workspace and its trace container are unchanged. Deleting the association of a resource group or subscription asks for confirmation.
az monitor trace-association delete --resource-uri
[--acquire-policy-token]
[--change-reference]
[--yes]
Examples
Delete the association of a subscription without a confirmation prompt.
az monitor trace-association delete --resource-uri /subscriptions/{subscriptionID} --yes
Required Parameters
Resource ID of an Application Insights component, a resource group or a subscription.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Do not prompt for confirmation.
| Property | Value |
|---|---|
| Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az monitor trace-association list
Command group 'monitor trace-association' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
List the associations that apply to a scope, including those of its resource group and subscription.
az monitor trace-association list --resource-uri
Examples
List the associations that apply to an Application Insights component.
az monitor trace-association list --resource-uri /subscriptions/{subscriptionID}/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/MyAppInsights
Required Parameters
Resource ID of an Application Insights component, a resource group or a subscription.
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az monitor trace-association show
Command group 'monitor trace-association' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Show the association configured at exactly this scope.
Associations inherited from a resource group or subscription are not shown. Use list to see them.
az monitor trace-association show --resource-uri
Examples
Show the association of a resource group.
az monitor trace-association show --resource-uri /subscriptions/{subscriptionID}/resourceGroups/MyResourceGroup
Required Parameters
Resource ID of an Application Insights component, a resource group or a subscription.
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |