Microsoft Azure · Arazzo Workflow

Microsoft Azure Provision a Region-Specific Deployment

Version 1.0.0

Read a subscription, create a region-tagged resource group, deploy into it, and poll to completion.

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

provision-region-deployment
Confirm a subscription, create a region-tagged group, deploy, and poll to completion.
Validates the subscription, creates a region-tagged resource group, submits a deployment, and polls until terminal.
4 steps inputs: accessToken, apiVersion, deploymentName, location, parameters, resourceGroupName, subscriptionId, template outputs: deploymentId, finalProvisioningState, resourceGroupId
1
getSubscription
Subscriptions_Get
Get the subscription and branch: only provision when it reports Enabled, otherwise end the flow.
2
createResourceGroup
ResourceGroups_CreateOrUpdate
Create the resource group in the requested region and tag it with that region.
3
startDeployment
Deployments_CreateOrUpdate
Start an incremental template deployment into the region-tagged group.
4
pollDeployment
Deployments_Get
Poll the deployment, ending on Succeeded, ending on Failed or Canceled, and looping otherwise.

Source API Descriptions

Arazzo Workflow Specification

microsoft-azure-relocate-resource-group-deployment-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Microsoft Azure Provision a Region-Specific Deployment
  summary: Read a subscription, create a region-tagged resource group, deploy into it, and poll to completion.
  description: >-
    A region-aware provisioning flow that stitches the subscription, resource
    group, and deployment scopes together. The workflow gets the subscription to
    confirm it is Enabled, creates a resource group in the requested region with
    a region tag, starts a template deployment, and polls until the deployment
    reaches a terminal provisioning state, branching on success or failure. 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: provision-region-deployment
  summary: Confirm a subscription, create a region-tagged group, deploy, and poll to completion.
  description: >-
    Validates the subscription, creates a region-tagged resource group, submits
    a deployment, and polls until terminal.
  inputs:
    type: object
    required:
    - accessToken
    - subscriptionId
    - resourceGroupName
    - location
    - deploymentName
    - template
    properties:
      accessToken:
        type: string
        description: An Azure Resource Manager OAuth2 bearer access token.
      subscriptionId:
        type: string
        description: The ID of the target subscription.
      resourceGroupName:
        type: string
        description: The name of the resource group to create.
      location:
        type: string
        description: The Azure region for the resource group and its region tag (e.g. eastus).
      deploymentName:
        type: string
        description: The name of the deployment.
      template:
        type: object
        description: The inline ARM template content to deploy.
      parameters:
        type: object
        description: Name/value pairs that define the deployment parameters.
      apiVersion:
        type: string
        description: The Azure Resource Manager API version.
        default: '2024-03-01'
  steps:
  - stepId: getSubscription
    description: >-
      Get the subscription and branch: only provision when it reports Enabled,
      otherwise end the flow.
    operationId: Subscriptions_Get
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: subscriptionId
      in: path
      value: $inputs.subscriptionId
    - name: api-version
      in: query
      value: $inputs.apiVersion
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      state: $response.body#/state
    onSuccess:
    - name: subscriptionEnabled
      type: goto
      stepId: createResourceGroup
      criteria:
      - context: $response.body
        condition: $.state == "Enabled"
        type: jsonpath
    - name: subscriptionNotEnabled
      type: end
      criteria:
      - context: $response.body
        condition: $.state != "Enabled"
        type: jsonpath
  - stepId: createResourceGroup
    description: Create the resource group in the requested region and tag it with that region.
    operationId: ResourceGroups_CreateOrUpdate
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: subscriptionId
      in: path
      value: $inputs.subscriptionId
    - name: resourceGroupName
      in: path
      value: $inputs.resourceGroupName
    - name: api-version
      in: query
      value: $inputs.apiVersion
    requestBody:
      contentType: application/json
      payload:
        location: $inputs.location
        tags:
          region: $inputs.location
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      resourceGroupId: $response.body#/id
  - stepId: startDeployment
    description: Start an incremental template deployment into the region-tagged group.
    operationId: Deployments_CreateOrUpdate
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: subscriptionId
      in: path
      value: $inputs.subscriptionId
    - name: resourceGroupName
      in: path
      value: $inputs.resourceGroupName
    - name: deploymentName
      in: path
      value: $inputs.deploymentName
    - name: api-version
      in: query
      value: $inputs.apiVersion
    requestBody:
      contentType: application/json
      payload:
        properties:
          template: $inputs.template
          parameters: $inputs.parameters
          mode: Incremental
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      deploymentId: $response.body#/id
  - stepId: pollDeployment
    description: >-
      Poll the deployment, ending on Succeeded, ending on Failed or Canceled, and
      looping otherwise.
    operationId: Deployments_Get
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: subscriptionId
      in: path
      value: $inputs.subscriptionId
    - name: resourceGroupName
      in: path
      value: $inputs.resourceGroupName
    - name: deploymentName
      in: path
      value: $inputs.deploymentName
    - name: api-version
      in: query
      value: $inputs.apiVersion
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      provisioningState: $response.body#/properties/provisioningState
    onSuccess:
    - name: deploymentSucceeded
      type: end
      criteria:
      - context: $response.body
        condition: $.properties.provisioningState == "Succeeded"
        type: jsonpath
    - name: deploymentFailed
      type: end
      criteria:
      - context: $response.body
        condition: $.properties.provisioningState == "Failed" || $.properties.provisioningState == "Canceled"
        type: jsonpath
    - name: keepPolling
      type: goto
      stepId: pollDeployment
      criteria:
      - context: $response.body
        condition: $.properties.provisioningState != "Succeeded" && $.properties.provisioningState != "Failed" && $.properties.provisioningState != "Canceled"
        type: jsonpath
  outputs:
    resourceGroupId: $steps.createResourceGroup.outputs.resourceGroupId
    deploymentId: $steps.startDeployment.outputs.deploymentId
    finalProvisioningState: $steps.pollDeployment.outputs.provisioningState