Skip to content

Latest commit

 

History

History
121 lines (93 loc) · 7.97 KB

functions-create-function-app-portal.md

File metadata and controls

121 lines (93 loc) · 7.97 KB
title description ms.topic ms.date ms.custom zone_pivot_groups
Create your first function in the Azure portal
Learn how to create your first Azure Function for serverless execution using the Azure portal.
how-to
07/03/2024
devx-track-csharp, mvc, devcenter, cc996988-fb4f-47, devdivchpfy22, devx-track-extended-java, devx-track-js, devx-track-python, build-2024, devx-track-ts
programming-languages-set-functions

Create your first function in the Azure portal

Azure Functions lets you run your code in a serverless environment without having to first create a virtual machine (VM) or publish a web application. In this article, you learn how to use Azure Functions to create a "hello world" HTTP trigger function in the Azure portal.

Choose your preferred programming language at the top of the article.

::: zone pivot="programming-language-csharp"

Note

Editing your C# function code in the Azure portal is currently only supported for C# script (.csx) functions. To learn more about the limitations on editing function code in the Azure portal, see Development limitations in the Azure portal.

You should instead develop your functions locally and publish to a function app in Azure. Use one of the following links to get started with your chosen local development environment:

You should instead develop your functions locally and publish to a function app in Azure. Use one of the following links to get started with your chosen local development environment:

You should instead develop your functions locally and publish to a function app in Azure. Use one of the following links to get started with your chosen local development environment:

Please review the known issues for development of Azure Functions using Python in the Azure portal.

Prerequisites

[!INCLUDE quickstarts-free-trial-note]

Sign in to Azure

Sign in to the Azure portal with your Azure account.

Create a function app

You must have a function app to host the execution of your functions. A function app lets you group functions as a logical unit for easier management, deployment, scaling, and sharing of resources.

Use these steps to create your function app and related Azure resources, whether or not you're able to edit your code in the Azure portal. ::: zone pivot="programming-language-csharp" To be able to create a C# script app that you can edit in the portal, you must choose 6 (LTS) for .NET Version. ::: zone-end

[!INCLUDE Create function app Azure portal]

Next, create a function in the new function app.

::: zone pivot="programming-language-python,programming-language-javascript,programming-language-powershell,programming-language-csharp"

Create an HTTP trigger function

  1. In your function app, select Overview, and then select + Create under Functions. If you don't see the + Create button, you can instead create your functions locally.

  2. Under Select a template, scroll down and choose the HTTP trigger template.

  3. In Template details, use HttpExample for New Function, select Anonymous from the Authorization level drop-down list, and then select Create.

    Azure creates the HTTP trigger function. Now, you can run the new function by sending an HTTP request. ::: zone-end
    ::: zone pivot="programming-language-java,programming-language-csharp,programming-language-typescript,programming-language-python"

Create your functions locally

If you aren't able to create your function code in the portal, you can instead create a local project and publish the function code to your new function app.

  1. In your function app, select Overview, and then in Create functions in your preferred environment under Functions.

  2. Choose your preferred local development environment and follow the steps in the linked article to create and publish your first Azure Functions project.

    [!TIP] When publishing your new project, make sure to use the function app and related resources you just created. ::: zone-end

Test the function

[!INCLUDE functions-test-function-portal]

Clean up resources

[!INCLUDE Clean-up resources]

Next steps

[!INCLUDE Next steps note]