Hi @Sina Salam
To receive an access token, I am using the OAuth2 flow. I'll try to be more clear about the process I've implemented so far.
Until now, my flow has been as follows:
- I had a user-defined variable for retrieving the client secret, which I referenced in the Load Test environment:
${__GetSecret(client_secret)}
- I used this variable in my POST request:
curl -X POST
'https://login.microsoftonline.com/${__P(tenant_id)}/oauth2/token'
-H 'Content-Type: application/x-www-form-urlencoded'
-d 'grant_type=client_credentials&client_id=${__P(client_id)}&client_secret=${client_secret}&resource=https://api.kusto.windows.net'
- Next, I added two processors (JSON Extractor and JSR223) to retrieve the token from the response:
props.put("access_token", "${token}")
- I was then able to use the
access_token
in my desired requests that required a Bearer token, with this header:
Bearer ${__property(access_token)}
In the new flow, I need to use a certificate that stored in Azure Key Vault instead of the client secret that I used so far.
Best regards,
Oz