Skip to main content

directory_tenants

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

Overview

Namedirectory_tenants
TypeResource
Idazure_stack.subscriptions_admin.directory_tenants

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringURI of the resource.
namestringName of the resource.
locationstringLocation of the resource
propertiesobjectDirectory tenant.
tagsobjectList of key-value pairs.
typestringType of resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, tenantGet a directory tenant by name.
listselectsubscriptionId, resourceGroupNameLists all the directory tenants under the current subscription and given resource group name.
create_or_updateinsertsubscriptionId, resourceGroupName, tenantCreate or updates a directory tenant.
deletedeletesubscriptionId, resourceGroupName, tenantDelete a directory tenant under a resource group.

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
resourceGroupNamestringThe resource group the resource is located under.
subscriptionIdstringSubscription credentials which uniquely identify Microsoft Azure subscription.The subscription ID forms part of the URI for every service call.
tenantstringDirectory tenant name.

SELECT examples

Get a directory tenant by name.

SELECT
id,
name,
location,
properties,
tags,
type
FROM azure_stack.subscriptions_admin.directory_tenants
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND tenant = '{{ tenant }}' -- required
;

INSERT examples

Create or updates a directory tenant.

INSERT INTO azure_stack.subscriptions_admin.directory_tenants (
data__properties,
data__location,
subscriptionId,
resourceGroupName,
tenant
)
SELECT
'{{ properties }}',
'{{ location }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ tenant }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;

DELETE examples

Delete a directory tenant under a resource group.

DELETE FROM azure_stack.subscriptions_admin.directory_tenants
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND tenant = '{{ tenant }}' --required
;