diff --git a/.github/workflows/dev_contactapplicationtest.yml b/.github/workflows/dev_contactapplicationtest.yml new file mode 100644 index 00000000..cef505bc --- /dev/null +++ b/.github/workflows/dev_contactapplicationtest.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 - ContactApplicationTest + +on: + push: + branches: + - dev + 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: 'ContactApplicationTest' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_AB7BFC6B72F94FA4A1860A5B28EDC4A0 }} + package: . diff --git a/CRUD application 2.sln b/CRUD application 2.sln index 79aebc94..802ab0bd 100644 --- a/CRUD application 2.sln +++ b/CRUD application 2.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 17.9.34728.123 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CRUD application 2", "CRUD application 2.csproj", "{D44C1C21-0289-4DD0-B139-6825EE5C13B2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserController.Tests", "..\UserController.Tests\UserController.Tests.csproj", "{6637840B-9561-465F-8281-8C6C853170E8}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -17,10 +15,6 @@ Global {D44C1C21-0289-4DD0-B139-6825EE5C13B2}.Debug|Any CPU.Build.0 = Debug|Any CPU {D44C1C21-0289-4DD0-B139-6825EE5C13B2}.Release|Any CPU.ActiveCfg = Release|Any CPU {D44C1C21-0289-4DD0-B139-6825EE5C13B2}.Release|Any CPU.Build.0 = Release|Any CPU - {6637840B-9561-465F-8281-8C6C853170E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6637840B-9561-465F-8281-8C6C853170E8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6637840B-9561-465F-8281-8C6C853170E8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6637840B-9561-465F-8281-8C6C853170E8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/deploy.json b/deploy.json index 03352655..8f6befb1 100644 --- a/deploy.json +++ b/deploy.json @@ -8,23 +8,7 @@ "name": "[parameters('appName')]", "location": "[parameters('location')]", "properties": { - "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlanName')]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/serverfarms', 'appServicePlanName')]" - ] - }, - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2021-02-01", - "name": "appServicePlanName", - "location": "[parameters('location')]", - "sku": { - "name": "F1", - "tier": "Free", - "size": "F1", - "family": "F", - "capacity": 1 + "serverFarmId": null } }, { diff --git a/deploy.parameters.json b/deploy.parameters.json index eda10a1d..bc1b7ca4 100644 --- a/deploy.parameters.json +++ b/deploy.parameters.json @@ -1,35 +1,35 @@ { "parameters": { - "appName": { - "type": "string", - "metadata": { - "description": "ContactDatabase" - } - }, - "location": { - "type": "string", - "metadata": { - "description": "The Azure region where the resources will be deployed." + "appName": { + "type": "string", + "metadata": { + "description": "ContactApplicationTest" + } }, - "defaultValue": "[resourceGroup().location]" - }, - "databaseName": { - "type": "string", - "metadata": { - "description": "The name of the Contact Database." - } - }, - "databaseUsername": { - "type": "string", - "metadata": { - "description": "The username for the Contact Database." - } - }, - "databasePassword": { - "type": "securestring", - "metadata": { - "description": "The password for the Contact Database." + "location": { + "type": "string", + "metadata": { + "description": "The Azure region where the resources will be deployed." + }, + "defaultValue": "[resourceGroup().location]" + }, + "databaseName": { + "type": "string", + "metadata": { + "description": "The name of the Contact Database." + } + }, + "databaseUsername": { + "type": "string", + "metadata": { + "description": "The username for the Contact Database." + } + }, + "databasePassword": { + "type": "securestring", + "metadata": { + "description": "The password for the Contact Database." + } } } -} } \ No newline at end of file