Skip to main content

resource_links

Creates, updates, deletes, gets or lists a resource_links resource.

Overview

Nameresource_links
TypeResource
Idazure.resource.resource_links

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe fully qualified ID of the resource link.
namestringThe name of the resource link.
notesstringNotes about the resource link.
sourceIdstringThe fully qualified ID of the source resource in the link.
targetIdstringThe fully qualified ID of the target resource in the link. Required.
typeobjectThe resource link object.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectlink_idGets a resource link with the specified ID.
list_at_subscriptionselectsubscription_id$filterGets all the linked resources for the subscription.
list_at_source_scopeselectscope$filterGets a list of resource links at and below the specified source scope.
create_or_updateinsertlink_idCreates or updates a resource link between the specified resources.
create_or_updatereplacelink_idCreates or updates a resource link between the specified resources.
deletedeletelink_idDeletes a resource link with the specified ID.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
scopestringThe fully qualified ID of the scope for getting the resource links. For example, to list resource links at and under a resource group, set the scope to /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup. Required.
subscription_idstring
$filterstringThe filter to apply when getting resource links. To get links only at the specified scope (not below the scope), use Filter.atScope(). Known values are "atScope()" and None. Default value is "atScope()".

SELECT examples

Gets a resource link with the specified ID.

SELECT
id,
name,
notes,
sourceId,
targetId,
type
FROM azure.resource.resource_links
WHERE link_id = '{{ link_id }}' -- required
;

INSERT examples

Creates or updates a resource link between the specified resources.

INSERT INTO azure.resource.resource_links (
properties,
link_id
)
SELECT
'{{ properties }}',
'{{ link_id }}'
RETURNING
id,
name,
properties,
type
;

REPLACE examples

Creates or updates a resource link between the specified resources.

REPLACE azure.resource.resource_links
SET
properties = '{{ properties }}'
WHERE
link_id = '{{ link_id }}' --required
RETURNING
id,
name,
properties,
type;

DELETE examples

Deletes a resource link with the specified ID.

DELETE FROM azure.resource.resource_links
WHERE link_id = '{{ link_id }}' --required
;