Skip to content

Commit 29070fa

Browse files
author
dksimpson
committed
Add articel Create a function app on Linux
1 parent da6b5fe commit 29070fa

12 files changed

+58
-37
lines changed

articles/azure-functions/create-function-app-linux-app-service-plan.md

Lines changed: 58 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Create a function app on Linux from the Azure portal
33
description: Learn how to create your first Azure Function for serverless execution using the Azure portal.
44
ms.topic: how-to
5-
ms.date: 02/28/2019
5+
ms.date: 04/29/2020
66
#Customer intent: As a developer, learn how to use the Azure portal so that I can create a function app that runs on Linux in App Service plan so that I can have more control over how my functions are scaled.
77

88
---
@@ -22,75 +22,96 @@ Sign in to the Azure portal at <https://portal.azure.com> with your Azure accoun
2222

2323
You must have a function app to host the execution of your functions on Linux. The function app provides an environment for execution of your function code. It lets you group functions as a logical unit for easier management, deployment, scaling, and sharing of resources. In this article, you create an App Service plan when you create your function app.
2424

25-
1. Select the **Create a resource** button found on the upper left-hand corner of the Azure portal, then select **Compute** > **Function App**.
25+
1. From the Azure portal menu or the **Home** page, select **Create a resource**.
2626

27-
![Create a function app in the Azure portal](./media/create-function-app-linux-app-service-plan/function-app-create-flow.png)
27+
1. In the **New** page, select **Compute** > **Function App**.
2828

29-
2. Use the function app settings as specified in the table below the image.
29+
:::image type="content" source="./media/create-function-app-linux-app-service-plan/function-app-create-flow.png" alt-text="Create a function app in the Azure portal":::
3030

31-
![Define new function app settings](./media/create-function-app-linux-app-service-plan/function-app-create-flow2.png)
31+
1. On the **Basics** page, use the function app settings as specified in the following table.
3232

