Skip to content

Commit 94c1d2f

Browse files
committed
updates
1 parent 3979b28 commit 94c1d2f

File tree

1 file changed

+47
-49
lines changed

1 file changed

+47
-49
lines changed

articles/app-service/app-service-web-tutorial-rest-api.md

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: 'Tutorial: Host RESTful API with CORS'
3-
description: Learn how Azure App Service helps you host your RESTful APIs with CORS support. App Service can host both front-end web apps and back end APIs.
2+
title: 'Tutorial: Host a RESTful API with CORS'
3+
description: Learn how Azure App Service helps you host your RESTful APIs with CORS support. App Service can host both front-end web apps and back-end APIs.
44
ms.assetid: a820e400-06af-4852-8627-12b3db4a8e70
55
ms.devlang: csharp
66
ms.topic: tutorial
@@ -12,42 +12,40 @@ author: msangapu-msft
1212

1313
# Tutorial: Host a RESTful API with CORS in Azure App Service
1414

15-
[Azure App Service](overview.md) provides a highly scalable, self-patching web hosting service. In addition, App Service has built-in support for [Cross-Origin Resource Sharing (CORS)](https://wikipedia.org/wiki/Cross-Origin_Resource_Sharing) for RESTful APIs. This tutorial shows how to deploy an ASP.NET Core API app to App Service with CORS support. You configure the app using command-line tools and deploy the app using Git.
15+
[Azure App Service](overview.md) provides a highly scalable self-patching web hosting service. In addition, App Service has built-in support for [cross-origin resource sharing (CORS)](https://wikipedia.org/wiki/Cross-Origin_Resource_Sharing) for RESTful APIs. This tutorial shows how to deploy an ASP.NET Core API app to App Service with CORS support. You configure the app using command-line tools and deploy the app using Git.
1616

1717
In this tutorial, you learn how to:
1818

1919
> [!div class="checklist"]
20-
> * Create App Service resources using Azure CLI
21-
> * Deploy a RESTful API to Azure using Git
22-
> * Enable App Service CORS support
20+
> * Create App Service resources using Azure CLI.
21+
> * Deploy a RESTful API to Azure using Git.
22+
> * Enable App Service CORS support.
2323
24-
You can follow the steps in this tutorial on macOS, Linux, Windows.
24+
You can complete this tutorial on macOS, Linux, or Windows.
2525

2626
[!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
2727

2828
## Prerequisites
2929

30-
To complete this tutorial:
31-
32-
* <a href="https://git-scm.com/" target="_blank">Install Git</a>
33-
* <a href="https://dotnet.microsoft.com/download/dotnet-core/3.1" target="_blank">Install the latest .NET Core 3.1 SDK</a>
30+
* <a href="https://git-scm.com/" target="_blank">Install Git.</a>
31+
* <a href="https://dotnet.microsoft.com/download/dotnet-core/3.1" target="_blank">Install the latest .NET Core 3.1 SDK.</a>
3432

35-
## Create local ASP.NET Core app
33+
## Create a local ASP.NET Core app
3634

3735
In this step, you set up the local ASP.NET Core project. App Service supports the same workflow for APIs written in other languages.
3836

3937
### Clone the sample application
4038

41-
1. In the terminal window, `cd` to a working directory.
39+
1. In the terminal window, use `cd` to go to a working directory.
4240

43-
1. Clone the sample repository and change to the repository root.
41+
1. Clone the sample repository, and then go to the repository root.
4442

4543
```bash
4644
git clone https://github.com/Azure-Samples/dotnet-core-api
4745
cd dotnet-core-api
4846
```
4947

50-
This repository contains an app that's created based on the following tutorial: [ASP.NET Core Web API help pages using Swagger](/aspnet/core/tutorials/web-api-help-pages-using-swagger?tabs=visual-studio). It uses a Swagger generator to serve the [Swagger UI](https://swagger.io/swagger-ui/) and the Swagger JSON endpoint.
48+
This repository contains an app that's created based on the tutorial [ASP.NET Core Web API help pages using Swagger](/aspnet/core/tutorials/web-api-help-pages-using-swagger?tabs=visual-studio). It uses a Swagger generator to serve the [Swagger UI](https://swagger.io/swagger-ui/) and the Swagger JSON endpoint.
5149
5250
1. Make sure the default branch is `main`.
5351
@@ -56,7 +54,7 @@ In this step, you set up the local ASP.NET Core project. App Service supports th
5654
```
5755
5856
> [!TIP]
59-
> The branch name change isn't required by App Service. However, since many repositories are changing their default branch to `main` (see [Change deployment branch](deploy-local-git.md#change-deployment-branch)), this tutorial also shows you how to deploy a repository from `main`.
57+
> The branch name change isn't required by App Service. However, since many repositories are changing their default branch to `main` (see [Change deployment branch](deploy-local-git.md#change-deployment-branch)), this tutorial shows you how to deploy a repository from `main`.
6058

6159
### Run the application
6260

@@ -67,23 +65,23 @@ In this step, you set up the local ASP.NET Core project. App Service supports th
6765
dotnet run
6866
```
6967

70-
1. Navigate to `http://localhost:5000/swagger` in a browser to play with the Swagger UI.
68+
1. Navigate to `http://localhost:5000/swagger` in a browser to try the Swagger UI.
7169

72-
![ASP.NET Core API running locally](./media/app-service-web-tutorial-rest-api/azure-app-service-local-swagger-ui.png)
70+
![Screenshot of an ASP.NET Core API running locally.](./media/app-service-web-tutorial-rest-api/azure-app-service-local-swagger-ui.png)
7371

74-
1. Navigate to `http://localhost:5000/api/todo` and see a list of ToDo JSON items.
72+
1. Navigate to `http://localhost:5000/api/todo` to see a list of ToDo JSON items.
7573

76-
1. Navigate to `http://localhost:5000` and play with the browser app. Later, you will point the browser app to a remote API in App Service to test CORS functionality. Code for the browser app is found in the repository's _wwwroot_ directory.
74+
1. Navigate to `http://localhost:5000` and experiment with the browser app. Later, you'll point the browser app to a remote API in App Service to test CORS functionality. Code for the browser app is found in the repository's _wwwroot_ directory.
7775

78-
1. To stop ASP.NET Core at any time, press `Ctrl+C` in the terminal.
76+
1. To stop ASP.NET Core at any time, select **Ctrl+C** in the terminal.
7977

8078
[!INCLUDE [cloud-shell-try-it.md](~/reusable-content/ce-skilling/azure/includes/cloud-shell-try-it.md)]
8179

82-
## Deploy app to Azure
80+
## Deploy the app to Azure
8381

8482
In this step, you deploy your .NET Core application to App Service.
8583

86-
### Configure local git deployment
84+
### Configure local Git deployment
8785

8886
[!INCLUDE [Configure a deployment user](../../includes/configure-deployment-user-no-h.md)]
8987

@@ -103,32 +101,32 @@ In this step, you deploy your .NET Core application to App Service.
103101

104102
[!INCLUDE [app-service-plan-no-h](../../includes/app-service-web-git-push-to-azure-no-h.md)]
105103

106-
<pre>
107-
Enumerating objects: 83, done.
108-
Counting objects: 100% (83/83), done.
109-
Delta compression using up to 8 threads
110-
Compressing objects: 100% (78/78), done.
111-
Writing objects: 100% (83/83), 22.15 KiB | 3.69 MiB/s, done.
112-
Total 83 (delta 26), reused 0 (delta 0)
113-
remote: Updating branch 'master'.
114-
remote: Updating submodules.
115-
remote: Preparing deployment for commit id '509236e13d'.
116-
remote: Generating deployment script.
117-
remote: Project file path: .\TodoApi.csproj
118-
remote: Generating deployment script for ASP.NET MSBuild16 App
119-
remote: Generated deployment script files
120-
remote: Running deployment command...
121-
remote: Handling ASP.NET Core Web Application deployment with MSBuild16.
122-
remote: .
123-
remote: .
124-
remote: .
125-
remote: Finished successfully.
126-
remote: Running post deployment command(s)...
127-
remote: Triggering recycle (preview mode disabled).
128-
remote: Deployment successful.
129-
To https://&lt;app_name&gt;.scm.azurewebsites.net/&lt;app_name&gt;.git
130-
* [new branch] master -> master
131-
</pre>
104+
<pre>
105+
Enumerating objects: 83, done.
106+
Counting objects: 100% (83/83), done.
107+
Delta compression using up to 8 threads
108+
Compressing objects: 100% (78/78), done.
109+
Writing objects: 100% (83/83), 22.15 KiB | 3.69 MiB/s, done.
110+
Total 83 (delta 26), reused 0 (delta 0)
111+
remote: Updating branch 'master'.
112+
remote: Updating submodules.
113+
remote: Preparing deployment for commit id '509236e13d'.
114+
remote: Generating deployment script.
115+
remote: Project file path: .\TodoApi.csproj
116+
remote: Generating deployment script for ASP.NET MSBuild16 App
117+
remote: Generated deployment script files
118+
remote: Running deployment command...
119+
remote: Handling ASP.NET Core Web Application deployment with MSBuild16.
120+
remote: .
121+
remote: .
122+
remote: .
123+
remote: Finished successfully.
124+
remote: Running post deployment command(s)...
125+
remote: Triggering recycle (preview mode disabled).
126+
remote: Deployment successful.
127+
To https://&lt;app_name&gt;.scm.azurewebsites.net/&lt;app_name&gt;.git
128+
* [new branch] master -> master
129+
</pre>
132130

133131
### Browse to the Azure app
134132

0 commit comments

Comments
 (0)