Remove Azure App Service Hostnames using Terraform Expression
In this blog post, we’ll focus on a specific use case of Terraform with Azure - simplifying Azure hostnames. When you create an Azure App Service, Azure automatically assigns it a default hostname, typically in the format {app_service_name}.azurewebsites.net. While this is useful for quickly accessing your app, there might be instances where you want to use a simplified version of the hostname, without the azurewebsites.net part. Here’s how you can use it to remove azurewebsites.
How to write reusable module using Terraform
I had the pleasure of speaking at ComeCloudWithUS on the 18th of May, 2023. I had fun meeting Chris and Abdul, the event organisers. I presented a session about how to write reusable modules using Terraform with Thomas Thornton. What is a Terraform Module? A Terraform module is a set of Terraform configuration files in a single directory. When you run Terraform commands directly from such a directory, it is called the root module.
Deploy Azure Container Apps using Container Registry and Key Vault via Terraform
Introduction Azure Container Apps is a new service from Microsoft that allows you to deploy and manage containerised applications. With Azure Container Apps, you can quickly deploy your applications to the cloud without worrying about managing infrastructure or scaling your application. Terraform is an open-source tool that allows you to define and manage your infrastructure as code. By using Terraform to deploy your Azure Container Apps, you can automate the deployment process and ensure that your infrastructure is consistent across all environments.
Using Infrastructure as Code to Deploy Azure Workload using Terraform and Bicep
A few weeks ago, I was accepted to present for the Global Azure community event on Terraform and Bicep. I had been using Terraform for a while and wanted to learn Bicep while sharing it with everyone. In this blog post, I will share my experience with my first in-person presentation and the topic I presented on. The session I presented was Using Infrastructure as Code to Deploy Azure Workload using Terraform and Bicep by my Co-Speaker, Mark Allan, in the Microsoft Reactor office in London.
How to use Terraform Dynamic Blocks for creating App Service Auto Scaling resource
Dynamic Block in Terraform is a function that allows you to create multiple nested blocks. A typical use case for a Dynamic Block is using a for_each functionality within the block to reduce and remove duplicate resources in your terraform code. It is also easier to read and understand code written because it will have less repetitive code. Some of the Best Practices for dynamic Blocks are Overusing dynamic blocks can make it hard to read and maintain because it will involve overhead when trying to understand all the code.
Use AzApi provider to update Cosmos DB backup
I will show you how you can update Azure Cosmos DB backup using the new terraform AzApi provider. A few weeks ago, I tried to figure out an approach to how I can change the resource because HashiCorp does not support the ability to change the backup retention period using Terraform. However, I found out I could use the new AzApi provider for this method. According to Azure, AzApi Provider is a layer on top of the Azure REST API used to authenticate and manage Resources using the Azure Resource Manager directly.
Importing Azure Resource using Terrafy
This post will show how to import Azure Resources using Terrafy. When you are working with Infrastructure as Code (IaC) and do not know where to start except going on the Terraform or Azure Documentation, try to write terraform code. If you deployed resources using other methods like ARM Template, Bicep, Powershell/CLI, or manually, keeping track of those configuration states can be difficult. Azure Terrafy allows you to quickly import your existing Azure Resources into Terraform HCL and import them into the Terraform state file.
Deploy Azure Static Web Apps via Terraform
In this blog post, I will show you how to deploy Azure Static Web apps using terraform for your static web application. According to Microsoft, Static Web Apps allows you to develop web apps quickly and easily with a static front-end and backend. The static web apps provide free SSL certificates, customised domains to your app, and integration using Azure Functions. Setup Azure account Terraform installed Az CLI installed Once the AZ CLI install, run az login and authenticate to Azure.
Removing Lock State from terraform
In this blog post, I will show you how to remove the lock state error message on your terraform code. The other day I was running a pipeline code and got this error message saying the state file is locked like the one shown below. The solution I found is that you can go to your remote state in your blob storage if you are storing your state file remotely in Azure and click on Break lease.
Create Windows VM using Terraform
This tutorial will show how to create a Windows Virtual Machine (VM) using Terraform. This post will offer the best practice on deploying the resources using Infrastructure as Code. An Infrastructure as a code tool like Terraform makes deploying and destroying environments easier when integrated with Azure DevOps. What is Infrastructure as code? This method describes an Infrastructure as code such as Terraform, Bicep or ARM template is used to store in a source control repository.