Run the sample load test to gain understanding on the components of the test and how they interact using the steps described here.
- An Azure AD B2C Tenant instance. 1.User with the following permissions: [SEE PERMISSIONS NEEDED]
- An Azure Function app instance.
- The sample Web API deployed.
- An Applications Insights instance.
- An instrumentation key value.
- An Azure Load Testing instance.
To understand how set up the tenant to run custom policies, and how to obtain the values needed for this step please refer to the documentation here.
Open the custom policy files provided here
Replace "yourtenant" with the tenant name in all policy files.
Replace "ProxyIdentityExperienceFrameworkAppId" and "IdentityExperienceFrameworkAppId" with the corresponding values for your tenant.
Replace the string "[Replace with App Insights Instrumentation Key]" with the corresponding key.
Replace the string "[Replace with Web API URL]" with the url of the Azure Function.
Upload the custom policies to the tenant in this order (assuming that Base, Localization and Extension files are already present) in this order:
- TrustFrameworkExtensions_LoadTest.xml
- Signin_LoadTest.xml
Validate that no errors are shown after upload to continue.
It is important that the set of users created / configured in the tenant are the same used in JMETER CSV configuration item.
A sample python script that creates users from a CSV is provided here
An alternative sample using C# can be found here
The following User Defined Variables need to be configured with the proper values in the JMETER USer Defined Variables:
- client_id: the id of the app registration, for example: d20df654-c14d-4a72-8679-b68c94a44132
- policy_name: the name of the policy for example: B2C_1A_SIGNIN_LOADTEST
- redirect_uri: the redirection uri of the app registration, for example: https://jwt.ms
- scope: the scope that will be used for the policy, for example: openid
- tenant_id: the id of the Azure B2C Tenant, for example: 432ce9fc-6b3d-4f59-93d7-8e1112dfed13
- custom_domain: the domain name of the Azure AD B2C instance. If not using custom domains, for example: yourtenant.onmicrosoft.com
If JMETER is installed on the system open the JMETER test plan and replace these User Defined Variables
If JMETER is not installed open the test plan xml file and replace the values of the User Defined Variables directly, in the "Arguments" nodes as shown below:
Please refer to Azure Load Testing documentation for details.