How to call REST APIs on Azure Portal

Sometimes , we may facing this situation : we have a requirement and we can finish the process on portal manually . However , we can’t find the associated APIs to do it automatically by code. So , this blog will provide a way to call all APIs you can fetch on Azure portal. Prerequisites An active Azure subscription. An Azure subscription account. Eamples For instance, let’s say , I want to enable “application proxy” in AAD :  As we all know ,there is no SDK, powershll or APIs published by Microsoft officially, we can do this function on Azure portal manually... Read more

How to get the authorization header for accessing Cosmos DB REST API by using Java

All Cosmos DB REST operations, whether you’re using a master key token or resource token, must include the authorization header with the authorization string in order to interact with a resource. This article will show you how to get the authorization header by using  Java. The authorization string has the following format: type={typeoftoken}&ver={tokenversion}&sig={hashsignature} {typeoftoken} denotes the type of token: master or resource. {tokenversion} denotes the version of the token, currently 1.0. {hashsignature} denotes the hashed token signature. I will use “master” for typeoftoken and “1.0” for tokenversion. The key part is hashsignature. So let us see how to get the hashsignature. The... Read more

How to use REST API to assign CSP subscription roles to new created CSP customer .

As we all know, as a CSP direct partner, we can create a customer with a CSP Azure subscription .However due to the CSP internal mechanism, The customer has no access to the CSP Azure subscription. CSP partners should logon to the Azure portal and assign CSP Azure subscription roles to the customer manually and then the customer is enable to access the CSP Azure subscription we created. Yes, doing some actions manually is not so convenient for us. So this blog mainly provides a way to assign CSP Azure subscription roles to CSP customers via REST API so that... Read more

How to invoke https service protected by self-signed certificate from azure app service

When we use azure web app, we usually need to invoke the outside service. In order to protect the service, some companies usually secure it via https. But when we do some local test, we use the self-signed certificate to protect the service. Usually, we only need to add the client certificate to trusted list when we invoke the https service. Unfortunately, web app doesn’t provide us the administrator privilege and the high privilege operations cannot be executed. What shall we do? Here I will show you how to change the verification rules of the certificate. Steps: Export the client... Read more

How to enable diagnostics in windows VM using Azure REST API

Azure diagnostics extension can provide monitor and diagnostic functions on Azure virtual machine. You can include the diagnostic feature when creating Azure virtual machine if you add the diagnostic extension to the template, which is introduced in this article.If you have created a Azure virtual machine without the diagnostic extension,you can enable it separately. Here is an blog which provides the steps on how to implement it in Azure portal. Today I will show you how to enable diagnostic in a existed windows virtual machine using Azure REST API. Preparation: You must have a Azure subscription,you can get it here. an Azure windows virtual machine,you... Read more

How to upload a blob to azure storage by Rest API

Microsoft provides quite a few SDKs for Azure storage service, which make you quite easy to access azure storage programmatically.  But in some special cases, you still need to access Azure storage using REST API. In this article, I will talk about how to use Azure Storage REST API to implement a common user scenario. I will create a container on azure storage, upload a file and finally delete the file by Rest API.  To make it easier, I use php to construct the request and test it via Curl. Prerequisite: Before you get started, make sure that you have set up your development environment: An... Read more

Add, Remove and Resize VM Data Disk using Azure REST API

It is a common need that some developers want to add, remove or resize VM data disk when they decide to take a secondary development on Azure VM service. Now, this article will show you how to implement it by Azure REST API. Before we start, you should know the size of your VM, because the availability of disk type and disk amount could be different from various sizes of the VM. You will get an error response if you tried to add a disk whose type was not support by your VM. For more infomation, please see : Sizes for Windows... Read more