Skip to content
Running https://artillery.io/ load tests using Azure Container Instances ☁️ 📦
PowerShell Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
container-scripts
images
samples
Dockerfile
README.md
armdeploy.json
default.Build.ps1
package.json
run.ps1

README.md

Pay per Minute Load Tests using Artillery and Azure Container Instances

Gettin Started

1. Create an Artillery load test

config:
 ensure:
   p95: 3000
 environments:
   prod:
     target: 'https://somewebsite.com'
     phases:
     - name: "constant load"
       duration: 20
       arrivalRate: 5
scenarios:
 - name: "Main Page"
   flow:
   - get:
       url: "/"

2. Create a Dockerfile

FROM fgauna12/gaunastressyou:1.0.0

# Copy load test files into container
COPY samples/load.yml .

3. Build and Publish Container

$ docker build -t "[image name]" . 
$ docker push "[image name]"

4. Run Container From Azure

  1. Copy the ARM Template here and name it armdeploy https://raw.githubusercontent.com/fgauna12/AzureArtilleryLoadTests/master/armdeploy.json
  2. Run the ARM template

Bash (Azure CLI)

$ az group create -g "[resource group]" -l "[location]"

$ az group deployment create -g "[resource group]" -n "[load test name]" \
    --template-file armdeploy.json \
    --parameters loadTestName="[load test name]" \
    artillery-environment="[environment as defined in artillery yml]" \
    artillery-file=load.yml \
    image=fgauna12/gaunastressyou:1.0.0

Powershell (AZ Module)

param(
    # Location
    [Parameter()]
    [string]
    $Location = "eastus",
    # Environment
    [Parameter(Mandatory = $true)]
    [string]
    $Environment,
    # The name of the load test
    [Parameter(Mandatory = $true)]
    [string]
    $LoadTestName
)

$resourceGroupName = "$Environment-$LoadTestName-loadtest-rg"

Write-Host "Creating resource group"

New-AzResourceGroup -Location $Location -Name $resourceGroupName | Out-Null

Write-Host "Starting load test using Azure Container Instance"

New-AzResourceGroupDeployment `
        -ResourceGroupName "$Environment-$LoadTestName-loadtest-rg" `
        -TemplateFile "armdeploy.json" `
        -Mode Incremental `
        -loadTestName $LoadTestName `
        -artillery-environment $Environment `
        -artillery-file "load.yml" `
        -image "fgauna12/gaunastressyou:1.0.0"

5. Open HTML Results from Blob Storage

Go to the storage account created and navigate down to the blobs.

You'll see an HTML report created.

You can’t perform that action at this time.