< Previous Challenge - Home - Next Challenge >
With the application updated, the shelter is ready to begin configuring deployment! They have elected to use Azure to host the application. The website will be hosted on Azure Container Apps, and the database on Azure Cosmos DB for MongoDB. The first step of the process will be creating and configuring the environment on Azure. In a later challenge you’ll configure continuous deployment for the project.
For this challenge, you will create a GitHub workflow which uses an Azure Bicep file to configure the necessary resources on Azure. You will create a resource group to house the Azure resources, configure a service identity to grant permissions to the Action, and run the Action to create the resources.
Configuration as Code (CaC), or config as code, is an approach to managing system configuration which involves defining configuration settings in machine-readable files or scripts. This allows for more efficient, automated, and consistent management of system configuration, as changes can be made and deployed more easily and with greater control. With config as code, configuration settings are stored in version-controlled files, often using a declarative syntax such as YAML, JSON, or HCL. These files can be stored alongside application code, making it easier to manage the entire software development life cycle.
This challenge uses Azure Bicep, which is a domain specific language for defining Azure infrastructure. A Bicep file has already been created for you to use and will be provided by your coach. The Bicep file will:
The Bicep file accepts one parameter named prefixName
, which is to be set to 5 random alphanumeric characters. This will ensure all resources created have a unique name.
As you go through the challenge, you will need to utilize the following pieces of information, and store them in the repository as appropriate:
Name | Description |
---|---|
location | Use westus for the location/region of the resource group |
prefixName |
5 characters alphanumeric characters you will create |
AZURE_CREDENTIALS | The credentials to use for managing Azure resources in the workflow |
AZURE_SUBSCRIPTION | The ID of your Azure subscription |
AZURE_RG | The name of the Azure resource group you create |
AZURE_PREFIX | The prefix you created earlier |
IMPORTANT: The default image configured in the Bicep file has the appropriate message configured. No code needs to be updated in the application. You will deploy the application in a later challenge.