官术网_书友最值得收藏!

Visual Studio Code

Visual Studio Code is one of the most diffuse source-code editors in the world and can be used on Windows, macOS, and Linux. It is an open source project managed by Microsoft in collaboration with a wide community of developers and, of course, it supports Azure Functions.

You can download Visual Studio Code from the official website at https://code.visualstudio.com/Download, while the GitHub repository is at https://github.com/Microsoft/vscode.

To develop an Azure Functions project, follow these steps:

  1. Install the Azure Functions extension for Visual Studio Code. You can find it by searching in the Extensions tab of Visual Studio Code:

The Azure Functions extension also needs the Azure Account extension to manage your Azure account, and to build and debug Azure Functions, you need the C# for Visual Studio Code extension (powered by OmniSharp).

  1. Once you install the extensions, the first thing you will notice is that there is a new tab, identified by the Azure logo, on the left-hand side of the Visual Studio Code window. That is the activity tab you can use to create a new function app:
  1. When you create a new Azure Functions project by pressing the Create Function... button (at the top of the Azure Functions tab), you must choose the folder where you want to save the project, and then you must select the language you want to use:
  1. Once Visual Studio Code completes the project creation, you will see the file created under the folder you chose on the left-hand side of the Visual Studio Code window, in a new workspace:
  1. The next step allows you to create the Azure Function, and you can do so using the Create new function button at the top of the Azure Functions tab. The Azure Functions extension asks you all the mandatory information for the function (such as the trigger type, the name of the function, its namespace, and the storage configuration) using a wizard. For example, the following screenshot shows the function trigger type selection:

The following one shows a function name request:

  1. Finally, if you are developing an HttpTrigger function, you must select the AccessRights for the function:

At the end of the function configuration wizard, Visual Studio Code creates the class file containing the function:

  1. To debug your function, you can use the Debug tab and run the configuration named Attach to C# function created.

This is the default configuration created by the Azure Functions extension and uses Azure Functions Core Tools in the same way you can do with the command line (or Visual Studio).

主站蜘蛛池模板: 固阳县| 青海省| 南充市| 靖江市| 平邑县| 巫山县| 平顶山市| 广汉市| 扎赉特旗| 高淳县| 望奎县| 泰宁县| 绥滨县| 乌拉特后旗| 莱芜市| 新干县| 布拖县| 栖霞市| 定州市| 阿合奇县| 甘孜县| 富裕县| 湾仔区| 鲁山县| 崇信县| 水富县| 上犹县| 英超| 剑阁县| 五大连池市| 富蕴县| 平乡县| 璧山县| 石柱| 泗阳县| 漳平市| 张家界市| 岫岩| 句容市| 厦门市| 海阳市|