Skip to content

Commit bee9af2

Browse files
Merge pull request #301883 from anandmeg/patch-2
Add Copilot highlight section
2 parents fb07f56 + b1f0e3a commit bee9af2

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
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: 09/10/2024
5+
ms.date: 07/04/2025
66
ms.devlang: python
7-
ms.custom: devx-track-python, mode-api, devdivchpfy22, vscode-azure-extension-update-complete, ai-video-demo
7+
ms.custom: devx-track-python, mode-api, devdivchpfy22, vscode-azure-extension-update-complete, ai-video-demo, copilot-scenario-highlight
88
ai-usage: ai-assisted
99
---
1010

@@ -80,6 +80,22 @@ In this section, you use Visual Studio Code to create a local Azure Functions pr
8080

8181
After you verify that the function runs correctly on your local computer, it's time to use Visual Studio Code to publish the project directly to Azure.
8282

83+
## Use AI to normalize and validate user input in Azure Functions
84+
85+
You can use AI tools, such as GitHub Copilot in Visual Studio Code, to generate Python code that updates the existing function to retrieve parameters from either the query string or JSON body, apply formatting or type conversions, and return them in the JSON response. You can customize the prompt to add specifics per your requirements.
86+
87+
The following text shows an example prompt for Copilot Chat:
88+
89+
```copilot-prompt
90+
#file:function_app.py Modify the function to accept name, email, and age from either the query parameters or the JSON body of the request, whichever is available. Return all three parameters in the JSON response, applying these rules:
91+
Title-case the name
92+
Lowercase the email
93+
Convert age to an integer, otherwise return "not provided"
94+
Use sensible defaults if any parameter is missing
95+
```
96+
97+
GitHub Copilot is powered by AI, so surprises and mistakes are possible. For more information, see [Copilot FAQs](https://aka.ms/copilot-general-use-faqs).
98+
8399
[!INCLUDE [functions-sign-in-vs-code](../../includes/functions-sign-in-vs-code.md)]
84100

85101
[!INCLUDE [functions-publish-project-vscode](../../includes/functions-publish-project-vscode.md)]
@@ -101,3 +117,7 @@ You created and deployed a function app with a simple HTTP-triggered function. I
101117

102118
[Azure Functions Core Tools]: functions-run-local.md
103119
[Azure Functions extension for Visual Studio Code]: https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions
120+
121+
## Related content
122+
- [GitHub Copilot in VS Code](https://code.visualstudio.com/docs/copilot/overview)
123+
- [GitHub Copilot in Visual Studio](/visualstudio/ide/visual-studio-github-copilot-install-and-states)

0 commit comments

Comments
 (0)