Share via


az resource link

Manage links between resources.

Linking is a feature of the Resource Manager. It enables declaring relationships between resources even if they do not reside in the same resource group. Linking has no impact on resource usage, billing, or role-based access. It allows for managing multiple resources across groups as a single unit.

Commands

Name Description Type Status
az resource link create

Create a new link between resources.

Core GA
az resource link delete

Delete a link between resources.

Core GA
az resource link list

List resource links.

Core GA
az resource link show

Gets a resource link with the specified ID.

Core GA
az resource link update

Update link between resources.

Core GA

Create a new link between resources.

az resource link create --link
                        --target
                        [--notes]

Create a link from {SourceID} to {ResourceID} with notes

az resource link create --link {SourceID} --target {ResourceID} --notes "SourceID depends on ResourceID"
--link

Fully-qualified resource ID of the resource link.

Format: /subscriptions/{SubID}/resourceGroups/{ResourceGroupID}/providers/{ProviderNamespace}/{ResourceType}/{ResourceName}/providers/Microsoft.Resources/links/{LinkName}.

--target

Fully-qualified resource ID of the resource link target.

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--notes

Notes for the link.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

Delete a link between resources.

az resource link delete --link

Delete link {LinkID}

az resource link delete --link {LinkID}
--link

Fully-qualified resource ID of the resource link.

Format: /subscriptions/{SubID}/resourceGroups/{ResourceGroupID}/providers/{ProviderNamespace}/{ResourceType}/{ResourceName}/providers/Microsoft.Resources/links/{LinkName}.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

List resource links.

az resource link list [--filter]
                      [--scope]

List links, filtering with {filter-string}

az resource link list --filter {filter-string}

List all links for resource group {ResourceGroup} in subscription {SubID}

az resource link list --scope /subscriptions/{SubID}/resourceGroups/{ResourceGroup}

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--filter

Filter string for limiting results.

--scope

Fully-qualified scope for retrieving links.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

Gets a resource link with the specified ID.

az resource link show --link
--link

Fully-qualified resource ID of the resource link.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

Update link between resources.

az resource link update --link
                        [--notes]
                        [--target]

Update the notes for {LinkID} notes "some notes to explain this link"

az resource link update --link {LinkID} --notes "some notes to explain this link"
--link

Fully-qualified resource ID of the resource link.

Format: /subscriptions/{SubID}/resourceGroups/{ResourceGroupID}/providers/{ProviderNamespace}/{ResourceType}/{ResourceName}/providers/Microsoft.Resources/links/{LinkName}.

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--notes

Notes for the link.

--target

Fully-qualified resource ID of the resource link target.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False