From 5ee682b4ac8e79243952ec79581ab23011a43e01 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 09:59:51 +0530 Subject: [PATCH 01/42] Create main.yml --- .github/workflows/main.yml | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..215742c1 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,67 @@ +# This is a basic workflow to help you get started with Actions + +name: Sample App deploy + +# Controls when the workflow will run +on: + workflow_dispatch: + +env: + AZURE_WEBAPP_NAME: "gh-sampleapp" # set this to your application's name + LOAD_TEST_RESOURCE: "" + LOAD_TEST_RESOURCE_GROUP: "" + AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root + NODE_VERSION: '14.15.1' # set this to the node version to use + LOCATION: "East US" + APPINSIGHTLOCATION: "East US" + DATABASEACCOUNTLOCATION: "eastus" + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build-and-deploy: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout GitHub Actions + uses: actions/checkout@v2 + + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: npm install and build + continue-on-error: false + run: | + npm install + npm run build --if-present + npm run test --if-present + + - name: Login to Azure + uses: azure/login@v1 + continue-on-error: false + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + # Deploy Arm template + - name: Deploy ARM Template + uses: azure/powershell@v1 + continue-on-error: false + with: + inlineScript: | + az group create --name "${{ env.AZURE_WEBAPP_NAME }}-rg" --location "${{ env.LOCATION }}" + $deploymentOutputs = az deployment group create --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --mode Incremental --template-file ./windows-webapp-template.json --parameters webAppName="${{ env.AZURE_WEBAPP_NAME }}" --parameters hostingPlanName="${{ env.AZURE_WEBAPP_NAME }}-host" --parameters appInsightsLocation="${{ env.APPINSIGHTLOCATION }}" --parameters databaseAccountId="${{ env.AZURE_WEBAPP_NAME }}db" --parameters databaseAccountLocation="${{ env.DATABASEACCOUNTLOCATION }}" -o json + $deploymentOutputs = $deploymentOutputs | ConvertFrom-Json + $connectionString = [String]$deploymentOutputs.properties.outputs.azureCosmosDBAccountKeys.value -replace '&','^^^&' + $setConnectionString = az webapp config appsettings set --name "${{ env.AZURE_WEBAPP_NAME }}" --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --settings CONNECTION_STRING="$connectionString" + $setAppSettings = az webapp config appsettings set --name "${{ env.AZURE_WEBAPP_NAME }}" --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --settings MSDEPLOY_RENAME_LOCKED_FILES=1 + azPSVersion: "latest" + + - name: 'Deploy to Azure WebApp' + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} From 2ca0ae451347411fe061edad8afc811463608641 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 10:00:58 +0530 Subject: [PATCH 02/42] Create azure-pipelines.yml --- azure-pipelines.yml | 106 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..048c0f95 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,106 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +trigger: none + +pool: + vmImage: ubuntu-latest + +variables: + webAppName: 'adonew-sampleapp' + serviceConnection: 'Cloud-Native-Testing-IDC-Test(7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a)' + azureSubscriptionId: '7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a' + loadTestResource: '' + loadTestResourceGroup: '' + location: 'EAST US' + + +stages: +- stage: Build + displayName: Build + jobs: + - job: Build + displayName: Build + pool: + vmImage: windows-latest + + steps: + - task: NodeTool@0 + inputs: + versionSpec: '14.15.1' + displayName: 'Install Node.js' + + - script: | + npm install + npm run build + displayName: 'npm install and build' + + # - task: ArchiveFiles@2 + # displayName: 'Archive files' + # inputs: + # rootFolderOrFile: '$(System.DefaultWorkingDirectory)' + # includeRootFolder: false + # archiveType: zip + # archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip + # replaceExistingArchive: true + + # - publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip + # artifact: drop + +- stage: Deploy + displayName: Deploy + dependsOn: Build + condition: succeeded() + jobs: + - job: Deploy + displayName: Deploy + pool: + vmImage: windows-latest + + steps: + - task: AzureResourceManagerTemplateDeployment@3 + inputs: + deploymentScope: 'Resource Group' + azureResourceManagerConnection: $(serviceConnection) + subscriptionId: $(azureSubscriptionId) + action: 'Create Or Update Resource Group' + resourceGroupName: '$(webAppName)-rg' + location: 'East US' + templateLocation: 'Linked artifact' + csmFile: '$(System.DefaultWorkingDirectory)/windows-webapp-template.json' + overrideParameters: '-webAppName $(webAppName) -hostingPlanName $(webAppName)-host -appInsightsLocation "East US" -databaseAccountId $(webAppName)db -databaseAccountLocation "East US"' + deploymentMode: 'Incremental' + deploymentOutputs: 'deploymentOutputs' + + - task: PowerShell@2 + inputs: + targetType: 'inline' + script: | + $deploymentOutput=(ConvertFrom-Json '$(deploymentOutputs)') + $connectionStringValue=[String]$deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value -replace '&','^^^&' + Write-Host "##vso[task.setvariable variable=connectionString;issecret=true;]$connectionStringValue" + + - task: AzureAppServiceSettings@1 + inputs: + azureSubscription: $(serviceConnection) + appName: '$(webAppName)' + resourceGroupName: '$(webAppName)-rg' + appSettings: | + [ + { + "name": "CONNECTION_STRING", + "value": "$(connectionString)", + "slotSetting": false + }, + { + "name": "MSDEPLOY_RENAME_LOCKED_FILES", + "value": 1, + "slotSetting": false + } + ] + + # - task: DownloadPipelineArtifact@2 + # inputs: + # artifact: drop From ef3b578fb76db7c67e400209366832354f9c5b6c Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 10:01:53 +0530 Subject: [PATCH 03/42] Update main.yml --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 215742c1..a2e99029 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,14 +7,14 @@ on: workflow_dispatch: env: - AZURE_WEBAPP_NAME: "gh-sampleapp" # set this to your application's name + AZURE_WEBAPP_NAME: "ninallam-ghapp" # set this to your application's name LOAD_TEST_RESOURCE: "" LOAD_TEST_RESOURCE_GROUP: "" AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root NODE_VERSION: '14.15.1' # set this to the node version to use - LOCATION: "East US" - APPINSIGHTLOCATION: "East US" - DATABASEACCOUNTLOCATION: "eastus" + LOCATION: "West US" + APPINSIGHTLOCATION: "West US" + DATABASEACCOUNTLOCATION: "westus" # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From fe6554c7c391624b8a03f56f17198b4002a7dc65 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 10:23:29 +0530 Subject: [PATCH 04/42] Update windows-webapp-template.json --- windows-webapp-template.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/windows-webapp-template.json b/windows-webapp-template.json index 7916a195..56c988c9 100644 --- a/windows-webapp-template.json +++ b/windows-webapp-template.json @@ -71,10 +71,10 @@ "name": "[parameters('hostingPlanName')]", "location": "[resourceGroup().location]", "sku": { - "name": "P2v3", - "tier": "PremiumV3", - "size": "P2v3", - "family": "Pv3", + "name": "P1v2", + "tier": "PremiumV2", + "size": "P1v2", + "family": "Pv2", "capacity": 1 }, "kind": "app", @@ -166,4 +166,4 @@ "type": "string" } } -} \ No newline at end of file +} From d6cdc8acb51723003487a65a822058caf3acffa7 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 10:49:20 +0530 Subject: [PATCH 05/42] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 048c0f95..31119ee8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,7 +9,7 @@ pool: vmImage: ubuntu-latest variables: - webAppName: 'adonew-sampleapp' + webAppName: 'ado-sampleapp' serviceConnection: 'Cloud-Native-Testing-IDC-Test(7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a)' azureSubscriptionId: '7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a' loadTestResource: '' From e3706b06294f8144a5fb4ae890f8ed0b20b40a88 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 10:52:25 +0530 Subject: [PATCH 06/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 31119ee8..9c9b4835 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -104,3 +104,14 @@ stages: # - task: DownloadPipelineArtifact@2 # inputs: # artifact: drop + + # - task: AzureRmWebAppDeployment@4 + # inputs: + # ConnectionType: 'AzureRM' + # azureSubscription: $(serviceConnection) + # appType: 'webApp' + # WebAppName: $(webAppName) + # packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' + # enableCustomDeployment: true + # DeploymentType: 'zipDeploy' + # TakeAppOfflineFlag: false \ No newline at end of file From f7f96d1d89b5e07f25edd0f5735e61654d53ddc0 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:03:04 +0530 Subject: [PATCH 07/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9c9b4835..bb6ec167 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,7 +79,7 @@ stages: targetType: 'inline' script: | $deploymentOutput=(ConvertFrom-Json '$(deploymentOutputs)') - $connectionStringValue=[String]$deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value -replace '&','^^^&' + $connectionStringValue= ($deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value).ToString() Write-Host "##vso[task.setvariable variable=connectionString;issecret=true;]$connectionStringValue" - task: AzureAppServiceSettings@1 From c11601612346ef3765cab13653a7f9e5284c2714 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:08:40 +0530 Subject: [PATCH 08/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bb6ec167..38527f53 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,7 +79,7 @@ stages: targetType: 'inline' script: | $deploymentOutput=(ConvertFrom-Json '$(deploymentOutputs)') - $connectionStringValue= ($deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value).ToString() + $connectionStringValue= $deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value Write-Host "##vso[task.setvariable variable=connectionString;issecret=true;]$connectionStringValue" - task: AzureAppServiceSettings@1 From f4877236981f6c6b169d48102738bf59dcb0adf3 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:09:06 +0530 Subject: [PATCH 09/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 38527f53..d3ff2b23 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,24 +18,24 @@ variables: stages: -- stage: Build - displayName: Build - jobs: - - job: Build - displayName: Build - pool: - vmImage: windows-latest +# - stage: Build +# displayName: Build +# jobs: +# - job: Build +# displayName: Build +# pool: +# vmImage: windows-latest - steps: - - task: NodeTool@0 - inputs: - versionSpec: '14.15.1' - displayName: 'Install Node.js' +# steps: +# - task: NodeTool@0 +# inputs: +# versionSpec: '14.15.1' +# displayName: 'Install Node.js' - - script: | - npm install - npm run build - displayName: 'npm install and build' +# - script: | +# npm install +# npm run build +# displayName: 'npm install and build' # - task: ArchiveFiles@2 # displayName: 'Archive files' From ce1f7fde90429a69bce7cd521abf44cf715356fe Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:11:34 +0530 Subject: [PATCH 10/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d3ff2b23..48d51f10 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -51,8 +51,8 @@ stages: - stage: Deploy displayName: Deploy - dependsOn: Build - condition: succeeded() + # dependsOn: Build + # condition: succeeded() jobs: - job: Deploy displayName: Deploy From 7facd85fc667f47895e5202ad801db68465db2f3 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:20:20 +0530 Subject: [PATCH 11/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 48d51f10..3000f15a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -80,6 +80,7 @@ stages: script: | $deploymentOutput=(ConvertFrom-Json '$(deploymentOutputs)') $connectionStringValue= $deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value + Write-Host 'Value of connection string' $connectionStringValue Write-Host "##vso[task.setvariable variable=connectionString;issecret=true;]$connectionStringValue" - task: AzureAppServiceSettings@1 From a3f7ffd19781c76ef67c1942c3d2f9eaea0a2a35 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:24:36 +0530 Subject: [PATCH 12/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3000f15a..74da272e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,6 +79,7 @@ stages: targetType: 'inline' script: | $deploymentOutput=(ConvertFrom-Json '$(deploymentOutputs)') + Write-Host 'Value of connection string' $deploymentOutput $connectionStringValue= $deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value Write-Host 'Value of connection string' $connectionStringValue Write-Host "##vso[task.setvariable variable=connectionString;issecret=true;]$connectionStringValue" From d78ea01abf750eaed07085ca2e88f41569038e7c Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:24:52 +0530 Subject: [PATCH 13/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 74da272e..5053407f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,9 +79,9 @@ stages: targetType: 'inline' script: | $deploymentOutput=(ConvertFrom-Json '$(deploymentOutputs)') - Write-Host 'Value of connection string' $deploymentOutput + Write-Host 'Value of deploymentOutput' $deploymentOutput $connectionStringValue= $deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value - Write-Host 'Value of connection string' $connectionStringValue + Write-Host 'Value of connectionStringValue' $connectionStringValue Write-Host "##vso[task.setvariable variable=connectionString;issecret=true;]$connectionStringValue" - task: AzureAppServiceSettings@1 From d4a8ac6f0a13179c32ab317c48799b904ec4d8d8 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:28:36 +0530 Subject: [PATCH 14/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5053407f..945913fe 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,7 +79,7 @@ stages: targetType: 'inline' script: | $deploymentOutput=(ConvertFrom-Json '$(deploymentOutputs)') - Write-Host 'Value of deploymentOutput' $deploymentOutput + Write-Host 'Value of deploymentOutput' $deploymentOutputs $connectionStringValue= $deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value Write-Host 'Value of connectionStringValue' $connectionStringValue Write-Host "##vso[task.setvariable variable=connectionString;issecret=true;]$connectionStringValue" From 45ad653d685743c11a16dd0bc7fb2c626b75aa2d Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:33:10 +0530 Subject: [PATCH 15/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 945913fe..e96d472a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -72,14 +72,14 @@ stages: csmFile: '$(System.DefaultWorkingDirectory)/windows-webapp-template.json' overrideParameters: '-webAppName $(webAppName) -hostingPlanName $(webAppName)-host -appInsightsLocation "East US" -databaseAccountId $(webAppName)db -databaseAccountLocation "East US"' deploymentMode: 'Incremental' - deploymentOutputs: 'deploymentOutputs' + deploymentOutputs: 'output' - task: PowerShell@2 inputs: targetType: 'inline' script: | - $deploymentOutput=(ConvertFrom-Json '$(deploymentOutputs)') - Write-Host 'Value of deploymentOutput' $deploymentOutputs + $deploymentOutput=(ConvertFrom-Json '$(output)') + Write-Host 'Value of deploymentOutput' $deploymentOutput $connectionStringValue= $deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value Write-Host 'Value of connectionStringValue' $connectionStringValue Write-Host "##vso[task.setvariable variable=connectionString;issecret=true;]$connectionStringValue" From d75e18b288c554a957bb35a5db15b7513d8b1faf Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:33:52 +0530 Subject: [PATCH 16/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e96d472a..e91a8b07 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -78,7 +78,7 @@ stages: inputs: targetType: 'inline' script: | - $deploymentOutput=(ConvertFrom-Json '$(output)') + $deploymentOutput=(ConvertFrom-Json $(output)) Write-Host 'Value of deploymentOutput' $deploymentOutput $connectionStringValue= $deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value Write-Host 'Value of connectionStringValue' $connectionStringValue From 649cfb52a4fd7a80a86343ff3e7abb7e28b3c51c Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:36:44 +0530 Subject: [PATCH 17/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e91a8b07..500c0ed3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,7 +79,6 @@ stages: targetType: 'inline' script: | $deploymentOutput=(ConvertFrom-Json $(output)) - Write-Host 'Value of deploymentOutput' $deploymentOutput $connectionStringValue= $deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value Write-Host 'Value of connectionStringValue' $connectionStringValue Write-Host "##vso[task.setvariable variable=connectionString;issecret=true;]$connectionStringValue" From e73f5b986631dd86520a9c8a7a2a7c50949fb99d Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:43:34 +0530 Subject: [PATCH 18/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 500c0ed3..4e3e581e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -78,7 +78,7 @@ stages: inputs: targetType: 'inline' script: | - $deploymentOutput=(ConvertFrom-Json $(output)) + $deploymentOutput= $(output) | ConvertFrom-Json $connectionStringValue= $deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value Write-Host 'Value of connectionStringValue' $connectionStringValue Write-Host "##vso[task.setvariable variable=connectionString;issecret=true;]$connectionStringValue" From 8c082426981cb0a76697168d3252ff3c8b2f7a26 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:47:23 +0530 Subject: [PATCH 19/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4e3e581e..838cf9ae 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -78,9 +78,9 @@ stages: inputs: targetType: 'inline' script: | - $deploymentOutput= $(output) | ConvertFrom-Json - $connectionStringValue= $deploymentOutput.properties.outputs.azureCosmosDBAccountKeys.value - Write-Host 'Value of connectionStringValue' $connectionStringValue + $deploymentOutput= ConvertFrom-Json '$(output)' + $connectionStringValue= $deploymentOutput.azureCosmosDBAccountKeys.value + Write-Host "Value of connectionStringValue $connectionStringValue" Write-Host "##vso[task.setvariable variable=connectionString;issecret=true;]$connectionStringValue" - task: AzureAppServiceSettings@1 From a30f33f0314b4139efbebbd7eb764806ec859acf Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:53:43 +0530 Subject: [PATCH 20/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 82 ++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 838cf9ae..e0edca8f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,41 +18,41 @@ variables: stages: -# - stage: Build -# displayName: Build -# jobs: -# - job: Build -# displayName: Build -# pool: -# vmImage: windows-latest +- stage: Build + displayName: Build + jobs: + - job: Build + displayName: Build + pool: + vmImage: windows-latest -# steps: -# - task: NodeTool@0 -# inputs: -# versionSpec: '14.15.1' -# displayName: 'Install Node.js' + steps: + - task: NodeTool@0 + inputs: + versionSpec: '14.15.1' + displayName: 'Install Node.js' -# - script: | -# npm install -# npm run build -# displayName: 'npm install and build' + - script: | + npm install + npm run build + displayName: 'npm install and build' - # - task: ArchiveFiles@2 - # displayName: 'Archive files' - # inputs: - # rootFolderOrFile: '$(System.DefaultWorkingDirectory)' - # includeRootFolder: false - # archiveType: zip - # archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip - # replaceExistingArchive: true + - task: ArchiveFiles@2 + displayName: 'Archive files' + inputs: + rootFolderOrFile: '$(System.DefaultWorkingDirectory)' + includeRootFolder: false + archiveType: zip + archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip + replaceExistingArchive: true - # - publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip - # artifact: drop + - publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip + artifact: drop - stage: Deploy displayName: Deploy - # dependsOn: Build - # condition: succeeded() + dependsOn: Build + condition: succeeded() jobs: - job: Deploy displayName: Deploy @@ -102,17 +102,17 @@ stages: } ] - # - task: DownloadPipelineArtifact@2 - # inputs: - # artifact: drop + - task: DownloadPipelineArtifact@2 + inputs: + artifact: drop - # - task: AzureRmWebAppDeployment@4 - # inputs: - # ConnectionType: 'AzureRM' - # azureSubscription: $(serviceConnection) - # appType: 'webApp' - # WebAppName: $(webAppName) - # packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' - # enableCustomDeployment: true - # DeploymentType: 'zipDeploy' - # TakeAppOfflineFlag: false \ No newline at end of file + - task: AzureRmWebAppDeployment@4 + inputs: + ConnectionType: 'AzureRM' + azureSubscription: $(serviceConnection) + appType: 'webApp' + WebAppName: $(webAppName) + packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' + enableCustomDeployment: true + DeploymentType: 'zipDeploy' + TakeAppOfflineFlag: false \ No newline at end of file From f23cb7a042338996a001b3f7f4d571b9e6158861 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 11:57:29 +0530 Subject: [PATCH 21/42] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a2e99029..9cda0d5e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,7 +55,7 @@ jobs: az group create --name "${{ env.AZURE_WEBAPP_NAME }}-rg" --location "${{ env.LOCATION }}" $deploymentOutputs = az deployment group create --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --mode Incremental --template-file ./windows-webapp-template.json --parameters webAppName="${{ env.AZURE_WEBAPP_NAME }}" --parameters hostingPlanName="${{ env.AZURE_WEBAPP_NAME }}-host" --parameters appInsightsLocation="${{ env.APPINSIGHTLOCATION }}" --parameters databaseAccountId="${{ env.AZURE_WEBAPP_NAME }}db" --parameters databaseAccountLocation="${{ env.DATABASEACCOUNTLOCATION }}" -o json $deploymentOutputs = $deploymentOutputs | ConvertFrom-Json - $connectionString = [String]$deploymentOutputs.properties.outputs.azureCosmosDBAccountKeys.value -replace '&','^^^&' + $connectionString = [String]$deploymentOutputs.properties.outputs.azureCosmosDBAccountKeys.value $setConnectionString = az webapp config appsettings set --name "${{ env.AZURE_WEBAPP_NAME }}" --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --settings CONNECTION_STRING="$connectionString" $setAppSettings = az webapp config appsettings set --name "${{ env.AZURE_WEBAPP_NAME }}" --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --settings MSDEPLOY_RENAME_LOCKED_FILES=1 azPSVersion: "latest" From 5438824d2b57d0c0394ac42a02372217dd625518 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 12:04:38 +0530 Subject: [PATCH 22/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e0edca8f..00c8bf76 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -106,13 +106,21 @@ stages: inputs: artifact: drop - - task: AzureRmWebAppDeployment@4 + # - task: AzureRmWebAppDeployment@4 + # inputs: + # ConnectionType: 'AzureRM' + # azureSubscription: $(serviceConnection) + # appType: 'webApp' + # WebAppName: $(webAppName) + # packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' + # enableCustomDeployment: true + # DeploymentType: 'zipDeploy' + # TakeAppOfflineFlag: false + + - task: AzureWebApp@1 inputs: - ConnectionType: 'AzureRM' - azureSubscription: $(serviceConnection) + azureSubscription: '$(serviceConnection)' appType: 'webApp' - WebAppName: $(webAppName) - packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' - enableCustomDeployment: true - DeploymentType: 'zipDeploy' - TakeAppOfflineFlag: false \ No newline at end of file + appName: $(webAppName) + package: '$(Pipeline.Workspace)/$(Build.BuildId).zip' + deploymentMethod: 'auto' \ No newline at end of file From 03af059356821525a68ebbec44844dac846dc72b Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Sun, 21 Nov 2021 12:15:32 +0530 Subject: [PATCH 23/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 00c8bf76..7b99f9dc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -106,21 +106,21 @@ stages: inputs: artifact: drop - # - task: AzureRmWebAppDeployment@4 - # inputs: - # ConnectionType: 'AzureRM' - # azureSubscription: $(serviceConnection) - # appType: 'webApp' - # WebAppName: $(webAppName) - # packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' - # enableCustomDeployment: true - # DeploymentType: 'zipDeploy' - # TakeAppOfflineFlag: false - - - task: AzureWebApp@1 + - task: AzureRmWebAppDeployment@4 inputs: - azureSubscription: '$(serviceConnection)' + ConnectionType: 'AzureRM' + azureSubscription: $(serviceConnection) appType: 'webApp' - appName: $(webAppName) - package: '$(Pipeline.Workspace)/$(Build.BuildId).zip' - deploymentMethod: 'auto' \ No newline at end of file + WebAppName: $(webAppName) + packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' + # enableCustomDeployment: true + # DeploymentType: 'zipDeploy' + # TakeAppOfflineFlag: false + + # - task: AzureWebApp@1 + # inputs: + # azureSubscription: '$(serviceConnection)' + # appType: 'webApp' + # appName: $(webAppName) + # package: '$(Pipeline.Workspace)/$(Build.BuildId).zip' + # deploymentMethod: 'auto' \ No newline at end of file From 68b69d50436b01163581d903d4b3660b0ca6201d Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:30:29 +0530 Subject: [PATCH 24/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7b99f9dc..6b154122 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -113,6 +113,7 @@ stages: appType: 'webApp' WebAppName: $(webAppName) packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' + StartupCommand: 'npm start' # enableCustomDeployment: true # DeploymentType: 'zipDeploy' # TakeAppOfflineFlag: false From 6707e11d7921b194d8dfecdb73526304c8108afa Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:32:34 +0530 Subject: [PATCH 25/42] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9cda0d5e..ef105473 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,3 +65,4 @@ jobs: with: app-name: ${{ env.AZURE_WEBAPP_NAME }} package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} + startup-command: npm start From dd92da4cd286accb48cf8fd7a6052bfc40d60261 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:44:50 +0530 Subject: [PATCH 26/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6b154122..b7fc804a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -113,7 +113,8 @@ stages: appType: 'webApp' WebAppName: $(webAppName) packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' - StartupCommand: 'npm start' + ScriptType: 'Inline Script' + InlineScript: 'npm start' # enableCustomDeployment: true # DeploymentType: 'zipDeploy' # TakeAppOfflineFlag: false From eae63f59bec22b4fbaf9928b248ef87bf6b43a30 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:42:37 +0530 Subject: [PATCH 27/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b7fc804a..bd633458 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -99,7 +99,12 @@ stages: "name": "MSDEPLOY_RENAME_LOCKED_FILES", "value": 1, "slotSetting": false - } + } + { + "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", + "value": 1, + "slotSetting": true + } ] - task: DownloadPipelineArtifact@2 @@ -113,8 +118,8 @@ stages: appType: 'webApp' WebAppName: $(webAppName) packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' - ScriptType: 'Inline Script' - InlineScript: 'npm start' + # ScriptType: 'Inline Script' + # InlineScript: 'npm start' # enableCustomDeployment: true # DeploymentType: 'zipDeploy' # TakeAppOfflineFlag: false From 999d62d4be49342a06106510a771512cadf3b5e9 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:48:22 +0530 Subject: [PATCH 28/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bd633458..dd7ec2df 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -99,7 +99,7 @@ stages: "name": "MSDEPLOY_RENAME_LOCKED_FILES", "value": 1, "slotSetting": false - } + }, { "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": 1, From 85b10a53e773931d3ee97c35bd008fb7d20c115d Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:52:49 +0530 Subject: [PATCH 29/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index dd7ec2df..f043f712 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -102,8 +102,8 @@ stages: }, { "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", - "value": 1, - "slotSetting": true + "value": true, + "slotSetting": false } ] From 60b584c570c6527ae1b1fe9d878a2f8c178e43f6 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 17:15:05 +0530 Subject: [PATCH 30/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f043f712..de4801e8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -118,8 +118,8 @@ stages: appType: 'webApp' WebAppName: $(webAppName) packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' - # ScriptType: 'Inline Script' - # InlineScript: 'npm start' + ScriptType: 'Inline Script' + InlineScript: 'npm start &' # enableCustomDeployment: true # DeploymentType: 'zipDeploy' # TakeAppOfflineFlag: false From cabbdda21f23b8ee1266cb397a485e293246184e Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 17:35:23 +0530 Subject: [PATCH 31/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index de4801e8..a02939c5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -119,7 +119,7 @@ stages: WebAppName: $(webAppName) packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' ScriptType: 'Inline Script' - InlineScript: 'npm start &' + InlineScript: 'npm install' # enableCustomDeployment: true # DeploymentType: 'zipDeploy' # TakeAppOfflineFlag: false From ca1e0b55350e6f3906a8476adb6f749b3dd5dc0d Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 17:43:26 +0530 Subject: [PATCH 32/42] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a02939c5..f140bffd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,7 +9,7 @@ pool: vmImage: ubuntu-latest variables: - webAppName: 'ado-sampleapp' + webAppName: 'adonew-sampleapp' serviceConnection: 'Cloud-Native-Testing-IDC-Test(7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a)' azureSubscriptionId: '7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a' loadTestResource: '' From c369fab3b8db24f83df60bf3d1e891588bb961c5 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 18:00:53 +0530 Subject: [PATCH 33/42] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ef105473..ef38211c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,6 +58,7 @@ jobs: $connectionString = [String]$deploymentOutputs.properties.outputs.azureCosmosDBAccountKeys.value $setConnectionString = az webapp config appsettings set --name "${{ env.AZURE_WEBAPP_NAME }}" --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --settings CONNECTION_STRING="$connectionString" $setAppSettings = az webapp config appsettings set --name "${{ env.AZURE_WEBAPP_NAME }}" --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --settings MSDEPLOY_RENAME_LOCKED_FILES=1 + $setAppSettings = az webapp config appsettings set --name "${{ env.AZURE_WEBAPP_NAME }}" --resource-group "${{ env.AZURE_WEBAPP_NAME }}-rg" --settings SCM_DO_BUILD_DURING_DEPLOYMENT=true azPSVersion: "latest" - name: 'Deploy to Azure WebApp' From 6fb51804dafcfa8579fd29d2e00e305055ac4d1a Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 18:04:50 +0530 Subject: [PATCH 34/42] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ef38211c..553539a8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,4 +66,4 @@ jobs: with: app-name: ${{ env.AZURE_WEBAPP_NAME }} package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} - startup-command: npm start + From 85b4f3dedac79e1054aeb75847db64f6e0863847 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 18:17:12 +0530 Subject: [PATCH 35/42] Update config.json --- config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index ef7ec377..0abb209a 100644 --- a/config.json +++ b/config.json @@ -1,4 +1,4 @@ { - "enableSecretsFeature": false, + "enableSecretsFeature": true, "secretHeaderValue": "1797669089" -} \ No newline at end of file +} From 254e8bc17d43b10656bd56949189cd1b6bc79243 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 18:31:19 +0530 Subject: [PATCH 36/42] Update config.json --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 0abb209a..5a9d8ecf 100644 --- a/config.json +++ b/config.json @@ -1,4 +1,4 @@ { - "enableSecretsFeature": true, + "enableSecretsFeature": false, "secretHeaderValue": "1797669089" } From 560ada5d3d98c5a17f87e890194085e5790cc6c2 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 18:52:39 +0530 Subject: [PATCH 37/42] Update config.json --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 5a9d8ecf..0abb209a 100644 --- a/config.json +++ b/config.json @@ -1,4 +1,4 @@ { - "enableSecretsFeature": false, + "enableSecretsFeature": true, "secretHeaderValue": "1797669089" } From 3c06dd52416c2cf60486f616a4fea79bb40bd98d Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 22:26:18 +0530 Subject: [PATCH 38/42] Add files via upload --- SampleApp.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 SampleApp.yaml diff --git a/SampleApp.yaml b/SampleApp.yaml new file mode 100644 index 00000000..90701e72 --- /dev/null +++ b/SampleApp.yaml @@ -0,0 +1,5 @@ +version: v0.1 +testName: SampleAppTest +testPlan: SampleApp.jmx +description: 'SampleApp Test Run' +engineInstances: 1 \ No newline at end of file From e35f2adf45bb3aaa31f7d20d42dd8e850b54ba85 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 22:28:05 +0530 Subject: [PATCH 39/42] Update azure-pipelines.yml --- azure-pipelines.yml | 52 ++++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f140bffd..0f2adb97 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,15 +3,16 @@ # Add steps that analyze code, save build artifacts, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/javascript -trigger: none +trigger: +- main pool: vmImage: ubuntu-latest variables: - webAppName: 'adonew-sampleapp' - serviceConnection: 'Cloud-Native-Testing-IDC-Test(7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a)' - azureSubscriptionId: '7c71b563-0dc0-4bc0-bcf6-06f8f0516c7a' + webAppName: '' + serviceConnection: '' + azureSubscriptionId: '' loadTestResource: '' loadTestResourceGroup: '' location: 'EAST US' @@ -80,7 +81,6 @@ stages: script: | $deploymentOutput= ConvertFrom-Json '$(output)' $connectionStringValue= $deploymentOutput.azureCosmosDBAccountKeys.value - Write-Host "Value of connectionStringValue $connectionStringValue" Write-Host "##vso[task.setvariable variable=connectionString;issecret=true;]$connectionStringValue" - task: AzureAppServiceSettings@1 @@ -120,14 +120,36 @@ stages: packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' ScriptType: 'Inline Script' InlineScript: 'npm install' - # enableCustomDeployment: true - # DeploymentType: 'zipDeploy' - # TakeAppOfflineFlag: false + - task: DownloadPipelineArtifact@2 + inputs: + artifact: drop + - task: AzureRmWebAppDeployment@4 + inputs: + ConnectionType: 'AzureRM' + azureSubscription: $(serviceConnection) + appType: 'webApp' + WebAppName: $(webAppName) + packageForLinux: '$(Pipeline.Workspace)/$(Build.BuildId).zip' + enableCustomDeployment: true + DeploymentType: 'zipDeploy' + TakeAppOfflineFlag: false + +- stage: LoadTest + displayName: Load Test + dependsOn: Deploy + condition: succeeded() + jobs: + - job: LoadTest + displayName: Load Test + pool: + vmImage: ubuntu-latest + steps: + - task: AzureLoadTest@1 + inputs: + azureSubscription: $(serviceConnection) + loadTestConfigFile: 'SampleApp.yaml' + resourceGroup: $(loadTestResourceGroup) + loadTestResource: $(loadTestResource) - # - task: AzureWebApp@1 - # inputs: - # azureSubscription: '$(serviceConnection)' - # appType: 'webApp' - # appName: $(webAppName) - # package: '$(Pipeline.Workspace)/$(Build.BuildId).zip' - # deploymentMethod: 'auto' \ No newline at end of file + - publish: $(System.DefaultWorkingDirectory)/loadTest + artifact: results From 6c670d1ce6ab31a69ba1e4207f118953e220b97f Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 22:33:16 +0530 Subject: [PATCH 40/42] Update and rename main.yml to workflow.yml --- .github/workflows/{main.yml => workflow.yml} | 27 +++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) rename .github/workflows/{main.yml => workflow.yml} (80%) diff --git a/.github/workflows/main.yml b/.github/workflows/workflow.yml similarity index 80% rename from .github/workflows/main.yml rename to .github/workflows/workflow.yml index 553539a8..3e64fdab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/workflow.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - AZURE_WEBAPP_NAME: "ninallam-ghapp" # set this to your application's name + AZURE_WEBAPP_NAME: "" # set this to your application's name LOAD_TEST_RESOURCE: "" LOAD_TEST_RESOURCE_GROUP: "" AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root @@ -67,3 +67,28 @@ jobs: app-name: ${{ env.AZURE_WEBAPP_NAME }} package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} + loadTest: + name: Load Test + needs: build-and-deploy + runs-on: ubuntu-latest + steps: + - name: Checkout GitHub Actions + uses: actions/checkout@v2 + + - name: Login to Azure + uses: azure/login@v1 + continue-on-error: false + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: 'Azure Load Testing' + uses: azure/load-testing@v1 + with: + loadTestConfigFile: 'SampleApp.yaml' + loadTestResource: ${{ env.LOAD_TEST_RESOURCE }} + resourceGroup: ${{ env.LOAD_TEST_RESOURCE_GROUP }} + + - uses: actions/upload-artifact@v2 + with: + name: loadTestResults + path: ${{ github.workspace }}/loadTest From 922a099c4e45d1f0e86b66c821e8555008104707 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 22:33:44 +0530 Subject: [PATCH 41/42] Update config.json --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 0abb209a..5a9d8ecf 100644 --- a/config.json +++ b/config.json @@ -1,4 +1,4 @@ { - "enableSecretsFeature": true, + "enableSecretsFeature": false, "secretHeaderValue": "1797669089" } From 6f84e48fb5e9b02a52a58433ff771db046dfc45a Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Mon, 22 Nov 2021 22:34:29 +0530 Subject: [PATCH 42/42] Update windows-webapp-template.json --- windows-webapp-template.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/windows-webapp-template.json b/windows-webapp-template.json index 56c988c9..0633f246 100644 --- a/windows-webapp-template.json +++ b/windows-webapp-template.json @@ -71,10 +71,10 @@ "name": "[parameters('hostingPlanName')]", "location": "[resourceGroup().location]", "sku": { - "name": "P1v2", - "tier": "PremiumV2", - "size": "P1v2", - "family": "Pv2", + "name": "P2v3", + "tier": "PremiumV3", + "size": "P2v3", + "family": "Pv3", "capacity": 1 }, "kind": "app",