Quickstart: Create your first Azure Function

This guide walks you through creating your first Azure Function using the Azure portal. You'll create a simple HTTP-triggered function that returns a message.

Prerequisites

Step 1: Create a new Function App

1. Navigate to the Azure portal.
2. In the search bar, type Function App and select it.
3. Click Create.
4. On the Basics tab, configure the following settings:
  • Subscription: Select your Azure subscription.
  • Resource Group: Select an existing resource group or create a new one.
  • Function App name: Enter a globally unique name.
  • Publish: Select Code.
  • Runtime stack: Select .NET (or your preferred language).
  • Version: Select the appropriate version.
  • Region: Choose a region close to you.
5. Click Review + create, then Create.

Step 2: Create an HTTP-triggered Function

1. Once the Function App is deployed, go to the resource.
2. In the left menu, select Functions.
3. Click Create.
4. In the Create Function blade, select the HTTP trigger template.
5. Name your function (e.g., MyHttpTrigger) and set the Authorization level to Anonymous for simplicity.
6. Click Create.

Step 3: Test your Function

Your HTTP-triggered function is ready to be tested. You can get the function's URL from its properties.

1. In the function's blade, select Get function URL.
2. Copy the URL and paste it into your web browser or use a tool like Postman. You should see a JSON response.

Example response:

{
  "message": "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."
}
            
Note: For production scenarios, consider using a more secure authorization level than Anonymous.

Next Steps

Congratulations! You've created and tested your first Azure Function. Now you can explore: