There is always a moment when PowerShell, Azure CLI or ARM Template are not enough. Then you can use REST Azure API to automate some or all the task in Azure. In this article, we are going to do a REST call towards an Azure API using powershell script. For this, we should have a Service Principal to get an access token (via Oauth2 Client Credentials Grant ) for our API. Refer this to learn how to create & use Service Principal: Authenticating using a Service Principal We will call Azure Rest API to get all the resources from Resource Group: Resources - List By Resource Group Powershell script to call Azure Rest API Fill the parameters & run the below command to retrieve Azure resources: # ----------------- define variables ----------------- $client_id ="<<Application ID>>" $tenant_id= "<<Directory ID" $client_secret="<<Client secret>>" $subscriptionId="<<Subscription ID>>" $Resource