I'm currently evaluating replacing Visual Studio load testing projects with k6 on a large multi-tenant micro-services project, however I could not find examples on AzureAD and MSAL.js library authentication/integration and ACI hosting support.
Links
https://docs.microsoft.com/en-au/azure/container-instances/
https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics
https://github.com/AzureAD/microsoft-authentication-library-for-js
@MedAnd I investigated a little how it could be done.
Each of the tests would need to authenticate with different AzureAD instances.
I am not sure if MASL.js library will work in k6 because of the current limitations of JS libraries.
MASL.js looks to be a utility to interact with the Microsoft Identity Platform/Azure AD and I think you can create an HTTP request in your script to authenticate the user to perform the requests to your REST API endpoints.
According to Microsoft docs:
If you don't have yet a library for your language of choice, you might want to use the protocol directly
POST /{tenant}/oauth2/v2.0/token
Execute load tests continually (e.g for 24 hours+) in Azure DevOps pipelines, in a distributed in a distributed manner
The guide How to integrate your k6 load tests with Azure Pipelines is a good reference.
@ppcano - appreciate the follow-up! We tested use of MSAL in a simple load test and as you noted MSAL.js is meant for interactive use, not automated login as is required for load testing.
I'm currently checking with the MS Azure AD team on the best way forward and will share an update here.
Hey there, @MedAnd !
Just wanted to follow up with you and see whether you actually got this working in the end? It seems like something that might benefit other k6 users as well.
Thank you in advance!
Best,
Simme
Howdy @simskij - almost forgot this request but a change of client meant I never implemented. Given it's almost been a year, maybe the team behind k6 have implemented Azure AD integration 馃檪 ?
Closing this then. Thanks for replying!
Most helpful comment
@MedAnd I investigated a little how it could be done.
I am not sure if
MASL.jslibrary will work ink6because of the current limitations of JS libraries.MASL.jslooks to be a utility to interact with the Microsoft Identity Platform/Azure AD and I think you can create an HTTP request in your script to authenticate the user to perform the requests to your REST API endpoints.According to Microsoft docs:
The guide How to integrate your k6 load tests with Azure Pipelines is a good reference.