Host a Static Website on Azure Blob Storage, Written in HCL
A static website hosted on Azure Blob Storage, written in HCL
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set azure-hcl-static-websitecd pulumi-examples/azure-hcl-static-websiteA static website served from Azure Blob Storage’s static website support,
written in Pulumi HCL. Pulumi installs the HCL
language plugin and the Terraform azurerm and random providers automatically the first time you
run the program.
Deploying and running the program#
-
Create a new stack:
Terminal window pulumi stack init website-testing -
Configure your Azure credentials. The
azurermprovider reads the standardARM_*environment variables, and requiresARM_SUBSCRIPTION_IDto be set. -
(Optional) Set the Azure location to deploy into. It defaults to
westus:Terminal window pulumi config set azure-hcl-static-website:location westus2 -
Run
pulumi upto preview and deploy changes. After the preview is shown you will be prompted if you want to continue or not. -
Open the site URL in a browser to see the rendered HTML:
Terminal window pulumi stack output endpointhttps://site***.z22.web.core.windows.net/ -
To clean up resources, run
pulumi destroyand answer the confirmation question at the prompt.