subscriptions#

State module for managing Subscription.

async idem_azure.states.azure.subscription.subscriptions.present(hub, ctx, name: str, alias: str, billing_scope: str, display_name: str, workload: str, tags: Dict = None, resource_id: str = None) Dict[source]#

Create or update Subscription.

Parameters:
  • name (str) – The identifier for this state.

  • alias (str) – The alias name of the subscription to create or update. Can include alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.Regex pattern: ^[-w._()]+$.

  • billing_scope (str) – billing scope associated with billing account id and enrollment account id to create subscription

  • display_name (str) – subscription display name

  • workload (str) – type of workload where subscription needs to be created. Can be Production/DevTest

  • tags (dict, Optional) – Resource tags.

  • resource_id (str, Optional) – resource unique id

Returns:

Dict

Examples

resource_present:
  azure.subscription.subscriptions.present:
    - name: create_subscription_3
    - alias: dupSubTest
    - billing_scope: /providers/Microsoft.Billing/billingAccounts/{billingAccountID}/enrollmentAccounts/{enrollmentAccountId}}
    - display_name: Subscription Display Name
    - workload: Production
async idem_azure.states.azure.subscription.subscriptions.absent(hub, ctx, name: str, alias: str) Dict[source]#

Delete Subscription. This state disables the subscription and deletes respective alias.

Once subscription is in disabled state, after 90 days it gets deleted automatically.

Parameters:
  • name (str) – The identifier for this state.

  • alias (str) – The alias name of the subscription to delete.

Returns:

Dict

Examples

subscription_is_absent:
  azure.subscription.subscriptions.absent:
    - name: value
    - alias: value
async idem_azure.states.azure.subscription.subscriptions.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describe subscriptions in a way that can be recreated/managed with the corresponding “present” function.

Lists all subscriptions.

Returns:

Dict[str, Any]

Examples

$ idem describe azure.subscription.subscriptions