Skip to content

Commit dfb8e9e

Browse files
author
Jill Grant
authored
Merge pull request #284913 from ggailey777/patch-2
[Functions] VS Code updates for Python
2 parents ccef5c3 + f765a5a commit dfb8e9e

File tree

3 files changed

+15
-28
lines changed

3 files changed

+15
-28
lines changed

articles/azure-functions/create-first-function-vs-code-python.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Create a Python function using Visual Studio Code - Azure Functions
33
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.
44
ms.topic: quickstart
5-
ms.date: 06/03/2024
5+
ms.date: 09/10/2024
66
ms.devlang: python
77
ms.custom: devx-track-python, mode-api, devdivchpfy22, vscode-azure-extension-update-complete, ai-video-demo
88
ai-usage: ai-assisted
@@ -47,9 +47,9 @@ In this section, you use Visual Studio Code to create a local Azure Functions pr
4747

4848
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...`.
4949

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.
5151

52-
3. Provide the following information at the prompts:
52+
1. Provide the following information at the prompts:
5353

5454
|Prompt|Selection|
5555
|--|--|
@@ -60,24 +60,21 @@ In this section, you use Visual Studio Code to create a local Azure Functions pr
6060
|**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).|
6161
|**Select how you would like to open your project** | Choose `Open in current window`.|
6262

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.
6664

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:
6866

6967
```json
7068
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
7169
```
72-
73-
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.
7472

7573
## Start the emulator
7674

7775
1. In Visual Studio Code, press <kbd>F1</kbd> to open the command palette. In the command palette, search for and select `Azurite: Start`.
7876

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.
8178

8279
[!INCLUDE [functions-run-function-test-local-vs-code](../../includes/functions-run-function-test-local-vs-code.md)]
8380

articles/azure-functions/functions-reference-python.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,7 @@ As an example, the following code demonstrates how to define a Blob Storage inpu
470470
"Values": {
471471
"FUNCTIONS_WORKER_RUNTIME": "python",
472472
"STORAGE_CONNECTION_STRING": "<AZURE_STORAGE_CONNECTION_STRING>",
473-
"AzureWebJobsStorage": "<azure-storage-connection-string>",
474-
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
473+
"AzureWebJobsStorage": "<azure-storage-connection-string>"
475474
}
476475
}
477476
```
@@ -1154,16 +1153,7 @@ def main(req: func.HttpRequest) -> func.HttpResponse:
11541153
logging.info(f'My app setting value:{my_app_setting_value}')
11551154
```
11561155

1157-
For local development, application settings are [maintained in the *local.settings.json* file](functions-develop-local.md#local-settings-file).
1158-
1159-
When you're using the new programming model, enable the following app setting in the *local.settings.json* file, as shown here:
1160-
1161-
```json
1162-
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
1163-
```
1164-
1165-
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).
11671157
::: zone-end
11681158

11691159
## Python version

includes/functions-vs-code-run-remote.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
author: ggailey777
33
ms.service: azure-functions
44
ms.topic: include
5-
ms.date: 06/15/2022
5+
ms.date: 08/15/2024
66
ms.custom: devdivchpfy22
77
ms.author: glenga
88
---
99
## Run the function in Azure
1010

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.
1212

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.
1414

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.
1616

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

Comments
 (0)