8614. Deploying ASP.NET RESTful API to Azure
Azure


Deploy the RESTful API built with ASP.NET Core to Azure.

1. ASP.NET Core Project

Download the project from Github.

git clone https://github.com/jojozhuang/restful-api-aspnet.git

2. Publish

Open this ASP.NET project in Microsoft Visual Studio, compile it. Then, right click on the project and choose ‘Publish’ -> ‘Publish to Azure’.

After login with your Azure account, you should see the existing app services on Azure. Click the ‘New’ button. image
Set the App Name, Subscription and Resource Group, click ‘Create’ button. image
Visual Studio will start deploying the RESTful Api to Azure. image
On the top of Visual Studio, you should see the deployment status. image
And it shows ‘Published’ when it’s done. image

3. Azure Portal

Log onto Azure Portal: https://portal.azure.com/. Go to App Services, we see the ‘gamestore-api’ service. image Click on it, then we see the URL for our api, https://gamestore-api.azurewebsites.net. image Append ‘api/products’ to the URL(e.g. https://gamestore-api.azurewebsites.net/api/products), put it into web browser’s address bar. The api works and returns correct products list. image

4. References