From 10bd956306fd6f0eaa3b2b7e202d1297d74f9bcc Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Wed, 19 Jan 2022 15:59:45 +0530 Subject: [PATCH 1/5] Add template.json file --- ARMTemplate/template.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ARMTemplate/template.json diff --git a/ARMTemplate/template.json b/ARMTemplate/template.json new file mode 100644 index 00000000..bc85fc30 --- /dev/null +++ b/ARMTemplate/template.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://schema.management.azure.com/schemas/2019-08-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "type": "String" + }, + "location": { + "type": "String" + }, + "tags": { + "type": "Object" + } + }, + "resources": [ + { + "type": "Microsoft.LoadTestService/loadtests", + "apiVersion": "2021-12-01-preview", + "name": "[parameters('name')]", + "location": "[parameters('location')]", + "tags": "[parameters('tags')]" + } + ] +} From be0ae4b90e451d9df890cf4f62579fde8469ea25 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Wed, 19 Jan 2022 16:00:17 +0530 Subject: [PATCH 2/5] Create parameters.json --- ARMTemplate/parameters.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ARMTemplate/parameters.json diff --git a/ARMTemplate/parameters.json b/ARMTemplate/parameters.json new file mode 100644 index 00000000..536093e9 --- /dev/null +++ b/ARMTemplate/parameters.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "" + }, + "location": { + "value": "" + }, + "tags": { + "value": {} + } + } +} From 2519a59f33d1d268ae94cbc500a405f669c8afaf Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Wed, 19 Jan 2022 16:08:59 +0530 Subject: [PATCH 3/5] Update azure-pipelines.yml --- azure-pipelines.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f1348617..1ff3216e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -127,6 +127,21 @@ stages: pool: vmImage: ubuntu-latest steps: + + - task: AzureResourceManagerTemplateDeployment@3 + inputs: + deploymentScope: 'Resource Group' + azureResourceManagerConnection: $(serviceConnection) + subscriptionId: $(azureSubscriptionId) + action: 'Create Or Update Resource Group' + resourceGroupName: $(loadTestResourceGroup) + location: '$(location)' + templateLocation: 'Linked artifact' + csmFile: '$(System.DefaultWorkingDirectory)/ARMTemplates/template.json' + csmParametersFile: '$(System.DefaultWorkingDirectory)/ARMTemplates/parameters.json' + overrideParameters: '-name $(loadTestResource) -location "$(location)"' + deploymentMode: 'Incremental' + - task: AzureLoadTest@1 inputs: azureSubscription: $(serviceConnection) From 0378a1359133094b893ad016487436b7ca023fc0 Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Wed, 19 Jan 2022 16:09:35 +0530 Subject: [PATCH 4/5] Update azure-pipelines.yml --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1ff3216e..6d74d1f2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -137,8 +137,8 @@ stages: resourceGroupName: $(loadTestResourceGroup) location: '$(location)' templateLocation: 'Linked artifact' - csmFile: '$(System.DefaultWorkingDirectory)/ARMTemplates/template.json' - csmParametersFile: '$(System.DefaultWorkingDirectory)/ARMTemplates/parameters.json' + csmFile: '$(System.DefaultWorkingDirectory)/ARMTemplate/template.json' + csmParametersFile: '$(System.DefaultWorkingDirectory)/ARMTemplate/parameters.json' overrideParameters: '-name $(loadTestResource) -location "$(location)"' deploymentMode: 'Incremental' From 908c54a89f71edab7c232feccd9054293338827a Mon Sep 17 00:00:00 2001 From: Nikita Nallamothu <50437471+ninallam@users.noreply.github.com> Date: Wed, 19 Jan 2022 16:12:34 +0530 Subject: [PATCH 5/5] Update workflow.yml --- .github/workflows/workflow.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3a0066ff..37d5791a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -71,7 +71,22 @@ jobs: continue-on-error: false with: creds: ${{ secrets.AZURE_CREDENTIALS }} - + + - name: Create Resource Group + uses: azure/powershell@v1 + continue-on-error: false + with: + inlineScript: | + az group create --name "${{ env.LOAD_TEST_RESOURCE_GROUP }}" --location "${{ env.LOCATION }}" + azPSVersion: "latest" + + - name: Create Azure Load Testing resource + uses: azure/arm-deploy@v1 + with: + resourceGroupName: ${{ env.LOAD_TEST_RESOURCE_GROUP }} + template: ./ARMTemplate/template.json + parameters: ./ARMTemplate/parameters.json name=${{ env.LOAD_TEST_RESOURCE }} location="${{ env.LOCATION }}" + - name: 'Azure Load Testing' uses: azure/load-testing@v1 with: