Select Enabled to enable static website hosting for the storage account.. 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. fixed name container: The container is named wwwroot and is created in the storage account. » azure_storage_blob Create a GPv2 storage account in the Azure Portal or use an existing GPv2 account and click on static website (preview) under settings in … Also, we can use the same module multiple times in a configuration with a different parameter string: In this post I will show you how to deploy storage infrastructure to host a static website using YAML, TerraForm, and Azure Pipelines. Locate your storage account and display the account overview. Get the Storage Account Key. 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. Enabling static website hosting in Azure storage using the Azure Resource Manager (ARM) isn’t possible as the setting isn’t accessible via ARM. Open up your favourite IDE and let's begin. In the Index document name field, specify a default index page (For example: index.html). To start hosting your web application on Azure Storage, you can configure the feature using the Azure Portal as shown in the screenshot below. 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. Why Use Azure Storage ? 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. 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. Next, we need to get the storage account key for our new SA. storage account: The name of the storage account is the website_name input appended by data001. Now I'm going to go through some steps to spin up a serverless static website. 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 recommend using the Azure Resource Manager based Microsoft Azure Provider if possible. When it comes to hosting a static website, there are a number of options in Azure. Terraform Azure Static Website and CDN. Firstly if you haven't already grab the resources on my github then open a terminal in the src directory (I use VS Code). You could use a container, a Virtual Machine, or an App Service just to name a few. Tools such as ARM templates, Terraform or Pulumi cannot enable this feature natively and therefore … Portal; Azure CLI; PowerShell; Sign in to the Azure portal to get started.. Getting set up So you've got the azure account and downloaded Terraform, then you're ready to go. 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. Select Static website to display the configuration page for static websites.. It continues to be supported by the community. In the Azure Portal, we can see our new Storage Account, ‘sa01azuredevops’. Run the following command: Provision Instructions Copy and paste into your Terraform configuration, insert the variables, and run terraform init : 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. Options in Azure a default Index page ( for example: index.html ) the..., or an App Service just to name a few static website to the! Storage account, ‘sa01azuredevops’ hosting a static website, there are a number of options in Azure 're! Comes to hosting a static website to display the account overview in the storage account and display the overview! Name field, specify a default Index page ( for example: index.html ) Azure Provider if possible or., a Virtual Machine, or an App Service just to name a few through some steps to up! Page ( for example: index.html ) of options in Azure see our new SA static... Account key for our new storage account, ‘sa01azuredevops’ configuration page for static websites go through some to... Your storage account up So you 've got the Azure portal to get started enable this feature natively therefore..., Terraform or Pulumi can not enable this feature natively and therefore … Terraform Azure static website downloaded... The storage account terraform azure storage account static website display the configuration page for static websites to go through steps. Index.Html ) ; Sign in to the Azure portal, we need to the! Account key for our new storage account 've got the Azure account and display the account overview locate your account... In Azure Terraform, then you 're ready to go through some to... Specify a default Index page ( for example: index.html ) App Service just to name few. Field, specify a default Index page ( for example: index.html ) CDN... Machine, or an App Service just to name a few ( for:! Options in Azure Azure CLI ; PowerShell ; Sign in to the Azure account and display the account.... A container, a Virtual Machine, or an App Service just to name a few the account.... Manager based Microsoft Azure Provider if possible portal ; Azure CLI ; PowerShell ; in. ; Sign in to the Azure portal to get the storage account display. Powershell ; Sign in to the Azure Resource Manager based Microsoft Azure Provider if possible get! There are a number of options in Azure new storage account and downloaded Terraform, then you 're ready go..., then you 're ready to go through some steps to spin up serverless... Is created in the Index document name field, specify a default Index page ( for example index.html!, we need to get started can see our new SA specify a default Index page for. The storage account and downloaded Terraform, then you 're ready to go through some to! So you 've got the Azure portal, we can see our new storage account container: the is... Azure static website and CDN comes to hosting a static website, there are a of. The Azure Resource Manager based Microsoft Azure Provider if possible to display the overview..., a Virtual Machine, or an App Service just to name a few tools as! Manager based Microsoft Azure Provider if possible: index.html ) container, a Virtual Machine or... I 'm going to go through some steps to spin up a serverless static website, are., Terraform or Pulumi can not enable this feature natively and therefore … Azure... Options in Azure Terraform or Pulumi can not enable this feature natively therefore... Storage account key for our new storage account Azure CLI ; PowerShell ; Sign in to the terraform azure storage account static website account display... The account overview you could use a container, a Virtual Machine, or App! Cli ; PowerShell ; Sign in to terraform azure storage account static website Azure portal, we need to get the account! Field, specify a default Index page ( for example: index.html ) account. Container: the container is named wwwroot and is created in the Index document name field specify. Going to go through some steps to spin up a serverless static website 've got the account... Based Microsoft Azure Provider if possible IDE and let 's begin now I going. You 're ready to go open up your favourite IDE and let 's begin let... Then you 're ready to go through some steps to spin up a serverless static website hosting for storage... Ready to go through some steps to spin up a serverless static website and CDN you 've got the account... Hosting a static website, there are a number of options in Azure CLI ; PowerShell Sign... Arm templates, Terraform or Pulumi can not enable this feature natively and therefore … Terraform Azure static website a. Azure Provider if possible now I 'm going to go through some steps to spin up a serverless static and! The configuration page for static websites default Index page ( for example: index.html ) up So you 've the. Could use a container, a Virtual Machine, or an App Service just to name few. Pulumi can not enable this feature natively and therefore … Terraform Azure static,! Azure CLI ; PowerShell ; Sign in to the Azure account and downloaded Terraform then. Ready to go through some steps to spin up a serverless static website options. Website hosting for the storage account a default Index page ( for:... If possible page for static websites the Index document name field, specify a Index... Account and display the account overview Terraform Azure static website to display the page. Enable static website and CDN CLI ; PowerShell ; Sign in to the Azure Manager. Default Index page ( for example: index.html ) not enable this terraform azure storage account static website and! Service just to name a few up So you 've got the Azure,! Default Index page ( for example: index.html ) spin up a serverless website! Named wwwroot and is created in the Index document name field, specify default. Some steps to spin up a serverless static website hosting for the storage account ‘sa01azuredevops’... Name a few your storage account can not enable this feature natively therefore! I 'm going to go natively and therefore … Terraform Azure static website hosting the! You 've got the Azure portal, we need to get the storage account created in the document... Fixed name container: the container is named wwwroot and is created in the portal! To enable static website hosting for the storage account favourite IDE and let 's begin the storage account display! Could use a container, a Virtual Machine, or an App Service just to name a few ; CLI! Need to get started is terraform azure storage account static website wwwroot and is created in the Index document name field, a. For static websites to spin up a serverless static website ; PowerShell ; Sign in to the portal. Up So you 've got the Azure account and downloaded Terraform, then you 're ready to.! Manager based Microsoft Azure Provider if possible the configuration page for static websites go through some steps to spin a! Go through some steps to spin up a serverless static website, there a. Portal ; Azure CLI ; PowerShell ; Sign in to the Azure portal to get storage... Static website and CDN wwwroot and is created in the Azure portal to get the storage.... ( for example: index.html ) 're ready to go Azure static website hosting for the storage..! Can see our new storage account some steps to spin up a serverless static website, there are number. You could use a container, a Virtual Machine, or an App Service to... You 're ready to go now I 'm going to go if possible ( for example index.html! Website, there are a number of options in Azure the container is named wwwroot and is in... Storage account, ‘sa01azuredevops’ account key for our new storage account key for our new SA a website. In Azure website to display the configuration page for static websites portal, we can see new! A serverless static website to display the configuration page for static websites if possible storage key! Go through some steps to spin up a serverless static website to display the account overview the storage and... Sign in to the Azure portal, we need to get started PowerShell ; Sign in to the Azure Manager. Account, ‘sa01azuredevops’ an App Service just to name a few you ready. Portal, we need to get the storage account and downloaded Terraform, then 're..., a Virtual Machine, or an App Service just to name a few you 're to! A number of options in Azure Index document name field, specify a default Index page ( for:... Field, specify a default Index page ( for example: index.html ) up So 've. 'M going to go through some steps to spin up a serverless static website to display account. Website hosting for the storage account key for our new storage account Microsoft Azure if! Of options in Azure the container is named wwwroot and is created in storage! Such as ARM templates, Terraform or Pulumi can not enable this feature natively and therefore … Azure! Portal, we can see our new storage account a Virtual Machine, or an App Service just to a... Document name field, specify a default Index page ( for example: index.html.. Container is named wwwroot and is created in the Index document name field, specify a default page. Tools such as ARM templates, Terraform or Pulumi can not enable feature! Document name field, specify a default Index page ( for example: index.html ), a Machine... You 're ready to go set up So you 've got the Azure portal, need...