subscription_policy
Creates, updates, deletes, gets or lists a subscription_policy resource.
Overview
| Name | subscription_policy |
| Type | Resource |
| Id | azure.subscription.subscription_policy |
Fields
The following fields are returned by SELECT queries:
- list_policy_for_tenant
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
blockSubscriptionsIntoTenant | boolean | Blocks the entering of subscriptions into user's tenant. |
blockSubscriptionsLeavingTenant | boolean | Blocks the leaving of subscriptions from user's tenant. |
exemptedPrincipals | array | List of user objectIds that are exempted from the set subscription tenant policies for the user's tenant. |
policyId | string | Policy Id. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_policy_for_tenant | select | Get the subscription tenant policy for the user's tenant. | ||
get_policy_for_tenant | exec | Get the subscription tenant policy for the user's tenant. | ||
add_update_policy_for_tenant | exec | Create or Update Subscription tenant policy for user's tenant. |
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.
| Name | Datatype | Description |
|---|
SELECT examples
- list_policy_for_tenant
Get the subscription tenant policy for the user's tenant.
SELECT
id,
name,
blockSubscriptionsIntoTenant,
blockSubscriptionsLeavingTenant,
exemptedPrincipals,
policyId,
systemData,
type
FROM azure.subscription.subscription_policy
;
Lifecycle Methods
- get_policy_for_tenant
- add_update_policy_for_tenant
Get the subscription tenant policy for the user's tenant.
EXEC azure.subscription.subscription_policy.get_policy_for_tenant
;
Create or Update Subscription tenant policy for user's tenant.
EXEC azure.subscription.subscription_policy.add_update_policy_for_tenant
@@json=
'{
"blockSubscriptionsLeavingTenant": {{ blockSubscriptionsLeavingTenant }},
"blockSubscriptionsIntoTenant": {{ blockSubscriptionsIntoTenant }},
"exemptedPrincipals": "{{ exemptedPrincipals }}"
}'
;