In the last blog I should how to retrieve an Azure resource. In this blog I’ll show you how to create one.
Creating an Azure Resource Group
All Azure resources are created in a resource group so this is a good one to begin with.
First of all let’s check if our Resource Group exists. If you followed along in parts 3 and 4 of this series, the following Postman requests will make sense.
Using the reference here we create the following request. Notice we used HEAD as our request type and since our resource Group PostmanRG did not exist, Status: 404 Not Found was returned.
Let’s create the Resource Group using the reference here.
We need to include Content-Type:application/json in the request header since this is a PUT request. Looking at the reference there is just one mandatory parameter called location which is the region where we store the resource group metadata.
Creating a Logical SQL Server
Let’s create a logical server called denham-postman-us in our newly created resource group using the reference here. This operation happens in the background and therefore the request ends immediately with a Status: 202 Accepted. It does not tell you if it fails. You need to monitor the Activity Log for the resource group to determine whether the operation has worked.
Creating a SQL Database
Let’s create a SQL Database called Postman in our newly created resource group using the reference here. This operation happens in the background and therefore the request ends immediately with a Status: 202 Accepted. It does not tell you if it fails. You need to monitor the Activity Log for the resource group to determine whether the operation has worked.
A quick look in the resource group shows our deployed resources.
I mentioned above we need to check the Activity Log in the Azure Portal to determine if the requests were successful. In the next blog I will show you how we monitor async operations using the REST API.