Skip to content

Commit f5c1269

Browse files
authored
Add Copilot highlight section
1 parent f892f57 commit f5c1269

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
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: 06/26/2025
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
9+
ms.custom: copilot-scenario-highlight
910
---
1011

1112
# Quickstart: Create a function in Azure with Python using Visual Studio Code
@@ -80,6 +81,23 @@ In this section, you use Visual Studio Code to create a local Azure Functions pr
8081

8182
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.
8283

84+
## Use AI to validate user input in your function
85+
86+
You can use AI tools, such as GitHub Copilot in Visual Studio Code, to generate Python code that updates the existing function to handle user data cleaning and validation. You can customize the prompt to add specifics per your requirements.
87+
88+
The following text shows an example prompt for Copilot Chat:
89+
90+
```copilot-prompt
91+
Generate Python code to modify current function to build an Azure Function API endpoint that:
92+
Accepts user data: {"name": " john doe ", "email": "[email protected]", "age": 25}
93+
Returns cleaned data: {"name": "John Doe", "email": "[email protected]", "age": 25, "category": "Adult"}
94+
Validates required fields and data formats
95+
Handles errors gracefully with clear messages
96+
Uses POST method and JSON content type
97+
```
98+
99+
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).
100+
83101
[!INCLUDE [functions-sign-in-vs-code](../../includes/functions-sign-in-vs-code.md)]
84102

85103
[!INCLUDE [functions-publish-project-vscode](../../includes/functions-publish-project-vscode.md)]

0 commit comments

Comments
 (0)