resource_groups
Creates, updates, deletes, gets or lists a resource_groups
resource.
Overview
Name | resource_groups |
Type | Resource |
Id | azure.resources.resource_groups |
Fields
- vw_resource_groups
- resource_groups
Name | Datatype | Description |
---|---|---|
id | text | The ID of the resource group. |
name | text | The name of the resource group. |
location | text | The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations. |
managed_by | text | field from the properties object |
provisioning_state | text | field from the properties object |
resourceGroupName | text | field from the properties object |
subscriptionId | text | field from the properties object |
tags | text | The tags attached to the resource group. |
type | text | The type of the resource group. |
Name | Datatype | Description |
---|---|---|
id | string | The ID of the resource group. |
name | string | The name of the resource group. |
location | string | The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations. |
managedBy | string | The ID of the resource that manages this resource group. |
properties | object | The resource group properties. |
tags | object | The tags attached to the resource group. |
type | string | The type of the resource group. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | resourceGroupName, subscriptionId | Gets a resource group. |
list | SELECT | subscriptionId | Gets all the resource groups for a subscription. |
create_or_update | INSERT | resourceGroupName, subscriptionId, data__location | Creates or updates a resource group. |
delete | DELETE | resourceGroupName, subscriptionId | When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of its template deployments and currently stored operations. |
update | UPDATE | resourceGroupName, subscriptionId | Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is the same as that for creating a resource group. If a field is unspecified, the current value is retained. |
export_template | EXEC | resourceGroupName, subscriptionId | Captures the specified resource group as a template. |
SELECT
examples
Gets all the resource groups for a subscription.
- vw_resource_groups
- resource_groups
SELECT
id,
name,
location,
managed_by,
provisioning_state,
resourceGroupName,
subscriptionId,
tags,
type
FROM azure.resources.vw_resource_groups
WHERE subscriptionId = '{{ subscriptionId }}';
SELECT
id,
name,
location,
managedBy,
properties,
tags,
type
FROM azure.resources.resource_groups
WHERE subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new resource_groups
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.resources.resource_groups (
resourceGroupName,
subscriptionId,
data__location,
properties,
location,
managedBy,
tags
)
SELECT
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ data__location }}',
'{{ properties }}',
'{{ location }}',
'{{ managedBy }}',
'{{ tags }}'
;
- name: your_resource_model_name
props:
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: properties
value:
- name: provisioningState
value: string
- name: location
value: string
- name: managedBy
value: string
- name: tags
value: object
UPDATE
example
Updates a resource_groups
resource.
/*+ update */
UPDATE azure.resources.resource_groups
SET
name = '{{ name }}',
properties = '{{ properties }}',
managedBy = '{{ managedBy }}',
tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified resource_groups
resource.
/*+ delete */
DELETE FROM azure.resources.resource_groups
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';