An environment is a collection of resources that can be targeted by deployment jobs in a pipeline. By leveraging an environment to deploy the resources, Azure DevOps is able to keep a history of all of the deployments, and quickly access the commits related to a deployment.
This article describes how to use the ci_cd_ext_release
or tf_destroy_env
pipeline to create or delete a new cloud development or testing environment. The ci_cd_ext_release
pipeline uses the gridwich-cicd-variables.single_env variable group.
To create the Azure DevOps project, pipelines, and variable groups, see Gridwich Azure DevOps setup.
The following procedures use placeholder project name gridwich-clone
, app name cl1grw
, and environment name f233
. Replace these placeholders with your own values as appropriate.
-
In your organization's Azure DevOps
gridwich-clone
project, select Pipelines in the left navigation, and then select the ci_cd_ext_release pipeline. -
Select Run pipeline.
-
In the Run pipeline dialog, select the branch that you want to deploy to Azure, and then select Variables.
-
In the Variables dialog, select the environment variable.
-
In the Update variable dialog, enter a value with a four-character maximum length, and then select Update. The four-character limitation ensures that your full Gridwich Storage Account name won't exceed the 24-character maximum for Azure Storage Accounts.
-
Update the RUN_FLAG_SUBSCRIPTIONS_DISABLED variable to
true
if you want subscriptions to be skipped. -
Update the RUN_FLAG_SUBSCRIPTIONS_FAIL_GRACEFULLY to
true
if you want subscriptions to fail gracefully. -
In the Run pipeline dialog, select Run.
The pipeline steps deploy the application into Azure, but they don't set up any of the identity principals or their access rights to Azure resources. An admin must follow the instructions in Pipeline-generated admin scripts to complete the setup.
To verify that your environment is up and running, in the Azure portal, confirm that resource groups exist with your environment name.
You should now be able to reach the Event Grid Viewer endpoint and see the web app. Use the endpoint without the api/eventgrid
URI segment in a web browser to open a URL like: https://cl1grw-grw-wa-viewer-f233.azurewebsites.net
.
Follow Test MediaInfo to fully test the setup.
Gridwich deploys the following resources to Azure for an application named gridwich
and environment named sb
:
To delete an environment:
-
In the
gridwich-clone
project left navigation, select Pipelines, and then select and run the tf_destroy_env pipeline with the environment name you want to delete.Make sure to set the RUN_FLAG_SUBSCRIPTIONS_DISABLED variable to the same value used when creating the environment.
-
Under Pipelines > Environments, delete the environment.
-
In the Azure portal, go to the Azure Storage Account that stores your .tfstate, and delete the environment file, for example f233.tfstate. The Gridwich Storage Account is gridwichtfstate in the gridwich-terraform-rg resource group.
- Follow Test MediaInfo to fully test the setup.
Product documentation:
- Gridwich cloud media system
- What is Azure Blob storage?
- What is Azure DevOps?
- What is Azure Pipelines?
Microsoft Learn modules: