In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Azure Functions is a serverless computing service that allows you to run code on demand without explicitly configuring or managing the infrastructure. In this tutorial, we will help you start with the original Azure functionality. We will use Visual Studio Code to guide you through the installation process, create your first functional application, and finally deploy the application to Azure.
Prerequisites first, you need an Azure account, an Azure account. You also need to install Visual Studio Code and Node.js npm. To enable local debugging, you also need to install Azure Functions Core Tools.
Before installing Azure Function core tools, you need to finish installing npm, then open a command prompt and enter the following command:
$npm install-g azure-functions-core-tools@2
If you are an Apple computer, please enter:
$brew tap azure/functions
$brew install azure-functions-core-tools
Next, we will install the extension of Azure Function on VS Code. You can directly search for Azure Function in VS Code and install it, or open the following link directly in your browser:
Vscode:extension/ms-azuretools.vscode-azurefunctions
So how can you verify that the Azure Function extension is installed successfully? You can open a command prompt and type func
Create a local Function application using VS Code:
First, create a local Azure Functions application. Azure Functions applications can contain many functions with various triggers, and in this article we'll start with an introduction to HTTP triggers, which allow you to handle incoming HTTP traffic.
Click create New Project under Azure Function, which will let you choose the path where the project is stored, and then select JavaScript.
Add functions to your Function application:
From AZURE FUNCTIONS Explorer, click the create function icon.
Select the currently open directory and press Enter. When prompted, select the HTTP trigger
Use the default name HttpTriggerJS
Then select anonymous authentication.
When you are done, you will create a new directory called HttpTriggerJS that contains index.js and functions.jsonfiles in your Function application. The index.js file contains the source code that responds to the HTTP request, and the functions.json contains the binding configuration for the HTTP trigger.
Run and test your application locally:
Once you have created your Azure Function application, it is necessary to run it locally, and VS Code will run it locally, just like the environment on Azure.
You can press F5 to debug the application.
In about 2 minutes you will see the following link in the terminal:
Use a browser to open the address above, and then add the value of name to see the effect.
Deploy the application to Azure Function:
First of all, you need to log in to your Azure on VS CODE
Click the upload button
Select the path to your project file
Choose to create a new Function APP
Enter the name of your Function app, which requires a unique value
Select a resource group, or you can create a new resource group
Choose a storage account, or you can create a new one
After the execution is completed, you will see the status of the execution in the interface.
When you are done, you will see a URL in the output bar, open the link, then add the name value, and you will see the result of the request.
At this point, your Azure Function APP is created, isn't it convenient?
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.