Azure static web apps have a built-in CI/CD integration with GitHub and provide a token that can be used with other services such as GitLab. In most cases this works well, but occasionally you might 1) want to deploy something that's hosted elsewhere or 2) want to deploy something manually, without creating a pipeline.

Generally, I would go the pipeline route but in one case I just wanted to push up a static site that was generated using DocFX. Unfortunately, there's not much information about how to do that.

There is a way to manually deploy a static web app with docker though. First, we'll need the token from the static web app.

To get this, navigate to the static web app within the portal and click "Manage deployment token" along the top action bar. Copy the token for use later.


Next, you'll want to pull and run the image and mount a volume to the location of your built site.

docker run -it -v <PATH\TO\LOCAL\BUILD\DIRECTORY>:/app /bin/bash

Once the container has been started, you'll be at the command prompt inside of it. Now we can run the command to publish to our static web app.

 /bin/staticsites/StaticSitesClient upload --app /app --apiToken <TOKEN>

That's all there is to it. Once the command completes, you should be able to navigate to the website and see your newly deployed code!