How to automate Azure Static Web App Deployment to avoid Snowflakes?

Siegfried Heintze 1,861 Reputation points
2023-10-25T03:14:18.42+00:00

As previously discussed (see https://learn.microsoft.com/en-us/answers/questions/1397184/how-to-automate-creation-of-azure-static-web-site), when an azure static web app has been deleted (perhaps accidentally deleted), it is necessary to

  1. Create the azure web app with bicep or powershell or azure cli
  2. fetch the deployment token from the newly created web app (how do I do this in a github workflow?)
  3. take that deployment token and update the github secret, (how do I do this in a script?)
  4. start the github workflow that runs all those npm commands compile and build and deploy the angular code (how do I do this from a script or github workflow?)

I tried enhancing the workflow yml script created by vscode plugin for azure static web apps so I could start the workflow using the github webpage without doing a git-push. I add this code to the workflow:

on:
  push:
    ...
  workflow_dispatch:
    branches:
    - main

Because I added "workflow_dispatch" I now see it displayed in the github action page.

Github Run worfklow button 2023-10-24 165145

When I click on the "run workflow" I try to manually start the execution of the workflow and click on the workflow run to observe the progress. However, I don't see any progress!

Screenshot 2023-10-24 200453

I just see this display and apparently it is not executing! Why is this? I was only able to start the workflow by doing a git push!

  1. Why is it necessary to modify the source code and push instead of just manually clicking on the workflow?
  2. So is this going to be an issue if I have another workflow call this workflow?

Thank you again for all your help so far!

Siegfried

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
815 questions
{count} votes