Azure Management Api | Part One

This guide will show you how to set up credentials for using the Azure Management API in order to make some basic read and update requests. A follow up guide will run through using the API using Postman.

The very first thing to do is to create an App Registration, this will act as the ‘user’ which will perform the CRUD operations through the Management API.

Firstly, head to App Registrations in the portal and create a new registration as per below.

New Registration Screenshot


Next, give it a suitable name and choose a Tenant scope: -

Naming the Registration


Once created, we’ll need to generate a client secret. Check the screenshot below to do this and give it a suitable name and expiration period.

New Secret Naming New Secret


Once the secret is created, be sure to copy the value and save it somewhere. Once you leave this screen, the value is never displayed again.

Secret Created


You’ll also need to take a note of the Application (client) ID from the overview screen; together with the secret value above, these two will be used as the credentials to request access tokens.

Client ID


The last stage in the portal is to give your App Registration some permissions. This can be done via the IAM section of most resources by adding a role assignment and you can be as broad or granular as you like (management group, subscription, resource group, individual resource…)
In the screenshots below I’m giving my new App Registration Owner rights over my subscription.

IAM Screen Assigning Role to App Registration


At this point we have a working set of credentials that will have permissions to perform CRUD operations on our subscription.

In part 2 , we’ll look at using these credentials with Postman as our API client.

part 2 live as of 30/07/2022


Comments

comments powered by Disqus