1

Can I make API calls without using service principal? I want to make at least GET requests using my credentials instead of a service principal, using PowerShell. If it is possible with Postman, it's even better.

I am referring to management API - management.azure.com. Eg. I want to get all the details of a managed disk.

Joy Wang
  • 39,905
  • 3
  • 30
  • 54

1 Answers1

1

If you want to do that with your credential, try the powershell command Get-AzureRmDisk below. Note: If your account needs multi-factor authentication, you could not use this way.

$Credential = Get-Credential
Connect-AzureRmAccount -Credential $Credential -TenantId "<TenantId>"
Get-AzureRmDisk -ResourceGroupName "<ResourceGroupName>" -DiskName "<DiskName>"

If you want to call the api in the postman, Eg. get all the details of a managed disk, you could navigate to this link Disks - Get, click the Try It button, log in and copy the Authorization token. Then go to postman, follow the doc to specify the parameters what the api need and the Authorization token, then you will be able to call the api.

Smaple:

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}?api-version=2018-06-01

enter image description here

Joy Wang
  • 39,905
  • 3
  • 30
  • 54