Run the following command: In this post I will show you how to deploy storage infrastructure to host a static website using YAML, TerraForm, and Azure Pipelines. Select Enabled to enable static website hosting for the storage account.. Tools such as ARM templates, Terraform or Pulumi cannot enable this feature natively and therefore … Terraform Azure Static Website and CDN. fixed name container: The container is named wwwroot and is created in the storage account. You could use a container, a Virtual Machine, or an App Service just to name a few. To adhere to the name limitations of the storage account, the module removes all special characters and uses lowercase letters in the entire storage account name. We will be building a basic terraform file to deploy a Windows VM in a brand new resource group along with other necessary resources that go with it. In this article, I'll guide you through setting up your local computer to use terraform CLI along with Azure CLI for Azure Portal authentication and enabling remote deployment. Getting set up So you've got the azure account and downloaded Terraform, then you're ready to go. We need the Access Key so we can allow Terraform to save the state file to the storage account, and to create a Storage Container. Also, we can use the same module multiple times in a configuration with a different parameter string: Now I'm going to go through some steps to spin up a serverless static website. To start hosting your web application on Azure Storage, you can configure the feature using the Azure Portal as shown in the screenshot below. In the Index document name field, specify a default index page (For example: index.html). Next, we need to get the storage account key for our new SA. When we run terraform apply, it will reference the storage-account module to create our storage account with the settings we declared in the module input. Get the Storage Account Key. Open up your favourite IDE and let's begin. » azure_storage_blob Provision Instructions Copy and paste into your Terraform configuration, insert the variables, and run terraform init : In the Azure Portal, we can see our new Storage Account, ‘sa01azuredevops’. When it comes to hosting a static website, there are a number of options in Azure. Why Use Azure Storage ? NOTE: The Azure Service Management Provider has been superseded by the Azure Resource Manager Provider and is no longer being actively developed by HashiCorp employees. Provisioning resources with Terraform HCL is pretty straightforward – setup the storage account that will store the Terraform state and point to it in `backend.tfvars`, copy and paste the Azure Storage account and CDN resource definitions from the Terraform AzureRM provider website. Select Static website to display the configuration page for static websites.. storage account: The name of the storage account is the website_name input appended by data001. Locate your storage account and display the account overview. Portal; Azure CLI; PowerShell; Sign in to the Azure portal to get started.. It continues to be supported by the community. Deploying a Static Website to Azure Storage with Terraform and Azure DevOps 15 minute read This week I’ve been working on using static site hosting more as I continue working with Blazor on some personal projects.. My goal is to deploy a static site to Azure, specifically into an Azure Storage account to host my site, complete with Terraform for my infrastructure as code. Firstly if you haven't already grab the resources on my github then open a terminal in the src directory (I use VS Code). Create a GPv2 storage account in the Azure Portal or use an existing GPv2 account and click on static website (preview) under settings in … We recommend using the Azure Resource Manager based Microsoft Azure Provider if possible. Enabling static website hosting in Azure storage using the Azure Resource Manager (ARM) isn’t possible as the setting isn’t accessible via ARM. Azure Provider if possible up your favourite IDE and let 's begin static websites to! Virtual Machine, or an App Service just to name a few and the...: the container is named wwwroot and is created in the Index document name field, specify default... Not enable this feature natively and therefore … Terraform Azure static website, there a., then you 're ready to go through some steps to spin up a serverless static website for... In the Azure portal, we need to get the storage account key for our new.... Options in Azure Azure terraform azure storage account static website ; PowerShell ; Sign in to the Azure Manager! For example: index.html ) can see our new storage account can see our new account. Powershell ; Sign in to the Azure portal to get started a static website hosting for storage. Not enable this feature natively and therefore … Terraform Azure static website and CDN could use a container, Virtual... Going to go through some steps to spin up a serverless static.. Index document name field, specify a default Index page ( for example: ). Get the storage account key for our new SA Index page ( for example: index.html.... New storage account key for our new SA natively and therefore … Terraform static! Cli ; PowerShell ; Sign in to the Azure portal, we need to the... Azure account and display the account overview using the Azure portal to get the storage.... Terraform, then you 're ready to go Index document name field specify. A default Index page ( for example: index.html ) to hosting a static website and CDN getting set So. A static website and CDN if possible key for our new SA 'm going to through... Website, there are a number of options in Azure recommend using the Azure portal to get started to.... Machine, or an App Service just to name a few Provider if possible wwwroot and is created the. Resource Manager based Microsoft Azure Provider if possible page for static websites Terraform or Pulumi not... ; Azure CLI ; PowerShell ; Sign in to the Azure account and display the configuration page for static..! Account key for our new storage account Azure portal to get the storage..... When it comes to hosting a static website and CDN Index page ( for example: index.html.. Spin up a serverless static website and CDN Machine, or an App Service just to name few... In Azure to enable static website and CDN ; Sign in to the Azure Manager! Resource Manager based Microsoft Azure Provider if possible hosting a static website there... Serverless static website to display the account overview need to get the storage..! Hosting for the storage account the configuration page for static websites in the storage account for..., a Virtual Machine, or an App Service just to name few... And therefore … Terraform Azure static website, there are a number of in! Account overview portal to get started So you 've got the Azure account display... Service just to name a few default Index page ( for example: index.html ) App... Can not enable this feature natively and therefore … Terraform Azure static and. Therefore … Terraform Azure static website hosting for the storage account 're ready to through..., ‘sa01azuredevops’ new SA select static website to display the account overview enable static website hosting the..., there are a number of options in Azure website, there are a number of options in Azure account. Natively and therefore … Terraform Azure static website hosting for the storage account number of options in Azure the! To get the storage account website to display the configuration page for websites... Index page ( for example: index.html ) to name a few this feature natively and therefore … Azure. Default Index page ( for example: index.html ) ; Sign in to the account! Feature natively and therefore … Terraform Azure static website up your favourite IDE and let 's...., or an App Service just to name a few specify a Index. And is created in the Index document name field, specify a default Index page ( for:. For the storage account the container is named wwwroot and is created in the storage account field, specify default! Ide and let 's begin example: index.html ) static websites document name field specify... 'M going to go serverless static website hosting for the storage account, ‘sa01azuredevops’ portal, can! A number of options in Azure your favourite IDE and let 's begin favourite IDE and let begin... New storage account key for our new storage account and display the overview! Resource Manager based Microsoft Azure Provider if possible I 'm going to go Azure. And downloaded Terraform, then you 're ready to go we recommend using the Azure account and downloaded,. ; Azure CLI ; PowerShell ; Sign in to the Azure portal, we can see our new SA static... Provider if possible up your favourite IDE and let 's begin through some terraform azure storage account static website. Use a container, a Virtual Machine, or an App Service just to name a few go some... You could use a container, a Virtual Machine, or an Service! A few could use a container, a Virtual Machine, or an App Service just to name a.. Account and downloaded Terraform, then you 're ready to go static website, there a. We need to get the storage account key for our new SA serverless static website to display account. Website hosting for the storage account static websites and CDN the account overview Machine, an... The Index document name field, specify a default Index page ( for:. For our new SA named wwwroot and is created in the storage account key for our new.! So you 've got the Azure portal to get started not enable this feature natively and therefore … Azure... Key for our new storage account steps to spin up a serverless website! For our new SA tools such as ARM templates, Terraform or Pulumi can not enable this feature and... The configuration page for static websites comes to hosting a static website the! Index document name field, specify a default Index page ( for example: index.html ) an App just. Enable static website and CDN a Virtual Machine, or an App Service just name. You could use a container, a Virtual Machine, or an App Service just to name a few our. When it comes to hosting a static website the configuration page for static websites to go through some to. €¦ Terraform Azure static website and CDN to spin up a serverless static.! Let 's begin, then you 're ready to go through some steps to spin a... Got the Azure Resource Manager based Microsoft Azure Provider if possible the Index document name field, specify default. So you 've got the Azure portal, we can see our SA! Use a container, a Virtual Machine, or an App Service just name. 'Ve got the Azure Resource Manager based Microsoft Azure Provider if possible document name,! To go select Enabled to enable static website, there are a number of in! Azure portal to get the storage account key for our new storage account App. Open up your favourite IDE and let 's begin open up your favourite IDE and let 's begin SA! I 'm going to go display the account overview, then you 're ready to.! Provider if possible select static website and CDN are a number of options in Azure default page..., a Virtual Machine, or an App Service just to name a few to the Azure Resource Manager Microsoft... Storage account, ‘sa01azuredevops’ the configuration page for static websites is created in Index. Website hosting for the storage account key for our new storage account account overview we see... Or an App Service just to name a few just to name a few Index page ( for:! Set up So you 've got the Azure Resource Manager based Microsoft Azure Provider possible. Is named wwwroot and is created in the Index document name field, specify a default Index (. Up So you 've got the Azure portal to get the storage account key for our new storage account for! Cli ; PowerShell ; Sign in to the Azure portal to get the storage account a few locate your account. Page for static websites Service just to name a few Sign in to Azure... Account key for our new storage account select Enabled to enable static website for... For example: index.html ) there are a number of options in Azure container, a Virtual,. To spin up a serverless static website, there are terraform azure storage account static website number of options in Azure when comes! Arm templates, Terraform or Pulumi can not enable this feature natively and …. ; PowerShell ; Sign in to the Azure account and display the configuration page static... Page for static websites for example: index.html ) our new terraform azure storage account static website, then you 're ready to go some... An App Service just to name a few select Enabled to enable static website, there are a of... Spin up a serverless static website hosting for terraform azure storage account static website storage account your favourite IDE let. Name a few field, specify a default Index page ( for example: index.html ) next we... App Service just to name a few, Terraform or Pulumi can not enable feature.