Introduction
In this article you’ll learn how to use API Apps from the Azure portal to host your RESTful APIs and the data live. Before understanding or using API Apps in
Azure, just go through the actual benefits of App Services.
To use API Apps services from Azure, first create your rest service. Open your Visual Studio and create a web application with Web API references.
Select a template with Web API to get a default ready made API controller by Visual Studio with the name “ValuesController”.
This is your ready made solution for API in Visual Studio with a Values name Controller.
There is an httpGet method for testing. So, I am not going to make a new one because I can test this only.
If I run this on localhost the first time you’ll get exception because your default API controller is having an Authorize attribute. So if you want just testing, go to controller file.
Now remove this, without removing it you have to authorize for this application.
Now if you run your application, you’ll get your data from values controller as XML document.
Now login with your account and follow the below given steps.
Click on New, Web + Mobile, then API App.
Just fill the details for your API to make a space at azure with the application name.
After clicking on Create button you will get notification for success.
Now you can see your API App service in Dashboard.
If you want to see more details, just click on the name of API app Service.
Now just go to your solution in Visual Studio and right click on application name, then find Publish.
Select Microsoft Azure API Apps .
Click on next or publish and login with your Azure Account in Visual Studio.
Now you can find your already created APIs or you can create new directly from Visual Studio without using Azure Portal.
After that, I’ll get all DNS or FTP details and allow you to publish.
Now just click on publish and browse this into browser, you’ll get your API data.
I hope you enjoyed this article. Stay tuned with me for more articles on Azure and other Microsoft technologies.
Thanks.
Connect (“Nitin Pandit”);
Read more articles on Azure: