Skip to main content

resources

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

Overview

Nameresources
TypeResource
Idazure.resources.resources

Fields

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
namestringThe name of the resource
identityobjectIdentity for the resource.
kindstringThe kind of the resource.
managedBystringID of the resource that manages this resource.
planobjectPlan for the resource.
propertiesobjectThe resource properties.
skuobjectThe resource model definition representing SKU
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Methods

NameAccessible byRequired ParamsDescription
getSELECTapi-version, parentResourcePath, resourceGroupName, resourceName, resourceProviderNamespace, resourceType, subscriptionIdGets a resource.
get_by_idSELECTapi-version, resourceIdGets a resource by ID.
listSELECTsubscriptionIdGet all the resources in a subscription.
list_by_resource_groupSELECTresourceGroupName, subscriptionIdGet all the resources for a resource group.
create_or_updateINSERTapi-version, parentResourcePath, resourceGroupName, resourceName, resourceProviderNamespace, resourceType, subscriptionIdCreates a resource.
create_or_update_by_idINSERTapi-version, resourceIdCreate a resource by ID.
deleteDELETEapi-version, parentResourcePath, resourceGroupName, resourceName, resourceProviderNamespace, resourceType, subscriptionIdDeletes a resource.
delete_by_idDELETEapi-version, resourceIdDeletes a resource by ID.
updateUPDATEapi-version, parentResourcePath, resourceGroupName, resourceName, resourceProviderNamespace, resourceType, subscriptionIdUpdates a resource.
move_resourcesEXECsourceResourceGroupName, subscriptionIdThe resources to be moved must be in the same source resource group in the source subscription being used. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes.
update_by_idEXECapi-version, resourceIdUpdates a resource by ID.
validate_move_resourcesEXECsourceResourceGroupName, subscriptionIdThis operation checks whether the specified resources can be moved to the target. The resources to be moved must be in the same source resource group in the source subscription being used. The target resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check the result of the long-running operation.

SELECT examples

Get all the resources in a subscription.

SELECT
id,
name,
identity,
kind,
managedBy,
plan,
properties,
sku,
type
FROM azure.resources.resources
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new resources resource.

/*+ create */
INSERT INTO azure.resources.resources (
api-version,
resourceId,
plan,
properties,
kind,
managedBy,
sku,
identity
)
SELECT
'{{ api-version }}',
'{{ resourceId }}',
'{{ plan }}',
'{{ properties }}',
'{{ kind }}',
'{{ managedBy }}',
'{{ sku }}',
'{{ identity }}'
;

UPDATE example

Updates a resources resource.

/*+ update */
UPDATE azure.resources.resources
SET
plan = '{{ plan }}',
properties = '{{ properties }}',
kind = '{{ kind }}',
managedBy = '{{ managedBy }}',
sku = '{{ sku }}',
identity = '{{ identity }}'
WHERE
api-version = '{{ api-version }}'
AND parentResourcePath = '{{ parentResourcePath }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND resourceName = '{{ resourceName }}'
AND resourceProviderNamespace = '{{ resourceProviderNamespace }}'
AND resourceType = '{{ resourceType }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified resources resource.

/*+ delete */
DELETE FROM azure.resources.resources
WHERE api-version = '{{ api-version }}'
AND resourceId = '{{ resourceId }}';