Skip to main content
selectMicrosoft Azurelast verified 2026-07-30
Servicesresource
CredentialsAZURE_TENANT_ID AZURE_CLIENT_ID AZURE_CLIENT_SECRET
PermissionsMicrosoft.Resources/subscriptions/resourceGroups/read
Fan-out: subscription - one call per subscription when swept tenant-wide. One list call per subscription when swept tenant-wide

Azure resource group lifecycle

Lists the resource groups in a subscription. The resource group is the container every other Azure resource belongs to and the unit of bulk deletion, so this is the entry point for both inventory and teardown.

Query​

SELECT name, location, provisioning_state, id, tags
FROM azure.resource.resource_groups
WHERE subscription_id = '{{subscription_id}}';

Creating a resource group​

Body properties are supplied as plain columns - location here - with no prefix on the column name:

INSERT INTO azure.resource.resource_groups(
resource_group_name,
subscription_id,
location
)
SELECT 'my-resource-group', '{{subscription_id}}', 'eastus';

Deleting a resource group​

Deletion is asynchronous and cascades to every resource inside the group:

DELETE FROM azure.resource.resource_groups
WHERE resource_group_name = 'my-resource-group'
AND subscription_id = '{{subscription_id}}';

Notes​

subscription_id is a required routing parameter on effectively every Azure resource, and resource_group_name narrows a list to a single group. Body properties are passed as plain columns: this provider applies a naive request-body transform, so location and properties are written directly with no data__ prefix - the data__location and data__properties form used by older Azure examples fails with InvalidResource. Deleting a group is asynchronous and returns immediately; the group reports provisioning_state Deleting for some minutes while its contents are removed, so poll the list query rather than assuming completion. A resource group's location is only metadata for the group itself - resources inside it may live in other regions, which is useful when one region has no capacity for a given SKU.

Related queries