hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.52k stars 4.6k forks source link

Support for Azure Load Test - Tests #22903

Open jackwesleyroper opened 1 year ago

jackwesleyroper commented 1 year ago

Is there an existing issue for this?

Community Note

Description

azurerm_load_test resource does not currently support the creation of tests within the ALT resource. It could be added as a block in this resource or a new resource, like azurem_load_test_test

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/load_test

New or Affected Resource(s)/Data Source(s)

azurerm_load_test

Potential Terraform Configuration

test {
   type = quick
   url = https://hashicorp.com
   load = VirtualUsers
   no_of_virtual_users = 2
   test_duration = 120
   ramp_up_time = 0
}

References

No response

tombuildsstuff commented 1 year ago

hey @jackwesleyroper

Thanks for opening this issue.

Taking a quick look into this one this would need to be implemented as separate resources rather than embedded within the azurerm_load_test resource, however these are provisioned using the Data Plane API rather than the Resource Manager API.

At this time there isn't a Data Plane SDK available, as such we'd need to add support for that Service in tombuildsstuff/kermit based on the API Definition available here - as such I've labelled this with sdk/not-yet-supported to highlight this is waiting on that - but once that's available it should be possible for someone to take a look into this.

Thanks!

adamyager commented 11 months ago

hello. do you all have and update here?
Addition of a private VNET injected test would be key in this release as well. to add on to the example above it could appear as:

test { type = quick url = https://my-internal-app.something.net load = VirtualUsers no_of_virtual_users = 2 test_duration = 120 ramp_up_time = 0 private = true subnet_id = azurerm_subnet.example_subnet.id }

ADO has a Task that can configure it so I dont know what secret sauce they are using to get it. Example is below.

https://learn.microsoft.com/en-us/azure/load-testing/reference-test-config-yaml

version: v0.1 testId: SampleTest displayName: Sample Test testPlan: SampleTest.jmx description: Load test website home page engineInstances: 1 subnetId: /subscriptions/abcdef01-2345-6789-0abc-def012345678/resourceGroups/sample-rg/providers/Microsoft.Network/virtualNetworks/load-testing-vnet/subnets/load-testing properties: userPropertyFile: 'user.properties' configurationFiles:

adamyager commented 5 months ago

hey @jackwesleyroper

Thanks for opening this issue.

Taking a quick look into this one this would need to be implemented as separate resources rather than embedded within the azurerm_load_test resource, however these are provisioned using the Data Plane API rather than the Resource Manager API.

At this time there isn't a Data Plane SDK available, as such we'd need to add support for that Service in tombuildsstuff/kermit based on the API Definition available here - as such I've labelled this with sdk/not-yet-supported to highlight this is waiting on that - but once that's available it should be possible for someone to take a look into this.

Thanks!

@tombuildsstuff This does seem to have been remedied here.

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/loadtestservice/data-plane/Microsoft.LoadTestService/preview/2023-04-01-preview/loadtestservice.json

They have some good examples here as well.

https://github.com/Azure/azure-rest-api-specs/tree/main/specification/loadtestservice/data-plane/Microsoft.LoadTestService/preview/2023-04-01-preview/examples

AndrewCi commented 1 month ago

Any updates on this feature request? This is a complicated resource because it also requires metrics configuration to ingest into the load test and uploading of custom JMeter files. Our team tried to use the AzAPI as a stop gap, but it looks like the required data plane resource isn't currently supported for Azure Load Test. Our team has resorted to using a custom deployment script for now although our preference would be to self-contain within Terraform https://github.com/Azure/terraform-provider-azapi/issues/547