3
votes

Looking through the Azure Reference I can't find any references to the REST API (or any API) for Azure App Services, Service Plans, Web apps etc

Is there a REST API for Azure App Services?

I have seen Are there no Rest Api for deploying Azure Websites? But there have been a huge number of changes to Azure since 2013.

3

3 Answers

6
votes

yes, there is REST API for all azure resources. and they all thru Azure Resource Manger

https://msdn.microsoft.com/en-us/library/azure/dn790568.aspx

to learn about the API, there is also a portal for you to play with https://resources.azure.com

Update:

Azure resources are managed by ARM API

e.g if you want to delete a website, you will make bellow http request against your site

DELETE https://management.azure.com/subscriptions/{subscription id}/resourceGroups/{resource group}/providers/Microsoft.Web/sites/{site name}?api-version=2015-08-01

https://resources.azure.com is a great place for you to learn about ARM REST API, resource structure, what uri to use and what payload to be expected.

3
votes

There isn't any up-to-date documentation at the moment. What I recommend you do in the meantime is to take a look at Azure Resource Explorer:

https://resources.azure.com

Log in with your Azure credentials and navigate to a subscription you have which contains some App Service resources (web apps, etc.). From there, you can browse your resource groups and find everything else in that subscription.

You'll notice that as you navigate around, you'll notice that the right-hand pane displays the URL of the resource and you can even issue GET/PUT/POST/DELETE commands against those resources using the buttons provided. Under that, you will see the actual JSON payload associated with that resource. You can use these all as hints for how you would construct a REST API call.

In some cases, you can get some actual documentation on the various fields if you click on the Documentation button for a particular resource you're viewing. This doesn't always seem to work, however. If you're feeling like going down the advanced path, you can also get the official swagger documentation for the App Service REST API in Github: https://github.com/Azure/azure-rest-api-specs/blob/master/arm-web/2015-08-01/swagger/service.json

1
votes

UPDATE - 01-Mar-2017

The answer below is obsolete as when the answer was provided the REST API was not documented. It is now :). The REST API documentation is available here: https://docs.microsoft.com/en-us/rest/api/appservice/.


I'm sure that there's a REST API. It's just that it is not documented yet.

Whenever I need to find REST API for something that has not been documented, one thing I normally do is run Azure PowerShell Cmdlets in debug mode. It tells me all the information I need (though I must say that it is not a substitute for documentation).