Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/dev_contactapplicationtest.yml
Original file line number Diff line number Diff line change
@@ -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: .
6 changes: 0 additions & 6 deletions CRUD application 2.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
18 changes: 1 addition & 17 deletions deploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
{
Expand Down
58 changes: 29 additions & 29 deletions deploy.parameters.json
Original file line number Diff line number Diff line change
@@ -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."
}
}
}
}
}