Share via


az monitor log-analytics workspace linked-service

Manage linked service for log analytics workspace.

Linked services is used to define a relation from the workspace to another Azure resource. Log Analytics and Azure resources then leverage this connection in their operations. Example uses of Linked Services in Log Analytics workspace are Automation account and workspace association to CMK.

Commands

Name Description Type Status
az monitor log-analytics workspace linked-service create

Create a linked service.

Core GA
az monitor log-analytics workspace linked-service delete

Delete a linked service.

Core GA
az monitor log-analytics workspace linked-service list

Get all the linked services in a workspace.

Core GA
az monitor log-analytics workspace linked-service show

Show the properties of a linked service.

Core GA
az monitor log-analytics workspace linked-service update

Update a linked service.

Core GA
az monitor log-analytics workspace linked-service wait

Place the CLI in a waiting state until a condition is met.

Core GA

az monitor log-analytics workspace linked-service create

Experimental Preview Deprecated

Create a linked service.

az monitor log-analytics workspace linked-service create --linked-service-name
                                                         --resource-group
                                                         --workspace-name
                                                         [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                                         [--resource-id]
                                                         [--tags]
                                                         [--write-access-resource-id]

Examples

Create a linked service.

az monitor log-analytics workspace linked-service create -g MyResourceGroup -n cluster --workspace-name MyWorkspace --write-access-resource-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/clusters/MyCluster

Required Parameters

--linked-service-name --name -n
Experimental Preview Deprecated

Name of the linkedServices resource. Supported values: cluster, automation.

--resource-group -g
Experimental Preview Deprecated

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--workspace-name
Experimental Preview Deprecated

The name of the workspace.

Optional Parameters

--no-wait
Experimental Preview Deprecated

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-id
Experimental Preview Deprecated

The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require read access.

--tags
Experimental Preview Deprecated

Resource tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--write-access-resource-id
Experimental Preview Deprecated

The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require write access.

Global Parameters
--debug
Experimental Preview Deprecated

Increase logging verbosity to show all debug logs.

--help -h
Experimental Preview Deprecated

Show this help message and exit.

--only-show-errors
Experimental Preview Deprecated

Only show errors, suppressing warnings.

--output -o
Experimental Preview Deprecated

Output format.

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

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

--subscription
Experimental Preview Deprecated

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

--verbose
Experimental Preview Deprecated

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

az monitor log-analytics workspace linked-service delete

Experimental Preview Deprecated

Delete a linked service.

az monitor log-analytics workspace linked-service delete [--ids]
                                                         [--linked-service-name]
                                                         [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                                         [--resource-group]
                                                         [--subscription]
                                                         [--workspace-name]
                                                         [--yes]

Examples

Delete a linked service.

az monitor log-analytics workspace linked-service delete -g MyResourceGroup -n cluster --workspace-name MyWorkspace

Required Parameters

Optional Parameters

--ids
Experimental Preview Deprecated

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.

--linked-service-name --name -n
Experimental Preview Deprecated

Name of the linkedServices resource. Supported values: cluster, automation.

--no-wait
Experimental Preview Deprecated

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g
Experimental Preview Deprecated

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription
Experimental Preview Deprecated

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

--workspace-name
Experimental Preview Deprecated

The name of the workspace.

--yes -y
Experimental Preview Deprecated

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug
Experimental Preview Deprecated

Increase logging verbosity to show all debug logs.

--help -h
Experimental Preview Deprecated

Show this help message and exit.

--only-show-errors
Experimental Preview Deprecated

Only show errors, suppressing warnings.

--output -o
Experimental Preview Deprecated

Output format.

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

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

--subscription
Experimental Preview Deprecated

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

--verbose
Experimental Preview Deprecated

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

az monitor log-analytics workspace linked-service list

Experimental Preview Deprecated

Get all the linked services in a workspace.

az monitor log-analytics workspace linked-service list --resource-group
                                                       --workspace-name

Examples

Get all the linked services in a workspace.

az monitor log-analytics workspace linked-service list -g MyResourceGroup --workspace-name MyWorkspace

Required Parameters

--resource-group -g
Experimental Preview Deprecated

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--workspace-name
Experimental Preview Deprecated

The name of the workspace.

Optional Parameters

Global Parameters
--debug
Experimental Preview Deprecated

Increase logging verbosity to show all debug logs.

--help -h
Experimental Preview Deprecated

Show this help message and exit.

--only-show-errors
Experimental Preview Deprecated

Only show errors, suppressing warnings.

--output -o
Experimental Preview Deprecated

Output format.

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

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

--subscription
Experimental Preview Deprecated

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

--verbose
Experimental Preview Deprecated

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

az monitor log-analytics workspace linked-service show

Experimental Preview Deprecated

Show the properties of a linked service.

az monitor log-analytics workspace linked-service show [--ids]
                                                       [--linked-service-name]
                                                       [--resource-group]
                                                       [--subscription]
                                                       [--workspace-name]

Examples

Show the properties of a linked service.

az monitor log-analytics workspace linked-service show -g MyResourceGroup -n cluster --workspace-name MyWorkspace

Required Parameters

Optional Parameters

--ids
Experimental Preview Deprecated

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.

--linked-service-name --name -n
Experimental Preview Deprecated

Name of the linkedServices resource. Supported values: cluster, automation.

--resource-group -g
Experimental Preview Deprecated

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription
Experimental Preview Deprecated

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

--workspace-name
Experimental Preview Deprecated

The name of the workspace.

Global Parameters
--debug
Experimental Preview Deprecated

Increase logging verbosity to show all debug logs.

--help -h
Experimental Preview Deprecated

Show this help message and exit.

--only-show-errors
Experimental Preview Deprecated

Only show errors, suppressing warnings.

--output -o
Experimental Preview Deprecated

Output format.

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

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

--subscription
Experimental Preview Deprecated

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

--verbose
Experimental Preview Deprecated

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

az monitor log-analytics workspace linked-service update

Experimental Preview Deprecated

Update a linked service.

az monitor log-analytics workspace linked-service update [--add]
                                                         [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                                         [--ids]
                                                         [--linked-service-name]
                                                         [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                                         [--remove]
                                                         [--resource-group]
                                                         [--resource-id]
                                                         [--set]
                                                         [--subscription]
                                                         [--tags]
                                                         [--workspace-name]
                                                         [--write-access-resource-id]

Examples

Update a linked service.

az monitor log-analytics workspace linked-service update -g MyResourceGroup -n cluster --workspace-name MyWorkspace --write-access-resource-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/clusters/MyCluster

Required Parameters

Optional Parameters

--add
Experimental Preview Deprecated

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>.

--force-string
Experimental Preview Deprecated

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
Experimental Preview Deprecated

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.

--linked-service-name --name -n
Experimental Preview Deprecated

Name of the linkedServices resource. Supported values: cluster, automation.

--no-wait
Experimental Preview Deprecated

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--remove
Experimental Preview Deprecated

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

--resource-group -g
Experimental Preview Deprecated

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--resource-id
Experimental Preview Deprecated

The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require read access.

--set
Experimental Preview Deprecated

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

--subscription
Experimental Preview Deprecated

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

--tags
Experimental Preview Deprecated

Resource tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--workspace-name
Experimental Preview Deprecated

The name of the workspace.

--write-access-resource-id
Experimental Preview Deprecated

The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require write access.

Global Parameters
--debug
Experimental Preview Deprecated

Increase logging verbosity to show all debug logs.

--help -h
Experimental Preview Deprecated

Show this help message and exit.

--only-show-errors
Experimental Preview Deprecated

Only show errors, suppressing warnings.

--output -o
Experimental Preview Deprecated

Output format.

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

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

--subscription
Experimental Preview Deprecated

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

--verbose
Experimental Preview Deprecated

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

az monitor log-analytics workspace linked-service wait

Experimental Preview Deprecated

Place the CLI in a waiting state until a condition is met.

az monitor log-analytics workspace linked-service wait [--created]
                                                       [--custom]
                                                       [--deleted]
                                                       [--exists]
                                                       [--ids]
                                                       [--interval]
                                                       [--linked-service-name]
                                                       [--resource-group]
                                                       [--subscription]
                                                       [--timeout]
                                                       [--updated]
                                                       [--workspace-name]

Examples

Required Parameters

Optional Parameters

--created
Experimental Preview Deprecated

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom
Experimental Preview Deprecated

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted
Experimental Preview Deprecated

Wait until deleted.

Default value: False
--exists
Experimental Preview Deprecated

Wait until the resource exists.

Default value: False
--ids
Experimental Preview Deprecated

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.

--interval
Experimental Preview Deprecated

Polling interval in seconds.

Default value: 30
--linked-service-name --name -n
Experimental Preview Deprecated

Name of the linkedServices resource. Supported values: cluster, automation.

--resource-group -g
Experimental Preview Deprecated

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription
Experimental Preview Deprecated

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

--timeout
Experimental Preview Deprecated

Maximum wait in seconds.

Default value: 3600
--updated
Experimental Preview Deprecated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
--workspace-name
Experimental Preview Deprecated

The name of the workspace.

Global Parameters
--debug
Experimental Preview Deprecated

Increase logging verbosity to show all debug logs.

--help -h
Experimental Preview Deprecated

Show this help message and exit.

--only-show-errors
Experimental Preview Deprecated

Only show errors, suppressing warnings.

--output -o
Experimental Preview Deprecated

Output format.

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

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

--subscription
Experimental Preview Deprecated

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

--verbose
Experimental Preview Deprecated

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