I essentially have to run a Python script that has AZ CLI commands baked into the script and get spawned as processes from the subprocess module. In order for these commands to run, I need to be logged in to AZ CLI.
I have a AZ CLI task in my pipeline of which setting the addSpnToEnvironment = true provides me the $env:servicePrincipalId, $env:servicePrincipalKey and $env:tenantId. My question is, how can I use these details to now sign in to AZ CLI so that the context is maintained in the task and the AZ CLI commands in my Python script recognize this and can execute?