Skip to main content

A component to deploy static websites to Azure

Project description


This component makes it easy to deploy a static website to Azure using any of the supported Pulumi programming languages.


import * as pulumi from "@pulumi/pulumi";
import * as website from "@pulumi/azure-static-website";

const site = new website.Website("site", {
    sitePath: "./site",

export const { originURL } = site;
name: my-website
runtime: yaml
description: A static website build with pulumi-azure-static-website.

    type: azure-static-website:index:Website
      sitePath: ./site

  originURL: ${site.originURL}

Input Properties

This component takes the following inputs.

  • sitePath (string) - the root directory containing the website's contents to be served (required)
  • withCDN (boolean) - provision a CDN to serve content
  • error404 (string) - the default 404 error page
  • index.html (string) - the default document for the site. Defaults to index.html
  • domainResourceGroup (string) - The name of the resource group your domain is attached to
  • dnsZoneName (string) - The name of the DNS zone that will be used to serve the static website. This must be set in order for this component to make the site accessible from a custom domain. See Azure docs for more info.
  • subdomain (string) - The subdomain used to access the static website. If not specified will configure with apex/root domain of the DNS zone specified


  • originURL - the Storage URL for the site
  • cdnURL - the CDN URL for the site
  • customDomainURL - the custom domain URL where the static website can be accessed
  • resourceGroupName - the name of the resource group that was provisioned to contain the needed static website resources


  • If you would like to serve your site from a custom domain, you need to configure a DNS zone in Azure and set the name of the zone using the dnsZoneName input property
  • If a subdomain is not specified, the contents will be served from the apex. Serving the website over HTTPS is something that will need to be manually configured, as Azure will sign free certs for the subdomains, but not for the root domain.
  • When destroying the site, you will need to manually delete the CNAME record that was provisioned for the domain (either using the console or CLI) in order for pulumi destroy to succeed.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulumi_azure_static_website-0.0.5.tar.gz (8.2 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page