{"id":16179243,"url":"https://github.com/jonashackt/azure-training-pulumi","last_synced_at":"2026-01-11T23:00:49.260Z","repository":{"id":41886683,"uuid":"331431124","full_name":"jonashackt/azure-training-pulumi","owner":"jonashackt","description":"azuredevcollege/trainingdays scm breakout app infrastructure with Pulumi","archived":false,"fork":false,"pushed_at":"2023-12-21T02:04:27.000Z","size":1673,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T11:30:38.612Z","etag":null,"topics":["azure","github-actions","pulumi","pulumi-azure"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jonashackt.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}},"created_at":"2021-01-20T21:01:15.000Z","updated_at":"2024-07-06T06:45:03.000Z","dependencies_parsed_at":"2022-08-11T20:10:53.562Z","dependency_job_id":"2ac007fa-82e3-443c-aa40-e01d2fa6be0a","html_url":"https://github.com/jonashackt/azure-training-pulumi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonashackt/azure-training-pulumi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fazure-training-pulumi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fazure-training-pulumi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fazure-training-pulumi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fazure-training-pulumi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonashackt","download_url":"https://codeload.github.com/jonashackt/azure-training-pulumi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fazure-training-pulumi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28326166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T22:11:01.104Z","status":"ssl_error","status_checked_at":"2026-01-11T22:10:58.990Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["azure","github-actions","pulumi","pulumi-azure"],"created_at":"2024-10-10T05:26:16.751Z","updated_at":"2026-01-11T23:00:49.219Z","avatar_url":"https://github.com/jonashackt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# azure-training-pulumi\n[![Build Status](https://github.com/jonashackt/azure-training-pulumi/workflows/pulumi-preview-up/badge.svg)](https://github.com/jonashackt/azure-training-pulumi/actions)\n[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/jonashackt/azure-training-pulumi/blob/master/LICENSE)\n[![renovateenabled](https://img.shields.io/badge/renovate-enabled-yellow)](https://renovatebot.com)\n\nazuredevcollege/trainingdays scm breakout app infrastructure with Pulumi\n\n\nI wanted to do a quick setup with Pulumi in order to see how fast I would be in contrast to use ARM templates in this session: https://github.com/azuredevcollege/trainingdays/blob/master/day2/challenges/challenge-bo-3.md\n\nUntil now I invested around 1h for this...\n\n[![asciicast](https://asciinema.org/a/385869.svg)](https://asciinema.org/a/385869)\n\n## SCM Breakout App infrastructure with Pulumi\n\nhttps://www.pulumi.com/docs/get-started/azure/\n```shell\nmkdir scmbreakoutpulumi  \u0026\u0026 cd scmbreakoutpulumi\npulumi new azure-typescript\n```\n\n#### Storage Account\n\nhttps://www.pulumi.com/docs/reference/pkg/azure/storage/\n\nhttps://www.pulumi.com/docs/reference/pkg/azure/storage/account/\n\n###### Container\n\nhttps://www.pulumi.com/docs/reference/pkg/azure/storage/container/\n\n###### Queues\n\nhttps://www.pulumi.com/docs/reference/pkg/azure/storage/queue/\n\n#### App Service\n\nhttps://www.pulumi.com/docs/reference/pkg/azure/appservice/appservice/\n\n###### Slots\n\nhttps://www.pulumi.com/docs/reference/pkg/azure/appservice/slot/\n\n\n#### FunctionApp\n\nWe don't have a Function in the setup, we have\n\nhttps://github.com/pulumi/examples/blob/master/azure-ts-functions-raw/index.ts\n\nThe setup uses a `azure.appservice.FunctionApp` !\n\nhttps://www.pulumi.com/docs/reference/pkg/azure/appservice/functionapp/\n\n\n## Architecture of the app\n\nSee https://github.com/azuredevcollege/trainingdays/blob/master/day2/challenges/challenge-bo-3.md (all kudos go there!)\n\n![architecture_day2](screenshots/architecture_day2.png)\n\nHave a look into the Azure Portal\n\n![azure-resource-group](screenshots/azure-resource-group.png)\n\n\n## Pulumi with GitHub Actions\n\nhttps://www.pulumi.com/docs/guides/continuous-delivery/github-actions/\n\nIt's really cool to see that there's a Pulumi GitHub action project https://github.com/pulumi/actions already ready for us.\n\n#### Create needed GitHub Repository Secrets\n\nFirst we need to create 5 new GitHub Repository Secrets (encrypted variables) in your repo under `Settings/Secrets`.\n\nWe should start to create a new Pulumi Access Token `PULUMI_ACCESS_TOKEN` at https://app.pulumi.com/jonashackt/settings/tokens\n\nNow we need to create the Azure specific variables (see the docs https://github.com/pulumi/actions#microsoft-azure).\n\nFor the `ARM_SUBSCRIPTION_ID` run a `az account show` (after you logged your CLI into your Azure subscription via `azure login`) and use the value of `\"id\":`.\n\nFor the other 3 variables we need to create a new Azure Service Principal (https://www.pulumi.com/docs/intro/cloud-providers/azure/setup/#creating-a-service-principal), which [is the recommended way](https://www.pulumi.com/docs/intro/cloud-providers/azure/setup/#service-principal-authentication):\n\n\u003e Using a Service Principal is the recommended way to connect Pulumi to Azure in a team or CI setting.\n\nTo create a Service Principal with Azure CLI [the docs tell us](https://docs.microsoft.com/de-de/cli/azure/create-an-azure-service-principal-azure-cli) to: \n\n```shell\naz ad sp create-for-rbac --name servicePrincipalGitHubActions\n```\n\nNow from the output choose the `appId` as the `ARM_CLIENT_ID`, the `password` as the `ARM_CLIENT_SECRET` and the `tenant` as the `ARM_TENANT_ID`. Create them all as GitHub Repository Secrets.\n\nFinally there should be all these vars defined:\n\n![github-actions-pulumi-secrets](screenshots/github-actions-pulumi-secrets.png)\n\n\n#### Create GitHub Actions workflow\n\nLet's create a GitHub Actions workflow [preview-and-up.yml](.github/workflows/preview-and-up.yml):\n\n```yaml\nname: pulumi-preview-up\n\non: [push]\n\nenv:\n  ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}\n  ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}\n  ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}\n  ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}\n  PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}\n\njobs:\n  preview-up-destroy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n\n      - name: In order to use the Pulumi v2+ action, we need to setup the Pulumi project specific language environment\n        uses: actions/setup-node@v2\n        with:\n          node-version: '14'\n\n      - name: After setting up the Pulumi project specific language environment, we need to install the dependencies also (see https://github.com/pulumi/actions#example-workflows)\n        run: npm install\n\n      - name: Install Pulumi CLI so that we can create a GHA pipeline specific Pulumi Stack\n        uses: pulumi/action-install-pulumi-cli@v1.0.2\n\n      - name: Create GHA pipeline specific Pulumi Stack incl. Azure location\n        run: |\n          pulumi stack init github-${{ github.run_id }}\n          pulumi config set azure:location WestEurope\n\n      - name: Preview pulumi up\n        uses: pulumi/actions@v3\n        with:\n          command: preview\n          stack-name: github-${{ github.run_id }}\n\n      - name: Actually run pulumi up\n        uses: pulumi/actions@v3\n        with:\n          command: up\n          stack-name: github-${{ github.run_id }}\n\n      - name: Destroy resources via pulumi destroy\n        uses: pulumi/actions@v3\n        with:\n          command: destroy\n          stack-name: github-${{ github.run_id }}\n\n      - name: Remove the GHA pipeline specific Pulumi Stack\n        run: |\n          pulumi stack rm github-${{ github.run_id }} -y\n```\n\nWe use the possibility [to define the environment variables on the workflow's top level](https://docs.github.com/en/actions/reference/environment-variables) to reduce the 3 definition to one. Also we define a `stack-name` containing the `GITHUB_RUN_ID` which is one of [the default GHA environment variables](https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables) which is defined as:\n\n\u003e A unique number for each run within a repository. This number does not change if you re-run the workflow run.\n\nWith this we prevent [Action workflows getting in each other's way like this](https://github.com/jonashackt/azure-training-pulumi/runs/1977168868?check_suite_focus=true):\n\n```shell\nUpdating (dev)\n\nerror: [409] Conflict: Another update is currently in progress.\nTo learn more about possible reasons and resolution, visit https://www.pulumi.com/docs/troubleshooting/#conflict\n\n```\n\nSee this https://stackoverflow.com/questions/66563656/pulumi-with-github-actions-crashing-parallel-workflows-with-error-409-conflic/66563657#66563657\n\nUsing this simply workflow, the first `preview` job needs to finish successfully before the `up` job starts:\n\n![github-actions-preview-triggers-up](screenshots/github-actions-preview-triggers-up.png)\n\nAnd we finally destroy our stack also, so that we don't procude to much costs :)\n\nDon't forget to craft a nice GitHub Actions badge!\n\n```\n[![Build Status](https://github.com/jonashackt/azure-training-pulumi/workflows/pulumi-preview-up/badge.svg)](https://github.com/jonashackt/azure-training-pulumi/actions)\n```\n\nOptionally you can also install the Pulumi GitHub App so see more insights integrated in the commit history:\n\nhttps://www.pulumi.com/docs/guides/continuous-delivery/github-app/\n\n![github-actions-pulumi-app](screenshots/github-actions-pulumi-app.png)\n\n\n\n## TODO\n\n* Application Insights?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonashackt%2Fazure-training-pulumi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonashackt%2Fazure-training-pulumi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonashackt%2Fazure-training-pulumi/lists"}