Many of the articles I have found online with regards to the Azure REST API assume a fair level of familiarity with Azure which can be a good and bad thing. You see the Azure Portal makes interacting with the Azure REST API very easy as a lot of the “prerequisite” work is done in the portal as part of the process. For this blog post we will work on something quite basic, “Create a Virtual Machine”.
Jon Gallant has some great content around this and I did use some content from here, thank you Jon Gallant.
Within the Azure Portal this is very easy and only requires a few clicks, however under the hood, in order for the Azure REST API to work, there is a lot more going on. Lets dive in :smile:
There is a lot of association and the like that goes on in the background.
So, what I have done, is simply create a collection within Postman that uses both collection variables and “Pre-request” scripts to make this collection “portable”.
I use a set of collection variables to help with the initial API Call.
With each of the call you will the variables enclosed with “{}” and path variables prefixed with “:”
With most of the Postman queries, the “Pre-request Script” is also used, this is used to set “extra” pieces of information, for example, specifying a location for the Resource Group.
So, go forth and play. My Postman Collection can be found here