{"id":28376897,"url":"https://github.com/epomatti/az-static-webapps","last_synced_at":"2026-05-06T18:37:25.363Z","repository":{"id":40313720,"uuid":"491209977","full_name":"epomatti/az-static-webapps","owner":"epomatti","description":"Azure Static Web Apps demonstration with Private Link","archived":false,"fork":false,"pushed_at":"2025-05-16T14:51:49.000Z","size":137,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-26T08:42:54.474Z","etag":null,"topics":["application-gateway","azure","pulumi","static-web-app","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/epomatti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-11T17:28:10.000Z","updated_at":"2025-05-16T14:51:53.000Z","dependencies_parsed_at":"2025-05-16T15:47:11.770Z","dependency_job_id":"957c5fa3-8bd4-4fb4-a92b-87e393fb93d2","html_url":"https://github.com/epomatti/az-static-webapps","commit_stats":null,"previous_names":["epomatti/az-static-webapps","epomatti/az-static-webapps-pulumi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/epomatti/az-static-webapps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-static-webapps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-static-webapps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-static-webapps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-static-webapps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/epomatti","download_url":"https://codeload.github.com/epomatti/az-static-webapps/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-static-webapps/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266624758,"owners_count":23958300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["application-gateway","azure","pulumi","static-web-app","terraform"],"created_at":"2025-05-30T00:33:47.166Z","updated_at":"2026-05-06T18:37:25.335Z","avatar_url":"https://github.com/epomatti.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pulumi Azure Native - Private Endpoints, Static Web App\n\nPrivate static web app accessible via Private Endpoints and blocked to the internet.\n\nSince it is not possible to use a [custom domain](https://stackoverflow.com/a/72241461/3231778) with private endpoints I deployed a private Application Gateway for the purpose of demonstration. This might not be optimal for a Static Web Site but get's the job done, but it would be prohibitive if you depend on Enterprise-Edge capabilities.\n\n![](.docs/staticwebapp.drawio2.svg?)\n\n## Terraform\n\n### Provisioning\n\nCreate the infrastructure:\n\n```sh\ncp config/local.auto.tfvars .auto.tfvars\nmkdir -p .keys \u0026\u0026 ssh-keygen -f .keys/tmp_rsa\nterraform init\nterraform apply -auto-approve\n```\n\n## Manual App Deployment\n\nhttps://learn.microsoft.com/en-us/azure/static-web-apps/static-web-apps-cli-deploy\n\n\n## Pulumi\n\n```sh\nnpm install\n\naz login\npulumi up -s dev -y\n```\n\n\n## Configuration\n\n### 1 - Create the infrastructure with Pulumi:\n\n\n\n#### 2 - Once the Static Web App is deployed, copy the deployment token `AZURE_STATIC_WEB_APPS_API_TOKEN` to GitHub as an Action secret. Triggering the pipeline will deploy the code to Azure.\n\n#### 3 - Site should be available via Private Endpoint - Use the Jumpbox VM for testing.\n\nThe Static Web Site will be available by it's public name, but routed internally by the Private DNS Zone. External access is blocked by the Azure Firewall.\n\n```sh\ncurl https://thankful-sand-084c7860f.1.azurestaticapps.net\n```\n\n\nFor a detailed explanation check [this](https://stackoverflow.com/a/69423659/3231778) answer.\n\n#### 4 - Application Gateway\n\n```sh\ncurl http://gateway.intranet.mycompany.com\ncurl https://gateway.intranet.mycompany.com -k\n```\n---\n\n####  Clean up\n\n```sh\npulumi destroy -s dev -y\n```\n\n## Certificates\n\nTo generate your own certificates:\n\n```sh\n# use intranet.mycompany.com for CN\nopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 3650 -nodes\n\nopenssl pkcs12 -export -out keyStore.p12 -inkey key.pem -in cert.pem\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepomatti%2Faz-static-webapps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepomatti%2Faz-static-webapps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepomatti%2Faz-static-webapps/lists"}