Playground for testing ASP.NET Core GitHub Actions and Azure App Service deployments.
- Simple CI pipeline for pull requests.
- Branch protection rules for pushing to
main
(includes executing the CI pipeline). - Automated Azure Web App deployment, when pushing to the
Server
-directory ofmain
.
The Server
application was added to Azure with the Azure App Service: Create New Web App... (Advanced)
command of the Visual Code extension Azure Tools.
This command creates an Azure App Service-Plan with the required App Service (Web App).
The application can then be deployed with the Azure App Service: Deploy to Web App
command of the Azure Tools extension, or with a simple deployment workflow (see azure-webapps-dotnet-core.yml
). This requires you to create a repository secret called AZURE_WEBAPP_PUBLISH_PROFILE
(Settings -> Security -> Secrets and variables -> Actions -> New repository Secret).
Values entered in the "Secrets and variables"-section are not visible to anyone else. The required publish profile can be downloaded from the Azure portal directly in the corresponding app-service overview page (next to "Start", "Stop", "Refresh" and "Delete").
dotnet new webapi -o Server
dotnet new xunit -o Server.Tests
dotnet new sln
dotnet sln add ./Server/Server.csproj
dotnet sln add ./Server.Tests/Server.Tests.csproj
dotnet add ./Server.Tests/Server.Tests.csproj reference ./Server/Server.csproj