Skip to content

Commit 73fd4af

Browse files
committed
Edit Marie's old PR
1 parent 289167b commit 73fd4af

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

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

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Azure Functions C# script developer reference
33
description: Understand how to develop Azure Functions using C# script.
44
ms.topic: conceptual
55
ms.custom: devx-track-csharp
6-
ms.date: 12/12/2017
6+
ms.date: 09/15/2022
77

88
---
99
# Azure Functions C# script (.csx) developer reference
@@ -12,13 +12,19 @@ ms.date: 12/12/2017
1212

1313
This article is an introduction to developing Azure Functions by using C# script (*.csx*).
1414

15-
Azure Functions supports C# and C# script programming languages. If you're looking for guidance on [using C# in a Visual Studio class library project](functions-develop-vs.md), see [C# developer reference](functions-dotnet-class-library.md).
15+
Azure Functions lets you develop functions using C# in one of the following ways:
16+
17+
| Type | Execution process | Code extension | Development environment | Reference |
18+
| --- | ---- | --- | --- | --- |
19+
| C# script | in-process | .csx | Portal<br/>Core Tools | This article |
20+
| C# class library | in-process | .cs | Visual Studio<br/>Visual Studio Code<br />Core Tools | [In-process C# class library functions](functions-dotnet-class-library.md) |
21+
| C# class library (isolated process)| out-of-process | .cs | Visual Studio<br/>Visual Studio Code<br />Core Tools | [.NET isolated process functions](dotnet-isolated-process-guide.md) |
1622

1723
This article assumes that you've already read the [Azure Functions developers guide](functions-reference.md).
1824

1925
## How .csx works
2026

21-
The C# script experience for Azure Functions is based on the [Azure WebJobs SDK](https://github.com/Azure/azure-webjobs-sdk/wiki/Introduction). Data flows into your C# function via method arguments. Argument names are specified in a `function.json` file, and there are predefined names for accessing things like the function logger and cancellation tokens.
27+
Data flows into your C# function via method arguments. Argument names are specified in a `function.json` file, and there are predefined names for accessing things like the function logger and cancellation tokens.
2228

2329
The *.csx* format allows you to write less "boilerplate" and focus on writing just a C# function. Instead of wrapping everything in a namespace and class, just define a `Run` method. Include any assembly references and namespaces at the beginning of the file as usual.
2430

@@ -350,19 +356,29 @@ The following assemblies are automatically added by the Azure Functions hosting
350356
* `System.Web.Http`
351357
* `System.Net.Http.Formatting`
352358

353-
The following assemblies may be referenced by simple-name (for example, `#r "AssemblyName"`):
359+
The following assemblies may be referenced by simple-name, by runtime version:
360+
361+
# [Version 2.x+](#tab/v2)
354362

355-
Functions V2 and V3:
356363
* `Newtonsoft.Json`
357364
* `Microsoft.WindowsAzure.Storage`
358365

359-
Functions V1:
366+
# [Version 1.x](#tab/v1)
367+
360368
* `Newtonsoft.Json`
361369
* `Microsoft.WindowsAzure.Storage`
362370
* `Microsoft.ServiceBus`
363371
* `Microsoft.AspNet.WebHooks.Receivers`
364372
* `Microsoft.AspNet.WebHooks.Common`
365373

374+
---
375+
376+
In code, assemblies are referenced like the following:
377+
378+
```csharp
379+
#r "AssemblyName"
380+
```
381+
366382
## Referencing custom assemblies
367383

368384
To reference a custom assembly, you can use either a *shared* assembly or a *private* assembly:

0 commit comments

Comments
 (0)