From 645188f46e9477312cac31d4627d644fc25ec17f Mon Sep 17 00:00:00 2001 From: zaidriahi <80339736+zaidriahi@users.noreply.github.com> Date: Tue, 24 Sep 2024 13:08:16 +0100 Subject: [PATCH 1/4] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/master_webapp-portal-0.yml | 65 ++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/master_webapp-portal-0.yml diff --git a/.github/workflows/master_webapp-portal-0.yml b/.github/workflows/master_webapp-portal-0.yml new file mode 100644 index 000000000..2ad7dfc5e --- /dev/null +++ b/.github/workflows/master_webapp-portal-0.yml @@ -0,0 +1,65 @@ +# 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 - webapp-portal-0 + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '6.0.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: windows-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_21E9D68B7EA14E3DBD747BBD6121CFF6 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_6BF56C0E08914EB38C8141BD06BC0259 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_D157A8D74CEF4335BA33A0DBADF08161 }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'webapp-portal-0' + slot-name: 'Production' + package: . + \ No newline at end of file From 35ae1fefda7ada9cb034d08affb1b0fcbb264402 Mon Sep 17 00:00:00 2001 From: zaidriahi <80339736+zaidriahi@users.noreply.github.com> Date: Tue, 24 Sep 2024 14:40:25 +0100 Subject: [PATCH 2/4] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/master_webapp-portal-0.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/master_webapp-portal-0.yml b/.github/workflows/master_webapp-portal-0.yml index 2ad7dfc5e..b67c37066 100644 --- a/.github/workflows/master_webapp-portal-0.yml +++ b/.github/workflows/master_webapp-portal-0.yml @@ -51,9 +51,9 @@ jobs: - name: Login to Azure uses: azure/login@v2 with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_21E9D68B7EA14E3DBD747BBD6121CFF6 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_6BF56C0E08914EB38C8141BD06BC0259 }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_D157A8D74CEF4335BA33A0DBADF08161 }} + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_7D368B8C8A1B46E9814E125C080C1CD3 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_7622CEFA60AF41C49FFFCAC430201ADC }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_593BE1323F20481592151C10D777A8DE }} - name: Deploy to Azure Web App id: deploy-to-webapp From d728f386f17599e8996c76c9e54f76ac6232c6d7 Mon Sep 17 00:00:00 2001 From: zaidriahi <80339736+zaidriahi@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:56:24 +0100 Subject: [PATCH 3/4] Update master_webapp-portal-0.yml --- .github/workflows/master_webapp-portal-0.yml | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/master_webapp-portal-0.yml b/.github/workflows/master_webapp-portal-0.yml index b67c37066..26cc607b2 100644 --- a/.github/workflows/master_webapp-portal-0.yml +++ b/.github/workflows/master_webapp-portal-0.yml @@ -25,13 +25,13 @@ jobs: run: dotnet build --configuration Release - name: dotnet publish - run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp + 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 + path: ${{env.DOTNET_ROOT}}\myapp deploy: runs-on: windows-latest @@ -39,21 +39,21 @@ jobs: environment: name: 'Production' url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - permissions: - id-token: write #This is required for requesting the JWT + 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_7D368B8C8A1B46E9814E125C080C1CD3 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_7622CEFA60AF41C49FFFCAC430201ADC }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_593BE1323F20481592151C10D777A8DE }} + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_7D368B8C8A1B46E9814E125C080C1CD3 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_7622CEFA60AF41C49FFFCAC430201ADC }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_593BE1323F20481592151C10D777A8DE }} - name: Deploy to Azure Web App id: deploy-to-webapp @@ -62,4 +62,4 @@ jobs: app-name: 'webapp-portal-0' slot-name: 'Production' package: . - \ No newline at end of file + From be6568afa8517c035c478a4682d8718ab9029857 Mon Sep 17 00:00:00 2001 From: zaidriahi <80339736+zaidriahi@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:02:46 +0100 Subject: [PATCH 4/4] Update master_webapp-portal-0.yml --- .github/workflows/master_webapp-portal-0.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/master_webapp-portal-0.yml b/.github/workflows/master_webapp-portal-0.yml index 26cc607b2..ea64c03d1 100644 --- a/.github/workflows/master_webapp-portal-0.yml +++ b/.github/workflows/master_webapp-portal-0.yml @@ -25,7 +25,7 @@ jobs: run: dotnet build --configuration Release - name: dotnet publish - run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}\myapp + run: dotnet publish -c Release -o "C:\Program Files\dotnet\myapp - name: Upload artifact for deployment job uses: actions/upload-artifact@v4