Watch our introduction video to learn all about #TerraformOnAzure coding challenge!
In this first challenge, you will have to deploy our sample ASP.NET Core application to Azure App Service. You will have to provision all required Azure resources using HashiCorp's Terraform.
We will be running the web application in frontend-only mode. This means that you will be hosting the ASP.NET Core application without a database. As a result, only the home page will be operational. In the following coding challenges you will fix this. Check the paragraph on running the application in frontend-only mode below on how to achieve this.
There are multiple ways to deploy a web application to Azure App Service. In this coding challenge you will use the Azure CLI to configure the Azure App Service Deployment Center continuous deployment. This will configure the App Service to pull the sample application code from a GitHub repo.
Make sure to first fork the sample application to your GitHub account, after which you can then configure continuous deployment from GitHub on your App Service.
TIP: the GitHub deployment setting for an App Service cannot be configured through Terraform. You will need to use another automated way to configure this.
To successfully complete this challenge, you will
- Use the Terraform CLI to provision the Azure resources to host 1) an Azure SQL database, 2) a MongoDB database on Azure Container Instances.
- Use the Azure CLI to deploy the sample application from a GitHub repo, using Azure App Service Deployment Center Continuous Deployment (not using GitHub Actions at this time!).
Within 24 hours of making the coding challenge public, submit your solution as a custom ISSUE to this GitHub repository.
- Create your own Github repo with your solution for that challenge.
- Create a new Challenge Solution Submission issue in our repo for each challenge and fill all the details.
- Submit the issue.
- An Azure subscription, where you have permissions to create resource groups. You can get an Azure free account or send us a DM us on Twitter and we'll provide you with an Azure Pass.
- A GitHub account, allowing you to create a custom issue to submit your solution.
- Fork the sample application to your GitHub account.
There are different ways to get started with Terraform. The easiest is to use the Azure Cloud shell. Alternatively, you can install Terraform on your local machine.
To run the application in frontend mode, you need to configure a number of application settings. These need to be specified on the Azure App Service.
Setting | Value |
---|---|
WEBSITE_NODE_DEFAULT_VERSION | 10.15.2 |
ApiUrl | |
ApiUrlShoppingCart | |
MongoConnectionString | |
SqlConnectionString | |
productImagesUrl | https://raw.githubusercontent.com/microsoft/TailwindTraders-Backend/master/Deploy/tailwindtraders-images/product-detail |
Personalizer__ApiKey | |
Personalizer__Endpoint |
A simple App Service and Terraform script should do it for this challenge. Here's a tutorial on how to get started.
- ✅ Using Terraform with Azure documentation
- ✅ AzureRM provider App Service documentation
- ✅ Azure App Service documentation
- ✅ Continuous deployment on Azure App Service
- ✅ Web App deployment using the Azure CLI
If you have any questions about the challenges, feel free to open an ISSUE HERE.
Make sure to mention which challenge is problematic. We'll get back to you soon!
If you don't have an Azure subscription yet, you can DM us on Twitter and we'll provide you with a 30-day Azure subscription! Alternatively, you can also sign up for an Azure free account.