capabilities.work

Deploy Then Tear Down a Resource Group

A 4-step recipe with Microsoft Azure. We can help you get access.

Recipe · 4 steps

Deploy Then Tear Down a Resource Group

with Microsoft Azure · IT Infrastructure Management

Stand up an ephemeral deployment then delete its resource group.

  1. Create the ephemeral resource group that will host the deployment.
  2. Start an incremental template deployment into the ephemeral group.
  3. Poll the deployment, branching to teardown on Succeeded and ending the flow (leaving the group in place) on Failed or Canceled.
  4. Delete the entire resource group to tear down the ephemeral environment.
What you'll need to have ready
  • accessToken: An Azure Resource Manager OAuth2 bearer access token.
  • subscriptionId: The ID of the target subscription.
  • resourceGroupName: The name of the ephemeral resource group.
  • location: The Azure region for the resource group (e.g. eastus).
  • deploymentName: The name of the deployment.
  • template: The inline ARM template content to deploy.
  • parameters: Name/value pairs that define the deployment parameters.
  • apiVersion: The Azure Resource Manager API version.
For your developer

Arazzo workflow microsoft-azure:deploy-then-teardown, 4 operations: ResourceGroups_CreateOrUpdate → putSubscriptionsBySubscriptionIdResourcegroupsByResourceGroupNameDeploymentsByDeploymentName → getSubscriptionsBySubscriptionIdResourcegroupsByResourceGroupNameDeploymentsByDeploymentName → ResourceGroups_Delete. Specs on APIs.io.