iTranslated by AI
Easily Deploying .NET Apps to App Service from GitHub
Prerequisites
You should already have the .NET application you want to deploy in a GitHub repository.
Overview
When creating an App Service from the Azure Portal, you can select the option for continuous deployment from a GitHub repository.
In this guide, we will use that feature. By using this, basic GitHub Actions are created, enabling continuous deployment. You can also use this as a base and modify it to grow it into an Actions workflow that fits your specific project needs.
Creating an App Service

For the first part, specify your Subscription and Resource Group as usual, and provide a name for the App Service.
For the runtime stack, since I have a .NET 9 application prepared on GitHub, I have selected .NET 9.
The OS is Linux, and the region is Japan East.
You can make the usual selections here.

Choose an SKU that fits your budget.

This is the key part: enable continuous deployment.
Then, specify the repository where your code is hosted.
By doing this, a GitHub Actions workflow file will be automatically created.
Please configure the remaining items as you see fit.

Proceed to create with the settings above.

If you check the corresponding repository on GitHub, you will see that the workflow is running.

It appears the deployment was successful.

Looking at the workflow file, it seems it triggers on a push. Let's test it to confirm it works.

I will try to commit and push with this content.

Checking the Actions tab of the repository, it looks like the workflow is running correctly.

Finally, regarding the Blazor Web App (.NET 9) that I left open, because it was running in Server mode, the server restarts when a deployment occurs. As a result, the Blazor Server connection is temporarily interrupted. The app then reloads in its new state, so while any current work state is lost, you can start using the updated app with less than a second of downtime (at the template level).
Discussion