Skip to content

Commit a7a3bd0

Browse files
committed
Improve prompt and other fixes
1 parent d349c31 commit a7a3bd0

File tree

4 files changed

+40
-32
lines changed

4 files changed

+40
-32
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,15 @@ In this section, you create a function app and related resources in your Azure s
329329
330330
[!INCLUDE [functions-deploy-project-vs-code](../../includes/functions-deploy-project-vs-code.md)]
331331
332-
[!INCLUDE [functions-vs-code-run-remote](../../includes/functions-vs-code-run-remote.md)]
332+
## Run the function in Azure
333+
334+
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.
335+
336+
2. Select your new function app resource and `HttpExample` as your function.
337+
338+
3. In **Enter request body** type `{ "name": "Azure" }`, then press Enter to send this request message to your function.
339+
340+
4. When the function executes in Azure, the response is displayed in the notification area. Expand the notification to review the full response.
333341
334342
[!INCLUDE [functions-cleanup-resources-vs-code.md](../../includes/functions-cleanup-resources-vs-code.md)]
335343

articles/azure-functions/how-to-create-function-azure-cli.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ zone_pivot_groups: programming-languages-set-functions
1111

1212
In this article, you use local command-line tools to create a function that responds to HTTP requests. After verifying your code locally, you deploy it to a serverless Flex Consumption hosting plan in Azure Functions.
1313

14-
Completing this quickstart incurs a small cost of a few USD cents or less in your Azure account.
14+
Completing this quickstart incurs a small cost of a few USD cents or less in your Azure account.
15+
16+
Make sure to select your preferred development language at the top of the article.
1517

1618
## Prerequisites
1719

articles/azure-functions/how-to-create-function-vs-code.md

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
---
2-
title: Create a JavaScript function using Visual Studio Code - Azure Functions
3-
description: Learn how to create a JavaScript function, then publish the local Node.js project to serverless hosting in Azure Functions using the Azure Functions extension in Visual Studio Code.
2+
title: Create and deploy function code to Azure using Visual Studio Code
3+
description: Learn how to create a function, then publish the local code project to serverless hosting in Azure Functions using the Azure Functions extension in Visual Studio Code.
44
ms.topic: quickstart
55
ms.date: 08/01/2025
6-
ms.custom: mode-api, vscode-azure-extension-update-complete, devx-track-js
6+
ms.custom:
7+
- mode-api
8+
- vscode-azure-extension-update-complete
9+
- devx-track-js
10+
ms.collection:
11+
- ce-skilling-ai-copilot
712
zone_pivot_groups: programming-languages-set-functions
813
---
914

10-
# Quickstart: Create a function in Azure using Visual Studio Code
15+
# Quickstart: Create and deploy function code to Azure using Visual Studio Code
1116

12-
Use Visual Studio Code to create a function that responds to HTTP requests. Test the code locally, then deploy it to the serverless environment of Azure Functions.
17+
Use Visual Studio Code to create a function that responds to HTTP requests from a template. Use GitHub Copilot to improve the generated function code, verify code updates locally, and then deploy it to the serverless Flex Consumption hosting plan in Azure Functions.
1318

1419
Completing this quickstart incurs a small cost of a few USD cents or less in your Azure account.
1520

21+
Make sure to select your preferred development language at the top of the article.
22+
1623
## Prerequisites
1724

1825
[!INCLUDE [functions-requirements-visual-studio-code](../../includes/functions-requirements-visual-studio-code.md)]
@@ -21,7 +28,7 @@ Completing this quickstart incurs a small cost of a few USD cents or less in you
2128

2229
## <a name="create-an-azure-functions-project"></a>Create your local project
2330

24-
In this section, you use Visual Studio Code to create a local Azure Functions project in JavaScript. Later in this article, you publish your function code to Azure.
31+
In this section, you use Visual Studio Code to create a local Azure Functions project in your preferred language. Later in the article, you update, run, and then publish your function code to Azure.
2532

2633
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...`.
2734

@@ -135,19 +142,19 @@ After you verify that the function runs correctly on your local computer, you ca
135142
This is an example prompt for Copilot Chat that updates the existing function code to retrieve parameters from either the query string or JSON body, apply formatting or type conversions, and return them as JSON in the response:
136143

137144
```copilot-prompt
138-
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:
145+
Modify the function to accept name, email, and age from the JSON body of the request. If any of these parameters are missing from the query string, read them from the JSON body. Return all three parameters in the JSON response, applying these rules:
139146
Title-case the name
140147
Lowercase the email
141-
Convert age to an integer, otherwise return "not provided"
148+
Convert age to an integer if possible, otherwise return "not provided"
142149
Use sensible defaults if any parameter is missing
143150
```
144151

145-
You can customize your prompt to add specifics as needed.
146-
147152
> [!TIP]
148-
> The rest of the article assumes that you can continue to use a GET command to call your endpoint. Should GitHub Copilot update your app to require data be sent in the message `body`, you must also have a [secure HTTP test tool](functions-develop-local.md#http-test-tools) to submit POST requests with data in the message body when calling the `httpexample` endpoint.
153+
> 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).
149154
150-
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). When you are satistfied with your app, you can use Visual Studio Code to publish the project directly to Azure.
155+
You can customize your prompt to add specifics as needed, then run the app again locally and verify that it works as expected after the code changes. Use a message body like `{ "name": "Contoso", "email": "[email protected]", "age": "34" }`.
156+
157+
When you are satistfied with your app, you can use Visual Studio Code to publish the project directly to Azure.
151158

152159
[!INCLUDE [functions-sign-in-vs-code](../../includes/functions-sign-in-vs-code.md)]
153160

@@ -159,7 +166,15 @@ GitHub Copilot is powered by AI, so surprises and mistakes are possible. For mor
159166

160167
[!INCLUDE [functions-deploy-project-vs-code](../../includes/functions-deploy-project-vs-code.md)]
161168

162-
[!INCLUDE [functions-vs-code-run-remote](../../includes/functions-vs-code-run-remote.md)]
169+
## Run the function in Azure
170+
171+
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.
172+
173+
2. Select your new function app resource and `HttpExample` as your function.
174+
175+
3. In **Enter request body** type `{ "name": "Contoso", "email": "[email protected]", "age": "34" }`, then press Enter to send this request message to your function.
176+
177+
4. When the function executes in Azure, the response is displayed in the notification area. Expand the notification to review the full response.
163178

164179
## Troubleshooting
165180

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

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)