From 24c38efe08ca4a945d7afe74811a7a95984ab781 Mon Sep 17 00:00:00 2001 From: "github_cloudlabsuser_2120@cloudlabsaiuser.com" Date: Wed, 19 Jun 2024 06:12:10 +0000 Subject: [PATCH 1/3] my commit --- CRUD application 2.csproj | 10 +++---- Web.config | 2 +- deploy.json | 61 +++++++++++++++++++++++++++++++++++++++ deploy.parameters.json | 15 ++++++++++ 4 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 deploy.json create mode 100644 deploy.parameters.json diff --git a/CRUD application 2.csproj b/CRUD application 2.csproj index 553546be..53b84bec 100644 --- a/CRUD application 2.csproj +++ b/CRUD application 2.csproj @@ -45,6 +45,9 @@ 4 + + packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + @@ -111,11 +114,6 @@ packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll - - - packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll - - @@ -222,4 +220,4 @@ --> - + \ No newline at end of file diff --git a/Web.config b/Web.config index d246aab1..8ce4f449 100644 --- a/Web.config +++ b/Web.config @@ -30,7 +30,7 @@ - + diff --git a/deploy.json b/deploy.json new file mode 100644 index 00000000..f6c5a3a6 --- /dev/null +++ b/deploy.json @@ -0,0 +1,61 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "webAppName": { + "type": "string", + "metadata": { + "description": "" + } + }, + "hostingPlanName": { + "type": "string", + "metadata": { + "description": "" + } + }, + "sku": { + "type": "string", + "defaultValue": "F1", + "metadata": { + "description": "" + } + } + }, + "variables": { + "location": "[resourceGroup().location]" + }, + "resources": [ + { + "type": "Microsoft.Web/serverfarms", + "apiVersion": "2020-06-01", + "name": "[parameters('hostingPlanName')]", + "location": "[variables('location')]", + "sku": { + "name": "[parameters('sku')]" + }, + "properties": { + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "type": "Microsoft.Web/sites", + "apiVersion": "2020-06-01", + "name": "[parameters('webAppName')]", + "location": "[variables('location')]", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]" + ], + "properties": { + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]" + } + } + ], + "outputs": { + "webAppUrl": { + "type": "string", + "value": "[concat('https://', parameters('webAppName'), '.azurewebsites.net')]" + } + } +} \ No newline at end of file diff --git a/deploy.parameters.json b/deploy.parameters.json new file mode 100644 index 00000000..eabb403b --- /dev/null +++ b/deploy.parameters.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "webAppName": { + "value": "ShubhamSamrat" + }, + "hostingPlanName": { + "value": "Basic" + }, + "sku": { + "value": "F1" + } + } +} \ No newline at end of file From 0da9b95d8d6267387d0bd4d339f1c684467683f2 Mon Sep 17 00:00:00 2001 From: "github_cloudlabsuser_2120@cloudlabsaiuser.com" Date: Wed, 19 Jun 2024 06:17:55 +0000 Subject: [PATCH 2/3] my commit --- deploy.parameters.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy.parameters.json b/deploy.parameters.json index eabb403b..20936de6 100644 --- a/deploy.parameters.json +++ b/deploy.parameters.json @@ -3,7 +3,7 @@ "contentVersion": "1.0.0.0", "parameters": { "webAppName": { - "value": "ShubhamSamrat" + "value": "SanaApp" }, "hostingPlanName": { "value": "Basic" From bc9ae71fac33e7afc3a29ad8d97811b792b05254 Mon Sep 17 00:00:00 2001 From: github-cloudlabsuser-2120 Date: Wed, 19 Jun 2024 06:32:24 +0000 Subject: [PATCH 3/3] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/master_sanaapp.yml | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/master_sanaapp.yml diff --git a/.github/workflows/master_sanaapp.yml b/.github/workflows/master_sanaapp.yml new file mode 100644 index 00000000..01ad399d --- /dev/null +++ b/.github/workflows/master_sanaapp.yml @@ -0,0 +1,57 @@ +# 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 - SanaApp + +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 }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v3 + with: + name: ASP-app + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'SanaApp' + slot-name: 'Production' + package: . + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_6CA384CEBAE943D0A5A3067FAEC699EE }} \ No newline at end of file