33-
| Setting | Suggested value | Description |
34-
| ------------ | ------- | -------------------------------------------------- |
35-
| **App name** | Globally unique name | Name that identifies your new function app. Valid characters are `a-z`, `0-9`, and `-`. |
36-
| **Subscription** | Your subscription | The subscription under which this new function app is created. |
37-
| **[Resource Group](../azure-resource-manager/management/overview.md)** | myResourceGroup | Name for the new resource group in which to create your function app. |
38-
| **OS** | Linux | The function app runs on Linux. |
39-
| **Publish** | Code | The default Linux container for your **Runtime Stack** is used. All you need to provide is your function app project code. Another option is to publish a custom [Docker image](functions-create-function-linux-custom-image.md). |
40-
| **[Hosting plan](functions-scale.md)** | App Service plan | Hosting plan that defines how resources are allocated to your function app. When you run in an App Service plan, you can control the [scaling of your function app](functions-scale.md). |
41-
| **App Service plan/Location** | Create plan | Choose **Create new** and supply an **App Service plan** name. Choose a **Location** in a [region](https://azure.microsoft.com/regions/) near you or near other services your functions access. Choose your desired **[Pricing tier](https://azure.microsoft.com/pricing/details/app-service/linux/)**. <br/>You can't run both Linux and Windows function apps in the same App Service plan. |
42-
| **Runtime stack** | Preferred language | Choose a runtime that supports your favorite function programming language. Choose **.NET** for C# and F# functions. |
43-
| **[Storage](../storage/common/storage-account-create.md)** | Globally unique name | Create a storage account used by your function app. Storage account names must be between 3 and 24 characters in length and may contain numbers and lowercase letters only. You can also use an existing account, which must meets the [storage account requirements](storage-considerations.md#storage-account-requirements). |
44-
| **[Application Insights](functions-monitoring.md)** | Enabled | Application Insights is disabled by default. We recommend enabling Application Insights integration now and choosing a hosting location near your App Service plan location. If you want to do this later, see [Monitor Azure Functions](functions-monitoring.md). |
33+
| Setting | Suggested value | Description |
34+
| ------------ | ---------------- | ----------- |
35+
| **Subscription** | Your subscription | The subscription under which this new function app is created. |
36+
| **[Resource Group](../articles/azure-resource-manager/management/overview.md)** | *myResourceGroup* | Name for the new resource group in which to create your function app. |
37+
| **Function App name** | Globally unique name | Name that identifies your new function app. Valid characters are `a-z` (case insensitive), `0-9`, and `-`. |
38+
|**Publish**| **Code** (default) | Option to publish code files or a Docker container. |
39+
| **Runtime stack** | Preferred language | Choose a runtime that supports your favorite function programming language. Choose **.NET Core** for C# and F# functions. |
40+
|**Version**| Version number | Choose the version of your installed runtime. |
41+
|**Region**| Preferred region | Choose a [region](https://azure.microsoft.com/regions/) near you or near other services your functions access. |
4542

46-
3. Select **Create** to provision and deploy the function app.
43+
:::image type="content" source="./media/create-function-app-linux-app-service-plan/function-app-create-basics-linux.png" alt-text="Basics page":::
4744

48-
4. Select the Notification icon in the upper-right corner of the portal and watch for the **Deployment succeeded** message.
45+
1. Select **Next : Hosting**. On the **Hosting** page, enter the following settings.
4946

50-
![Define new function app settings](./media/create-function-app-linux-app-service-plan/function-app-create-notification.png)
47+
| Setting | Suggested value | Description |
48+
| ------------ | ---------------- | ----------- |
49+
| **[Storage account](../articles/storage/common/storage-account-create.md)** | Globally unique name | Create a storage account used by your function app. Storage account names must be between 3 and 24 characters in length and can contain numbers and lowercase letters only. You can also use an existing account, which must meet the [storage account requirements](../articles/azure-functions/functions-scale.md#storage-account-requirements). |
50+
|**Operating system**| **Linux** | An operating system is pre-selected for you based on your runtime stack selection, but you can change the setting if necessary. |
51+
| **[Plan](../articles/azure-functions/functions-scale.md)** | **Consumption (Serverless)** | Hosting plan that defines how resources are allocated to your function app. In the default **Consumption** plan, resources are added dynamically as required by your functions. In this [serverless](https://azure.microsoft.com/overview/serverless-computing/) hosting, you pay only for the time your functions run. When you run in an App Service plan, you must manage the [scaling of your function app](../articles/azure-functions/functions-scale.md). |
5152

52-
5. Select **Go to resource** to view your new function app.
53+
:::image type="content" source="./media/create-function-app-linux-app-service-plan/function-app-create-hosting-linux.png" alt-text="Hosting page":::
5354

54-
Next, you create a function in the new function app. Even after your function app is available, it may take a few minutes to be fully initialized.
55+
1. Select **Next : Monitoring**. On the **Monitoring** page, enter the following settings.
5556

56-
## <a name="create-function"></a>Create an HTTP triggered function
57+
| Setting | Suggested value | Description |
58+
| ------------ | ---------------- | ----------- |
59+
| **[Application Insights](../articles/azure-functions/functions-monitoring.md)** | **Yes** (default) | Creates an Application Insights resource of the same *App name* in the nearest supported region. By expanding this setting or selecting **Create new**, you can change the Application Insights name or choose a different region in an [Azure geography](https://azure.microsoft.com/global-infrastructure/geographies/) where you want to store your data. |
60+
61+
:::image type="content" source="./media/create-function-app-linux-app-service-plan/function-app-create-monitoring-linux.png" alt-text="Monitoring page":::
62+
63+
1. Select **Review + create** to review the app configuration selections.
64+
65+
1. On the **Review + create** page, review your settings, and then select **Create** to provision and deploy the function app.
66+
67+
1. Select the **Notifications** icon in the upper-right corner of the portal and watch for the **Deployment succeeded** message.
68+
69+
1. Select **Go to resource** to view your new function app. You can also select **Pin to dashboard**. Pinning makes it easier to return to this function app resource from your dashboard.
70+
71+
![Deployment notification](./media/create-function-app-linux-app-service-plan/function-app-create-notification2.png)
72+
73+
Even after your function app is available, it may take a few minutes to be fully initialized.
74+
75+
Next, you create a function in the new function app.
76+
77+
## <a name="create-function"></a>Create an HTTP trigger function
5778

5879
This section shows you how to create a function in your new function app in the portal.
5980

6081
> [!NOTE]
6182
> The portal development experience can be useful for trying out Azure Functions. For most scenarios, consider developing your functions locally and publishing the project to your function app using either [Visual Studio Code](functions-create-first-function-vs-code.md#create-an-azure-functions-project) or the [Azure Functions Core Tools](functions-run-local.md#create-a-local-functions-project).
6283
63-
1. In your new function app, choose the **Overview** tab, and after it loads completely choose **+ New function**.
84+
1. From the left menu of the **Functions** window, select **Functions**, then select **Add** from the top menu.
85+
86+
1. From the **New Function** window, select **Http trigger**.
6487

65-
![Create a new function from the Overview tab](./media/create-function-app-linux-app-service-plan/overview-create-function.png)
88+
![Choose HTTP trigger function](./media/create-function-app-linux-app-service-plan/function-app-select-http-trigger.png)
6689

67-
1. In the **Quickstart** tab, choose **In-portal**, and select **Continue**.
90+
1. In the **New Function** window, accept the default name for **New Function**, or enter a new name.
6891

69-
![Choose your function development platform.](./media/create-function-app-linux-app-service-plan/function-app-quickstart-choose-portal.png)
92+
1. Choose **Anonymous** from the **Authorization level** drop-down list, and then select **Create Function**.
7093

71-
1. Choose **WebHook + API** and then select **Create**.
94+
Azure creates the HTTP trigger function. Now, you can run the new function by sending an HTTP request.
7295

73-
![Functions quickstart in the Azure portal.](./media/create-function-app-linux-app-service-plan/function-app-quickstart-node-webhook.png)
74-
75-
A function is created using a language-specific template for an HTTP triggered function.
96+
## Test the function
7697

77-
Now, you can run the new function by sending an HTTP request.
98+
1. In your new HTTP trigger function, select **Code + Test** from the left menu, then select **Get function URL** from the top menu.
7899

79-
## Test the function
100+
![Select Get function URL](./media/create-function-app-linux-app-service-plan/function-app-select-get-function-url.png)
80101

81-
1. In your new function, click **</> Get function URL** at the top right, select **default (Function key)**, and then click **Copy**.
102+
1. In the **Get function URL** dialog box, select **default** from the drop-down list, and then select the **Copy to clipboard** icon.
82103

83104
![Copy the function URL from the Azure portal](./media/create-function-app-linux-app-service-plan/function-app-develop-tab-testing.png)
84105

85-
2. Paste the function URL into your browser's address bar. Add the query string value `&name=<yourname>` to the end of this URL and press the `Enter` key on your keyboard to execute the request. You should see the response returned by the function displayed in the browser.
106+
1. Paste the function URL into your browser's address bar. Add the query string value `?name=<your_name>` to the end of this URL and press Enter to run the request.
86107

87108
The following example shows the response in the browser:
88109

89110
![Function response in the browser.](./media/create-function-app-linux-app-service-plan/function-app-browser-testing.png)
90111

91112
The request URL includes a key that is required, by default, to access your function over HTTP.
92113

93-
3. When your function runs, trace information is written to the logs. To see the trace output from the previous execution, return to your function in the portal and click the arrow at the bottom of the screen to expand the **Logs**.
114+
1. When your function runs, trace information is written to the logs. To see the trace output, return to the **Code + Test** page in the portal and expand the **Logs** arrow at the bottom of the page.
94115

95116
![Functions log viewer in the Azure portal.](./media/create-function-app-linux-app-service-plan/function-view-logs.png)
96117

@@ -100,7 +121,7 @@ Now, you can run the new function by sending an HTTP request.
100121

101122
## Next steps
102123

103-
You have created a function app with a simple HTTP triggered function.
124+
You have created a function app with a simple HTTP trigger function.
104125

105126
[!INCLUDE [Next steps note](../../includes/functions-quickstart-next-steps.md)]
106127

4.59 KB
Loading
40.4 KB
Loading
-9.08 KB
Loading
33.8 KB
Loading
24.4 KB
Loading
24.5 KB
Loading
-3 KB
Loading
-195 KB
Loading
52.6 KB
Loading

0 commit comments

Comments
 (0)