Skip to content
Advertisement

How create/delete secrets of Azure service principal by using another service principal with REST API or Python SDK?

I have 2 app registration (2 service principals). First of them I use as my credentials to have token. I need from my Python script to create and delete the secrets of the second service principal. Unfortunately, I did not find such an example in the documentation. How can I do that?

Advertisement

Answer

You can use the below code for your requirement :

Add Client_Secret:

JavaScript

Outputs:

enter image description here

enter image description here

Remove Client_Secret:

JavaScript

Output:

enter image description here

enter image description here

Note: MSGRAPH-core python sdk is in Preview only and to use you have to install using pip install msgraph-core

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement