Azure Api App – Continuous deployment to Azure from local git repository

You may or may not have seen this article that talks about continuous deployment to azure for app service. The thing I want to point out is that the article covers within the context of a web app. You can pretty much do the same thing for API apps as well. If you just looked at the properties of the API app it may not be quite clear. UI is not quite intuitive at this point, hopefully by GA all these will be sorted out. This post I will cover how to configure continuous deployment for API apps.

Once you develop the API app in visual studio, you first need to publish it. If you are new to API app, have a look at Brady Gaster’s article on azure.com. After you have published the Api app to azure, select the Api app in azure portal and click on API app host link (see screen shot below). API app host is basically an Azure web app, were we will need to follow the same steps described in the article for continuous deployment that I shared earlier. If you haven’t configured continuous deployment for web apps I suggest you read that article before also there is plenty of walkthrough’s online published by various folks within azure team.

image

For the purposes of this article I’ve gone and configured continuous deployment for the api host web app for twitterinsights api app. Currently the API looks like below

image

You can also see from the screen shot below that I have connected the api host web app to local git repository and set deployment credentials as well as provided hook for my local git repository (remote git URL for api host web app)

image

Next I will go ahead and update the api and commit to my local git repository, this is just to illustrate the continuous deployment is working correctly. For demonstration purposes I updated the route as shown below

image

Next we will need to push the changes to remote repository by running command below, again this is clearly described in the continuous deployment article shared earlier.

image

You can see from the screenshot below that changes were successfully deployed

image

Finally just to prove that there is no smoke and mirrors you can see in the swagger UI below that my changes are indeed pushed to azure.

image

Hope that helps, one final word is you can use all the supported source control repositories it doesn’t just have to be local git repository. Hope you are just excited as I am about Azure App Service and the possibilities it brings for developers.

Cheers,

Ram