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.
Prerequisites#
- Install Pulumi
- Configure Azure credentials. The
azurermprovider reads the standardARM_*environment variables, and requiresARM_SUBSCRIPTION_IDto be set.
Deploying the example#
-
Create a new stack:
Terminal window pulumi stack init website-testing -
(Optional) Set the Azure location to deploy into. It defaults to
westus:Terminal window pulumi config set azure-hcl-static-website:location westus2 -
Deploy the stack:
Terminal window pulumi up -
Open the site URL in a browser to see the rendered HTML:
Terminal window pulumi stack output endpointhttps://site***.z22.web.core.windows.net/
Cleaning up#
Once you’re finished experimenting, you can destroy your stack and remove it to avoid incurring any additional cost:
pulumi destroypulumi stack rmRelated
TemplateAzure
Azure Static Website
Blog PostOct 2022