Create your first Azure Function

This topic shows you how to use the Azure Functions quickstart in the portal to create a simple "hello world" function that is invoked by an HTTP request. To learn more about Azure Functions, see the Azure Functions Overview.

Before you start, you must have an Azure account. Free accounts are available. You can also try Azure Functions without having to register with Azure.

Create a function from the portal quickstart

  1. Go to the Azure Functions portal and sign in with your Azure account.

  2. Type a unique Name for your new function app or accept the autogenerated one, select your preferred Region, then click Create + get started. A valid name can contain only letters, numbers, and hyphens. Underscore (_) is not an allowed character.

  3. In the Quickstart tab, click WebHook + API and choose a language for your function, then click Create a function. A new predefined function is created in your chosen language.

  4. (Optional) At this point in the quickstart, you can choose to take a quick tour of Azure Functions features in the portal. After you have completed or skipped the tour, you can test your new function by sending an HTTP request.

Test the function

Since the Azure Functions quickstarts contain functional code, you can immediately test your new function.

  1. In the Develop tab, review the Code window and notice that the provided code expects an HTTP request with a name value passed either in the message body or in a query string. When the function runs, this value is returned in the response message. The example shown below is a JavaScript function.

  2. Click Test to display the built-in HTTP test request pane for the function.

  3. In the Request body text box, change the value of the name property to your name, and click Run. You see that execution is triggered by a test HTTP request, information is written to the logs, and the "hello..." response is displayed in the Output.

  4. To trigger execution of the same function from an HTTP testing tool or from another browser window, copy the Function URL value from the Develop tab and paste it into the tool or browser address bar. Append the query string value &name=yourname to the URL and execute the request. Note that the same information is written to the logs and the same string is contained in the body of the response message.

Watch the video

The following video shows how to perform the basic steps in this tutorial.

Next steps

This quickstart demonstrates a simple execution of a basic HTTP-triggered function. To learn more about using Azure Functions in your apps, see the following topics:

Need some help?

Post questions in the Azure forums. - Visit MSDN

Tag questions with the keyword azure-functions. - Visit Stack Overflow