From 590c0f4a66758dc65a9245a549f0a983040e1cf3 Mon Sep 17 00:00:00 2001 From: Vishal-1836 <79714853+Vishal-1836@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:33:37 +0530 Subject: [PATCH 1/4] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/master_practicelab1.yml | 66 +++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/master_practicelab1.yml diff --git a/.github/workflows/master_practicelab1.yml b/.github/workflows/master_practicelab1.yml new file mode 100644 index 00000000..42fe50ac --- /dev/null +++ b/.github/workflows/master_practicelab1.yml @@ -0,0 +1,66 @@ +# 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 app to Azure Web App - practicelab1 + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup MSBuild path + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.5 + + - name: Restore NuGet packages + run: nuget restore + + - name: Publish to folder + run: msbuild /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="\published\" + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v3 + with: + name: ASP-app + path: '/published/**' + + 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@v3 + with: + name: ASP-app + + - name: Login to Azure + uses: azure/login@v1 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_DB1A28FA099340208663842BF1241E32 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_F6285D4AD6DE40899F312E7A6BD2BBDC }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_84F614C3F6DD4FFFAA32DB3F83344834 }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'practicelab1' + slot-name: 'Production' + package: . + \ No newline at end of file From 47891bc61e4af744d1fc897c68ca31e84c4fec82 Mon Sep 17 00:00:00 2001 From: Vishal-1836 <79714853+Vishal-1836@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:13:03 +0530 Subject: [PATCH 2/4] we love azure --- aspnet-get-started/Views/Home/Index.cshtml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/aspnet-get-started/Views/Home/Index.cshtml b/aspnet-get-started/Views/Home/Index.cshtml index 32e1dd94..a32937f9 100644 --- a/aspnet-get-started/Views/Home/Index.cshtml +++ b/aspnet-get-started/Views/Home/Index.cshtml @@ -3,9 +3,8 @@ }
-

ASP.NET

-

ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.

-

Learn more »

+

.NET 💜 Azure

+

Example .NET app to Azure App Service.

From 8256aa4d1e3c50a5f19ea7f66e8b6a32f60f1d5d Mon Sep 17 00:00:00 2001 From: Vishal-1836 <79714853+Vishal-1836@users.noreply.github.com> Date: Wed, 19 Jun 2024 13:51:27 +0530 Subject: [PATCH 3/4] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/master_webapppractice1.yml | 66 ++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/master_webapppractice1.yml diff --git a/.github/workflows/master_webapppractice1.yml b/.github/workflows/master_webapppractice1.yml new file mode 100644 index 00000000..5fa291eb --- /dev/null +++ b/.github/workflows/master_webapppractice1.yml @@ -0,0 +1,66 @@ +# 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 app to Azure Web App - webapppractice1 + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup MSBuild path + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.5 + + - name: Restore NuGet packages + run: nuget restore + + - name: Publish to folder + run: msbuild /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="\published\" + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v3 + with: + name: ASP-app + path: '/published/**' + + 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@v3 + with: + name: ASP-app + + - name: Login to Azure + uses: azure/login@v1 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_2AC5EA64AF5F40CEB58D1E612139ECC9 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_7E5B679C38CF4BC3AAE71A3C15A464B1 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_D93C9484968A4D51A63EE515ED82A463 }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'webapppractice1' + slot-name: 'Production' + package: . + \ No newline at end of file From e398380ef461560173802819dfa9b0ca3ffb53f1 Mon Sep 17 00:00:00 2001 From: Vishal-1836 <79714853+Vishal-1836@users.noreply.github.com> Date: Wed, 19 Jun 2024 13:54:40 +0530 Subject: [PATCH 4/4] Add or update the Azure App Service build and deployment workflow config --- .../workflows/master_web-apppractice11.yml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/master_web-apppractice11.yml diff --git a/.github/workflows/master_web-apppractice11.yml b/.github/workflows/master_web-apppractice11.yml new file mode 100644 index 00000000..f54ddfd0 --- /dev/null +++ b/.github/workflows/master_web-apppractice11.yml @@ -0,0 +1,66 @@ +# 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 app to Azure Web App - web-apppractice11 + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup MSBuild path + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.5 + + - name: Restore NuGet packages + run: nuget restore + + - name: Publish to folder + run: msbuild /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="\published\" + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v3 + with: + name: ASP-app + path: '/published/**' + + 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@v3 + with: + name: ASP-app + + - name: Login to Azure + uses: azure/login@v1 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_06B12E8695FB45089EF9E062E1C7163D }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_B23851F7F4394F25ACA1D22B4BA1031A }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_9B6BB5F3A7CD46E295E740113CCE9B44 }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'web-apppractice11' + slot-name: 'Production' + package: . + \ No newline at end of file