Skip to content

Commit 0df0d5e

Browse files
committed
Merge branch 'main' into release-new-relic
2 parents 523bbe0 + bebe04b commit 0df0d5e

14 files changed

+76
-242
lines changed

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

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22
title: "Create a C# function using Visual Studio Code - Azure Functions"
33
description: "Learn how to create a C# 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: 11/08/2022
5+
ms.date: 01/05/2023
66
ms.devlang: csharp
77
ms.custom: devx-track-csharp, mode-ui, vscode-azure-extension-update-complete
8-
adobe-target: true
9-
adobe-target-activity: DocsExp–386541–A/B–Enhanced-Readability-Quickstarts–2.19.2021
10-
adobe-target-experience: Experience B
11-
adobe-target-content: ./create-first-function-vs-code-csharp-ieux
128
---
139

1410
# Quickstart: Create a C# function in Azure using Visual Studio Code
1511

16-
This article shows you how to create C# functions that run on .NET 6 [in the same process as the Functions host](functions-dotnet-class-library.md). These _in-process_ C# functions are only supported on [Long Term Support (LTS)](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core) .NET versions, such as .NET 6. When creating your project, you can choose to instead create a function that runs on .NET 6 in an [isolated worker process](dotnet-isolated-process-guide.md). [Isolated worker process](dotnet-isolated-process-guide.md) supports both LTS and Standard Term Support (STS) versions of .NET. For more information, see [Supported versions](dotnet-isolated-process-guide.md#supported-versions) in the .NET Functions isolated worker process guide. There's also a [CLI-based version](create-first-function-cli-csharp.md) of this article.
12+
This article creates an HTTP triggered function that runs on .NET. For information about .NET versions supported for C# functions, see [Supported versions](dotnet-isolated-process-guide.md#supported-versions).
13+
14+
There's also a [CLI-based version](create-first-function-cli-csharp.md) of this article.
1715

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

@@ -32,41 +30,30 @@ In this section, you use Visual Studio Code to create a local Azure Functions pr
3230
:::image type="content" source="./media/functions-create-first-function-vs-code/create-new-project.png" alt-text="Screenshot of create a new project window.":::
3331

3432
1. Select 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.
33+
34+
1. For **Select a language**, choose `C#`.
35+
36+
1. For **Select a .NET runtime**, choose from one of the following options:
37+
38+
| .NET runtime | Process model | Description |
39+
| --- | --- | --- |
40+
| **.NET 6.0 (LTS)** | [In-process](functions-dotnet-class-library.md) | _In-process_ C# functions are only supported on [Long Term Support (LTS)](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core) .NET versions. Function code runs in the same process as the Functions host. |
41+
| **.NET 6.0 Isolated (LTS)** | [Isolated worker process](dotnet-isolated-process-guide.md) | Functions run on .NET 6, but in a separate process from the Functions host. |
42+
| **.NET 7.0 Isolated** | [Isolated worker process](dotnet-isolated-process-guide.md) | Because .NET 7 isn't an LTS version of .NET, your functions must run in an isolated process on .NET 7. |
43+
| **.NET Framework Isolated** | [Isolated worker process](dotnet-isolated-process-guide.md) | Choose this option when your functions need to use libraries only supported on the .NET Framework. |
3544

36-
1. Provide the following information at the prompts:
45+
The two process models use different APIs, and each process model uses a different template when generating the function project code. If you don't see these options, press F1 and type `Preferences: Open user settings`, then search for `Azure Functions: Project Runtime` and make sure that the default runtime version is set to `~4`.
3746

38-
# [In-process](#tab/in-process)
47+
1. Provide the remaining information at the prompts:
3948

4049
|Prompt|Selection|
4150
|--|--|
42-
|**Select a language**|Choose `C#`.|
43-
|**Select a .NET runtime** | Select `.NET 6`.|
4451
|**Select a template for your project's first function**|Choose `HTTP trigger`.|
4552
|**Provide a function name**|Type `HttpExample`.|
4653
|**Provide a namespace** | Type `My.Functions`. |
4754
|**Authorization level**|Choose `Anonymous`, which enables anyone to call your function endpoint. To learn about authorization level, see [Authorization keys](functions-bindings-http-webhook-trigger.md#authorization-keys).|
4855
|**Select how you would like to open your project**|Select `Add to workspace`.|
4956

50-
# [Isolated process](#tab/isolated-process)
51-
52-
|Prompt|Selection|
53-
|--|--|
54-
|**Select a language**|Choose `C#`.|
55-
| **Select a .NET runtime** | Choose `.NET 6 Isolated`.|
56-
|**Select a template for your project's first function**|Choose `HTTP trigger`.|
57-
|**Provide a function name**|Type `HttpExample`.|
58-
|**Provide a namespace** | Type `My.Functions`. |
59-
|**Authorization level**|Choose `Anonymous`, which enables anyone to call your function endpoint. To learn about authorization level, see [Authorization keys](functions-bindings-http-webhook-trigger.md#authorization-keys).|
60-
|**Select how you would like to open your project**|Choose `Add to workspace`.|
61-
62-
---
63-
64-
> [!NOTE]
65-
> If you don't see .NET 6 as a runtime option, check the following:
66-
>
67-
> + Make sure you have installed the .NET 6.0 SDK or other available .NET SDK versions, from .NET website [here](https://dotnet.microsoft.com/download).
68-
> + Press F1 and type `Preferences: Open user settings`, then search for `Azure Functions: Project Runtime` and change the default runtime version to `~4`.
69-
7057
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. For more information about the files that are created, see [Generated project files](functions-develop-vs-code.md?tabs=csharp#generated-project-files).
7158

7259
[!INCLUDE [functions-run-function-test-local-vs-code-csharp](../../includes/functions-run-function-test-local-vs-code-csharp.md)]
@@ -85,6 +72,8 @@ After checking that the function runs correctly on your local computer, it's tim
8572

8673
You have used [Visual Studio Code](functions-develop-vs-code.md?tabs=csharp) to create a function app with a simple HTTP-triggered function. In the next article, you expand that function by connecting to either Azure Cosmos DB or Azure Queue Storage. To learn more about connecting to other Azure services, see [Add bindings to an existing function in Azure Functions](add-bindings-existing-function.md?tabs=csharp).
8774

75+
The next article depends on your chosen process model.
76+
8877
# [In-process](#tab/in-process)
8978

9079
> [!div class="nextstepaction"]

articles/azure-functions/functions-create-your-first-function-visual-studio-uiex.md

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

0 commit comments

Comments
 (0)