You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/create-first-function-vs-code-python.md
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Create a Python function using Visual Studio Code - Azure Functions
3
3
description: Learn how to create a Python function, then publish the local project to serverless hosting in Azure Functions using the Azure Functions extension in Visual Studio Code.
@@ -47,9 +47,9 @@ In this section, you use Visual Studio Code to create a local Azure Functions pr
47
47
48
48
1. In Visual Studio Code, press <kbd>F1</kbd> to open the command palette and search for and run the command `Azure Functions: Create New Project...`.
49
49
50
-
2. Choose the directory location for your project workspace and choose **Select**. You should either create a new folder or choose an empty folder for the project workspace. Don't choose a project folder that is already part of a workspace.
50
+
1. Choose the directory location for your project workspace and choose **Select**. You should either create a new folder or choose an empty folder for the project workspace. Don't choose a project folder that is already part of a workspace.
51
51
52
-
3. Provide the following information at the prompts:
52
+
1. Provide the following information at the prompts:
53
53
54
54
|Prompt|Selection|
55
55
|--|--|
@@ -60,24 +60,21 @@ In this section, you use Visual Studio Code to create a local Azure Functions pr
60
60
|**Authorization level**| Choose `ANONYMOUS`, which lets anyone call your function endpoint. For more information, see [Authorization level](functions-bindings-http-webhook-trigger.md#http-auth).|
61
61
|**Select how you would like to open your project**| Choose `Open in current window`.|
62
62
63
-
4. Visual Studio Code uses the provided information and generates an Azure Functions project with an HTTP trigger. You can view the local project files in the Explorer. The generated `function_app.py` project file contains your functions.
64
-
<!--- Remove these last steps after the next Core Tools version is released (4.28.0)--->
65
-
5. Open the local.settings.json project file and verify that the `AzureWebJobsFeatureFlags` setting has a value of `EnableWorkerIndexing`. This is required for Functions to interpret your project correctly as the Python v2 model when running locally.
63
+
1. Visual Studio Code uses the provided information and generates an Azure Functions project with an HTTP trigger. You can view the local project files in the Explorer. The generated `function_app.py` project file contains your functions.
66
64
67
-
6. In the local.settings.json file, update the `AzureWebJobsStorage` setting as in the following example:
65
+
1. In the local.settings.json file, update the `AzureWebJobsStorage` setting as in the following example:
This tells the local Functions host to use the storage emulator for the storage connection currently required by the Python v2 model. When you publish your project to Azure, you need to instead use the default storage account. If you're instead using an Azure Storage account, set your storage account connection string here.
70
+
71
+
This tells the local Functions host to use the storage emulator for the storage connection required by the Python v2 model. When you publish your project to Azure, this setting uses the default storage account instead. If you're using an Azure Storage account during local development, set your storage account connection string here.
74
72
75
73
## Start the emulator
76
74
77
75
1. In Visual Studio Code, press <kbd>F1</kbd> to open the command palette. In the command palette, search for and select `Azurite: Start`.
78
76
79
-
1. Check the bottom bar and verify that Azurite emulation services are running. If so, you can now run your function locally.
80
-
::: zone-end
77
+
1. Check the bottom bar and verify that Azurite emulation services are running. If so, you can now run your function locally.
When you're deploying the function, this setting isn't created automatically. You must explicitly create this setting in your function app in Azure for it to run by using the v2 model.
1166
-
1156
+
For local development, application settings are [maintained in the *local.settings.json* file](functions-develop-local.md#local-settings-file).
Copy file name to clipboardExpand all lines: includes/functions-vs-code-run-remote.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,16 @@
2
2
author: ggailey777
3
3
ms.service: azure-functions
4
4
ms.topic: include
5
-
ms.date: 06/15/2022
5
+
ms.date: 08/15/2024
6
6
ms.custom: devdivchpfy22
7
7
ms.author: glenga
8
8
---
9
9
## Run the function in Azure
10
10
11
-
1.Back in the **Resources** area in the side bar, expand your subscription, your new function app, and **Functions**. Right-click (Windows) or <kbd>Ctrl -</kbd> click (macOS) the `HttpExample` function and choose **Execute Function Now...**.
11
+
1.Press <kbd>F1</kbd> to display the command palette, then search for and run the command `Azure Functions:Execute Function Now...`. If prompted, select your subscription.
12
12
13
-
:::image type="content" source="media/functions-vs-code-run-remote/execute-function-now.png" alt-text="Screenshot of executing function in Azure from Visual Studio Code.":::
13
+
2. Select your new function app resource and `HttpExample` as your function.
14
14
15
-
2. In **Enter request body**you see the request message body value of `{ "name": "Azure" }`. Press Enter to send this request message to your function.
15
+
3. In **Enter request body**type `{ "name": "Azure" }`, then press Enter to send this request message to your function.
16
16
17
-
3. When the function executes in Azure and returns a response, a notification is raised in Visual Studio Code.
17
+
4. When the function executes in Azure, the response is displayed in the notification area. Expand the notification to review the full response.
0 commit comments