Hi @Himanshu Vaish ,
Thanks for reaching out.
Currently we don't have any direct sample for your scenario. You can leverage below samples to
Get service Principal Id using Python:
https://learn.microsoft.com/en-us/azure/developer/python/sdk/authentication-local-development-service-principal?tabs=azure-portal
https://github.com/azureossd/python-sdk-aad-samples/tree/main/python-sdk-graph-samples
Authenticate users using Python:
https://github.com/Azure-Samples/ms-identity-python-webapp
Executing PowerShell commands using Python:
https://www.phillipsj.net/posts/executing-powershell-from-python/
Hope this will help.
Thanks,
Shweta
-----------------------------------------
Please remember to "Accept Answer" if answer helped you.