Skip to content

Commit a641399

Browse files
committed
Revert changes to register extension file
1 parent 23be26e commit a641399

File tree

1 file changed

+130
-130
lines changed

1 file changed

+130
-130
lines changed
Lines changed: 130 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,130 @@
1-
---
2-
title: Register Azure Functions binding extensions
3-
description: Learn to register an Azure Functions binding extension based on your environment.
4-
author: craigshoemaker
5-
6-
ms.topic: reference
7-
ms.date: 09/14/2020
8-
ms.author: cshoe
9-
---
10-
11-
# Register Azure Functions binding extensions
12-
13-
Starting with Azure Functions version 2.x, the functions runtime only includes HTTP and timer triggers by default. Other [triggers and bindings](./functions-triggers-bindings.md) are available as separate packages.
14-
15-
.NET class library functions apps use bindings that are installed in the project as NuGet packages. Extension bundles allows non-.NET functions apps to use the same bindings without having to deal with the .NET infrastructure.
16-
17-
The following table indicates when and how you register bindings.
18-
19-
| Development environment |Registration<br/> in Functions 1.x |Registration<br/> in Functions 2.x or later |
20-
|-------------------------|------------------------------------|------------------------------------|
21-
|Azure portal|Automatic|Automatic<sup>*</sup>|
22-
|Non-.NET languages|Automatic|Use [extension bundles](#extension-bundles) (recommended) or [explicitly install extensions](#explicitly-install-extensions)|
23-
|C# class library using Visual Studio|[Use NuGet tools](#vs)|[Use NuGet tools](#vs)|
24-
|C# class library using Visual Studio Code|N/A|[Use .NET Core CLI](#vs-code)|
25-
26-
<sup>*</sup> Portal uses extension bundles.
27-
28-
## Access extensions in non-.NET languages
29-
30-
For Java, JavaScript, PowerShell, Python, and Custom Handler function apps, we recommended using extension bundles to access bindings. In cases where extension bundles cannot be used, you can explicitly install binding extensions.
31-
32-
### <a name="extension-bundles"></a>Extension bundles
33-
34-
Extension bundles is a way to add a compatible set of binding extensions to your function app. You enable extension bundles in the app's *host.json* file.
35-
36-
You can use extension bundles with version 2.x and later versions of the Functions runtime.
37-
38-
Extension bundles are versioned. Each version contains a specific set of binding extensions that are verified to work together. Select a bundle version based on the extensions that you need in your app.
39-
40-
To add an extension bundle to your function app, add the `extensionBundle` section to *host.json*. In many cases, Visual Studio Code and Azure Functions Core Tools will automatically add it for you.
41-
42-
[!INCLUDE [functions-extension-bundles-json](../../includes/functions-extension-bundles-json.md)]
43-
44-
The following table lists the currently available versions of the default *Microsoft.Azure.Functions.ExtensionBundle* bundle and links to the extensions they include.
45-
46-
| Bundle version | Version in host.json | Included extensions |
47-
| --- | --- | --- |
48-
| 1.x | `[1.*, 2.0.0)` | See [extensions.json](https://github.com/Azure/azure-functions-extension-bundles/blob/v1.x/src/Microsoft.Azure.Functions.ExtensionBundle/extensions.json) used to generate the bundle |
49-
| 2.x | `[2.*, 3.0.0)` | See [extensions.json](https://github.com/Azure/azure-functions-extension-bundles/blob/v2.x/src/Microsoft.Azure.Functions.ExtensionBundle/extensions.json) used to generate the bundle |
50-
51-
> [!NOTE]
52-
> While you can a specify custom version range in host.json, we recommend you use a version value from this table.
53-
54-
### Explicitly install extensions
55-
56-
If you aren't able to use extension bundles, you can use Azure Functions Core Tools locally to install the specific extension packages required by your project.
57-
58-
> [!IMPORTANT]
59-
> You can't explicitly install extensions in a function app that is using extension bundles. Remove the `extensionBundle` section in *host.json* before explicitly installing extensions.
60-
61-
The following items describe some reasons you might need to install extensions manually:
62-
63-
* You need to access a specific version of an extension not available in a bundle.
64-
* You need to access a custom extension not available in a bundle.
65-
* You need to access a specific combination of extensions not available in a single bundle.
66-
67-
> [!NOTE]
68-
> To manually install extensions by using Core Tools, you must have the [.NET Core 2.x SDK](https://dotnet.microsoft.com/download) installed. The .NET Core SDK is used by Azure Functions Core Tools to install extensions from NuGet. You don't need to know .NET to use Azure Functions extensions.
69-
70-
When you explicitly install extensions, a .NET project file named extensions.csproj is added to the root of your project. This file defines the set of NuGet packages required by your functions. While you can work with the [NuGet package references](/nuget/consume-packages/package-references-in-project-files) in this file, Core Tools lets you install extensions without having to manually edit the file.
71-
72-
There are several ways to use Core Tools to install the required extensions in your local project.
73-
74-
#### Install all extensions
75-
76-
Use the following command to automatically add all extension packages used by the bindings in your local project:
77-
78-
```command
79-
func extensions install
80-
```
81-
82-
The command reads the *function.json* file to see which packages you need, installs them, and rebuilds the extensions project (extensions.csproj). It adds any new bindings at the current version but does not update existing bindings. Use the `--force` option to update existing bindings to the latest version when installing new ones. To learn more, see the [`func extensions install` command](functions-core-tools-reference.md#func-extensions-install).
83-
84-
If your function app uses bindings that Core Tools does not recognize, you must manually install the specific extension.
85-
86-
#### Install a specific extension
87-
88-
Use the following command to install a specific extension package at a specific version, in this case the Storage extension:
89-
90-
```command
91-
func extensions install --package Microsoft.Azure.WebJobs.Extensions.Storage --version 4.0.2
92-
```
93-
94-
To learn more, see the [`func extensions install` command](functions-core-tools-reference.md#func-extensions-install).
95-
96-
## <a name="local-csharp"></a>Install extensions from NuGet in .NET languages
97-
98-
For a C# class library-based functions project, you should install extensions directly. Extension bundles is designed specifically for projects that aren't C# class library-based.
99-
100-
### <a name="vs"></a> C\# class library with Visual Studio
101-
102-
In **Visual Studio**, you can install packages from the Package Manager Console using the [Install-Package](/nuget/tools/ps-ref-install-package) command, as shown in the following example:
103-
104-
```powershell
105-
Install-Package Microsoft.Azure.WebJobs.Extensions.ServiceBus -Version <TARGET_VERSION>
106-
```
107-
108-
The name of the package used for a given binding is provided in the reference article for that binding. For an example, see the [Packages section of the Service Bus binding reference article](functions-bindings-service-bus.md#functions-1x).
109-
110-
Replace `<TARGET_VERSION>` in the example with a specific version of the package, such as `3.0.0-beta5`. Valid versions are listed on the individual package pages at [NuGet.org](https://nuget.org). The major versions that correspond to Functions runtime 1.x or 2.x are specified in the reference article for the binding.
111-
112-
If you use `Install-Package` to reference a binding, you don't need to use [extension bundles](#extension-bundles). This approach is specific for class libraries built in Visual Studio.
113-
114-
### <a name="vs-code"></a> C# class library with Visual Studio Code
115-
116-
In **Visual Studio Code**, install packages for a C# class library project from the command prompt using the [dotnet add package](/dotnet/core/tools/dotnet-add-package) command in the .NET Core CLI. The following example demonstrates how you add a binding:
117-
118-
```terminal
119-
dotnet add package Microsoft.Azure.WebJobs.Extensions.<BINDING_TYPE_NAME> --version <TARGET_VERSION>
120-
```
121-
122-
The .NET Core CLI can only be used for Azure Functions 2.x development.
123-
124-
Replace `<BINDING_TYPE_NAME>` with the name of the package that contains the binding you need. You can find the desired binding reference article in the [list of supported bindings](./functions-triggers-bindings.md#supported-bindings).
125-
126-
Replace `<TARGET_VERSION>` in the example with a specific version of the package, such as `3.0.0-beta5`. Valid versions are listed on the individual package pages at [NuGet.org](https://nuget.org). The major versions that correspond to Functions runtime 1.x or 2.x are specified in the reference article for the binding.
127-
128-
## Next steps
129-
> [!div class="nextstepaction"]
130-
> [Azure Function trigger and binding example](./functions-bindings-example.md)
1+
---
2+
title: Register Azure Functions binding extensions
3+
description: Learn to register an Azure Functions binding extension based on your environment.
4+
author: craigshoemaker
5+
6+
ms.topic: reference
7+
ms.date: 09/14/2020
8+
ms.author: cshoe
9+
---
10+
11+
# Register Azure Functions binding extensions
12+
13+
Starting with Azure Functions version 2.x, the functions runtime only includes HTTP and timer triggers by default. Other [triggers and bindings](./functions-triggers-bindings.md) are available as separate packages.
14+
15+
.NET class library functions apps use bindings that are installed in the project as NuGet packages. Extension bundles allows non-.NET functions apps to use the same bindings without having to deal with the .NET infrastructure.
16+
17+
The following table indicates when and how you register bindings.
18+
19+
| Development environment |Registration<br/> in Functions 1.x |Registration<br/> in Functions 2.x or later |
20+
|-------------------------|------------------------------------|------------------------------------|
21+
|Azure portal|Automatic|Automatic<sup>*</sup>|
22+
|Non-.NET languages|Automatic|Use [extension bundles](#extension-bundles) (recommended) or [explicitly install extensions](#explicitly-install-extensions)|
23+
|C# class library using Visual Studio|[Use NuGet tools](#vs)|[Use NuGet tools](#vs)|
24+
|C# class library using Visual Studio Code|N/A|[Use .NET Core CLI](#vs-code)|
25+
26+
<sup>*</sup> Portal uses extension bundles.
27+
28+
## Access extensions in non-.NET languages
29+
30+
For Java, JavaScript, PowerShell, Python, and Custom Handler function apps, we recommended using extension bundles to access bindings. In cases where extension bundles cannot be used, you can explicitly install binding extensions.
31+
32+
### <a name="extension-bundles"></a>Extension bundles
33+
34+
Extension bundles is a way to add a compatible set of binding extensions to your function app. You enable extension bundles in the app's *host.json* file.
35+
36+
You can use extension bundles with version 2.x and later versions of the Functions runtime.
37+
38+
Extension bundles are versioned. Each version contains a specific set of binding extensions that are verified to work together. Select a bundle version based on the extensions that you need in your app.
39+
40+
To add an extension bundle to your function app, add the `extensionBundle` section to *host.json*. In many cases, Visual Studio Code and Azure Functions Core Tools will automatically add it for you.
41+
42+
[!INCLUDE [functions-extension-bundles-json](../../includes/functions-extension-bundles-json.md)]
43+
44+
The following table lists the currently available versions of the default *Microsoft.Azure.Functions.ExtensionBundle* bundle and links to the extensions they include.
45+
46+
| Bundle version | Version in host.json | Included extensions |
47+
| --- | --- | --- |
48+
| 1.x | `[1.*, 2.0.0)` | See [extensions.json](https://github.com/Azure/azure-functions-extension-bundles/blob/v1.x/src/Microsoft.Azure.Functions.ExtensionBundle/extensions.json) used to generate the bundle |
49+
| 2.x | `[2.*, 3.0.0)` | See [extensions.json](https://github.com/Azure/azure-functions-extension-bundles/blob/v2.x/src/Microsoft.Azure.Functions.ExtensionBundle/extensions.json) used to generate the bundle |
50+
51+
> [!NOTE]
52+
> While you can a specify custom version range in host.json, we recommend you use a version value from this table.
53+
54+
### Explicitly install extensions
55+
56+
If you aren't able to use extension bundles, you can use Azure Functions Core Tools locally to install the specific extension packages required by your project.
57+
58+
> [!IMPORTANT]
59+
> You can't explicitly install extensions in a function app that is using extension bundles. Remove the `extensionBundle` section in *host.json* before explicitly installing extensions.
60+
61+
The following items describe some reasons you might need to install extensions manually:
62+
63+
* You need to access a specific version of an extension not available in a bundle.
64+
* You need to access a custom extension not available in a bundle.
65+
* You need to access a specific combination of extensions not available in a single bundle.
66+
67+
> [!NOTE]
68+
> To manually install extensions by using Core Tools, you must have the [.NET Core 2.x SDK](https://dotnet.microsoft.com/download) installed. The .NET Core SDK is used by Azure Functions Core Tools to install extensions from NuGet. You don't need to know .NET to use Azure Functions extensions.
69+
70+
When you explicitly install extensions, a .NET project file named extensions.csproj is added to the root of your project. This file defines the set of NuGet packages required by your functions. While you can work with the [NuGet package references](/nuget/consume-packages/package-references-in-project-files) in this file, Core Tools lets you install extensions without having to manually edit the file.
71+
72+
There are several ways to use Core Tools to install the required extensions in your local project.
73+
74+
#### Install all extensions
75+
76+
Use the following command to automatically add all extension packages used by the bindings in your local project:
77+
78+
```command
79+
func extensions install
80+
```
81+
82+
The command reads the *function.json* file to see which packages you need, installs them, and rebuilds the extensions project (extensions.csproj). It adds any new bindings at the current version but does not update existing bindings. Use the `--force` option to update existing bindings to the latest version when installing new ones. To learn more, see the [`func extensions install` command](functions-core-tools-reference.md#func-extensions-install).
83+
84+
If your function app uses bindings that Core Tools does not recognize, you must manually install the specific extension.
85+
86+
#### Install a specific extension
87+
88+
Use the following command to install a specific extension package at a specific version, in this case the Storage extension:
89+
90+
```command
91+
func extensions install --package Microsoft.Azure.WebJobs.Extensions.Storage --version 4.0.2
92+
```
93+
94+
To learn more, see the [`func extensions install` command](functions-core-tools-reference.md#func-extensions-install).
95+
96+
## <a name="local-csharp"></a>Install extensions from NuGet in .NET languages
97+
98+
For a C# class library-based functions project, you should install extensions directly. Extension bundles is designed specifically for projects that aren't C# class library-based.
99+
100+
### <a name="vs"></a> C\# class library with Visual Studio
101+
102+
In **Visual Studio**, you can install packages from the Package Manager Console using the [Install-Package](/nuget/tools/ps-ref-install-package) command, as shown in the following example:
103+
104+
```powershell
105+
Install-Package Microsoft.Azure.WebJobs.Extensions.ServiceBus -Version <TARGET_VERSION>
106+
```
107+
108+
The name of the package used for a given binding is provided in the reference article for that binding. For an example, see the [Packages section of the Service Bus binding reference article](functions-bindings-service-bus.md#functions-1x).
109+
110+
Replace `<TARGET_VERSION>` in the example with a specific version of the package, such as `3.0.0-beta5`. Valid versions are listed on the individual package pages at [NuGet.org](https://nuget.org). The major versions that correspond to Functions runtime 1.x or 2.x are specified in the reference article for the binding.
111+
112+
If you use `Install-Package` to reference a binding, you don't need to use [extension bundles](#extension-bundles). This approach is specific for class libraries built in Visual Studio.
113+
114+
### <a name="vs-code"></a> C# class library with Visual Studio Code
115+
116+
In **Visual Studio Code**, install packages for a C# class library project from the command prompt using the [dotnet add package](/dotnet/core/tools/dotnet-add-package) command in the .NET Core CLI. The following example demonstrates how you add a binding:
117+
118+
```terminal
119+
dotnet add package Microsoft.Azure.WebJobs.Extensions.<BINDING_TYPE_NAME> --version <TARGET_VERSION>
120+
```
121+
122+
The .NET Core CLI can only be used for Azure Functions 2.x development.
123+
124+
Replace `<BINDING_TYPE_NAME>` with the name of the package that contains the binding you need. You can find the desired binding reference article in the [list of supported bindings](./functions-triggers-bindings.md#supported-bindings).
125+
126+
Replace `<TARGET_VERSION>` in the example with a specific version of the package, such as `3.0.0-beta5`. Valid versions are listed on the individual package pages at [NuGet.org](https://nuget.org). The major versions that correspond to Functions runtime 1.x or 2.x are specified in the reference article for the binding.
127+
128+
## Next steps
129+
> [!div class="nextstepaction"]
130+
> [Azure Function trigger and binding example](./functions-bindings-example.md)

0 commit comments

Comments
 (0)