CPM - How to manage Azure Account using API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

PAM SaaS Articles
2 min read
L0 Member
No ratings

How to verify Azure accounts outside of Idira using Azure API calls?
In this guide, we will use BRUNO.

Steps

Download BRUNO and place it in the CPM server.
https://www.usebruno.com/


To access using Reconcile account(Application Account)
POST
https://login.microsoftonline.com/<Active Directory ID>/oauth2/token? ---> This information can get in debug logs

Body
grant_type=client_credentials
client_id=<Application ID>
client_secret=<application secret>
scope=https://graph.microsoft.com/.default

ka3Vy000005PCO5IAO__eid=ka3Vy000005PCO5&feoid=00N2J000009R3kv&refid=0EMVy00000GeKI9.png

Once you successfully send the above API to Azure, you will get an access token. Copy the access token and update it to the below Patch API call in Headers Authorization.


To access using Target account (Azure AD)
POST
https://login.microsoftonline.com/<Active Directory ID>/oauth2/token? ---> This information can get in debug logs

Body
grant_type=password
client_id=<Application ID>
scope=https://graph.microsoft.com/.default
username=<target account username in PVWA>
password=<target account password>

ka3Vy000005PCO5IAO__eid=ka3Vy000005PCO5&feoid=00N2J000009R3kv&refid=0EMVy00000GeMIL.png
Once you successfully send the above API to Azure, you will get an access token. Copy the access token and update it to the below Patch API call in Headers Authorization.

**Please take note that the API will not handle MFA. You will need to disable the AAD account's MFA for this to authenticate successfully to get the token.


REST API Call to update target account password.
PATCH
https://graph.microsoft.com/v1.0/users/<Target Account ID>?  ---> This information can get in debug logs

Headers
Authorization=<access_token>
Content-Type=application/json

Body
{
"passwordProfile": 
  {
    "forceChangePasswordNextSignIn": false,
    "password": "Cyberark123"
  }
}

ka3Vy000005PCO5IAO__eid=ka3Vy000005PCO5&feoid=00N2J000009R3kv&refid=0EMVy00000GeNhR.png
In the PATCH API call, nothing will get returned in the body below as soon as the Status shows HTTP 200, which means the password has been successfully updated.
 

Rate this article:
  • 2687 Views
  • 0 comments
  • 0 Likes
Article Dashboard
Version history
Last Updated:
‎11-05-2026 11:51 AM
Updated by: