Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create load test resource using ARM Template #11

Merged
merged 5 commits into from
Jan 27, 2022
Merged
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
17 changes: 16 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 15 additions & 0 deletions ARMTemplate/parameters.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
}
24 changes: 24 additions & 0 deletions ARMTemplate/template.json
Original file line number Diff line number Diff line change
@@ -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')]"
}
]
}
15 changes: 15 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)/ARMTemplate/template.json'
csmParametersFile: '$(System.DefaultWorkingDirectory)/ARMTemplate/parameters.json'
overrideParameters: '-name $(loadTestResource) -location "$(location)"'
deploymentMode: 'Incremental'

- task: AzureLoadTest@1
inputs:
azureSubscription: $(serviceConnection)
Expand Down