Microsoft Azure · Arazzo Workflow

Microsoft Azure Select Subscription and List Resource Groups

Version 1.0.0

List tenant subscriptions, get the first one's detail, then list its resource groups.

1 workflow 1 source API 1 provider
View Spec View on GitHub API ManagementCloudCloud ComputingEnterpriseInfrastructure as a ServicePlatform as a ServiceT1ArazzoWorkflows

Provider

microsoft-azure

Workflows

select-subscription-and-list-groups
Discover a subscription and enumerate its resource groups.
Lists subscriptions, reads the first, branches on its state, then lists the resource groups in that subscription.
3 steps inputs: accessToken, apiVersion outputs: resourceGroups, subscriptionId, subscriptionState
1
listSubscriptions
Subscriptions_List
List all subscriptions visible to the authenticated tenant.
2
getSubscription
Subscriptions_Get
Get the first subscription's detail and branch: continue only when its state is Enabled, otherwise end the flow.
3
listResourceGroups
ResourceGroups_List
List all resource groups inside the selected, enabled subscription.

Source API Descriptions

Arazzo Workflow Specification

microsoft-azure-select-subscription-and-list-resource-groups-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Microsoft Azure Select Subscription and List Resource Groups
  summary: List tenant subscriptions, get the first one's detail, then list its resource groups.
  description: >-
    A tenant-level bootstrap flow for tooling that does not yet know which
    subscription to operate against. The workflow lists every subscription the
    authenticated tenant can see, reads the first subscription to confirm it is
    Enabled, and then lists the resource groups inside it. It branches so that a
    disabled subscription ends the flow rather than continuing. Every step spells
    out its request inline so the flow can be read and executed without opening
    the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: azureResourceManager
  url: ../openapi/azure-resource-manager-openapi.yml
  type: openapi
workflows:
- workflowId: select-subscription-and-list-groups
  summary: Discover a subscription and enumerate its resource groups.
  description: >-
    Lists subscriptions, reads the first, branches on its state, then lists the
    resource groups in that subscription.
  inputs:
    type: object
    required:
    - accessToken
    properties:
      accessToken:
        type: string
        description: An Azure Resource Manager OAuth2 bearer access token.
      apiVersion:
        type: string
        description: The Azure Resource Manager API version.
        default: '2024-03-01'
  steps:
  - stepId: listSubscriptions
    description: List all subscriptions visible to the authenticated tenant.
    operationId: Subscriptions_List
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: api-version
      in: query
      value: $inputs.apiVersion
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      firstSubscriptionId: $response.body#/value/0/subscriptionId
      subscriptions: $response.body#/value
  - stepId: getSubscription
    description: >-
      Get the first subscription's detail and branch: continue only when its
      state is Enabled, otherwise end the flow.
    operationId: Subscriptions_Get
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: subscriptionId
      in: path
      value: $steps.listSubscriptions.outputs.firstSubscriptionId
    - name: api-version
      in: query
      value: $inputs.apiVersion
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      state: $response.body#/state
      displayName: $response.body#/displayName
    onSuccess:
    - name: subscriptionEnabled
      type: goto
      stepId: listResourceGroups
      criteria:
      - context: $response.body
        condition: $.state == "Enabled"
        type: jsonpath
    - name: subscriptionNotEnabled
      type: end
      criteria:
      - context: $response.body
        condition: $.state != "Enabled"
        type: jsonpath
  - stepId: listResourceGroups
    description: List all resource groups inside the selected, enabled subscription.
    operationId: ResourceGroups_List
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: subscriptionId
      in: path
      value: $steps.listSubscriptions.outputs.firstSubscriptionId
    - name: api-version
      in: query
      value: $inputs.apiVersion
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      resourceGroups: $response.body#/value
  outputs:
    subscriptionId: $steps.listSubscriptions.outputs.firstSubscriptionId
    subscriptionState: $steps.getSubscription.outputs.state
    resourceGroups: $steps.listResourceGroups.outputs.resourceGroups