I am trying to deploy a simple .NET 8 API to Azure App Service using the Github CICD which I setup from the App Service deployment center. After the initial setup, the Github Action ran successfully and in the overview I can see that the deployment was successful, however, when I go to the app url, I just see the generic placeholder page "Your web app is running and waiting for your content" and I cannot reach the swagger documentation and I cant hit any of my endpoints -- I just get 404 errors.
The VS sln where the Github Action is running has multiple projects in it -- DealSiren.Api (which is the startup project when I run locally) and DealSiren.Data. Im not sure if thats part of my problem or not.
Below is the yml file that was created for me by the deployment center. Any help would be greatly appreciated, as I am definitely still learning.
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy ASP.Net Core app to Azure Web App - dealsirenapi
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Build with dotnet
run: dotnet build --configuration Release
- name: dotnet publish
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: .net-app
path: ${{env.DOTNET_ROOT}}/myapp
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write #This is required for requesting the JWT
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: .net-app
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_AA86B360F580433FB1855BCA67768AF3 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_B93C0976BD0941DBB06D069F106A3F84 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_006899419B1341F38B0B4442D8FEFA5C }}
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: 'dealsirenapi'
slot-name: 'Production'
package: .