Getting started with APIs, ASP. NET, and Swagger in Azure Application Service, azureswagger

Source: Internet
Author: User
Tags app service azure sdk

Getting started with APIs, ASP. NET, and Swagger in Azure Application Service, azureswagger

This article is the first in a series of tutorials to show you how to use the functions that help develop and host RESTful APIs in Azure application services. This tutorial describes how to support API metadata in Swagger format.

Learning content:

  • Use the built-in tools in Visual Studio 2015 to create and deploy API applications in Azure application services.
  • How to Use the Swashbuckle NuGet package to dynamically generate Swagger API metadata for automatic API discovery.
  • How to Use Swagger API metadata to automatically generate the client code of the API application.
Overview of sample applications

This tutorial uses a simple to-do list sample application. This application contains the SPA front-end, ASP. NET Web API middle layer, and ASP. NET Web API data layer.


The following is the front-end screen of AngularJS.

The Visual Studio solution contains three projects:


  • ToDoListAngular-Front-end: Used to call AngularJS SPA on the middle layer.
  • ToDoListAPI-Middle Layer: ASP. NET Web API project that calls the data layer to perform CRUD operations on service items.

  • ToDoListDataAPI-Data layer: ASP. NET Web API project that performs CRUD operations on service items.

The three-tier architecture is one of the multiple architectures that can be implemented using API applications. Here, we only use it for demonstration. The code in each layer is as simple as possible to demonstrate API application functions. For example, the data layer uses server memory instead of database as the persistence mechanism.

After completing this tutorial, you will create two Web API projects that start and run in the cloud Application Service API application.

The next article in this series of tutorials will deploy the SPA front-end to the cloud.


  • ASP. NET Web API-the description in this tutorial assumes that the reader basically understands how to use ASP. NET Web API 2 in Visual Studio.

  • Azure account-you can open an Azure account.

  • Visual Studio 2015 and Azure SDK for. NET-SDK automatically install Visual Studio 2015 (if not installed ).

    • In Visual Studio, click "help"> "about Microsoft Visual Studio" to ensure that "Azure App Service Tools v2.9.1" or higher is installed.


Download the sample application and subsequent operations. If you are interested, click here to continue reading.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.