Skip to content

Commit 107b975

Browse files
authored
Merge pull request #134029 from JayaChatterjee-MSFT/patch-19
(AzureCXP) added information for V3.x
2 parents 14ed1dc + 510fe8b commit 107b975

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

articles/azure-functions/manage-connections.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,25 @@ public static async Task Run(string input)
100100
// Rest of function
101101
}
102102
```
103+
If you are working with functions v3.x, you need a refernce to Microsoft.Azure.DocumentDB.Core. Add a reference in the code:
103104

105+
```cs
106+
#r "Microsoft.Azure.DocumentDB.Core"
107+
```
108+
Also, create a file named "function.proj" for your trigger and add the below content :
109+
110+
```cs
111+
112+
<Project Sdk="Microsoft.NET.Sdk">
113+
<PropertyGroup>
114+
<TargetFramework>netcoreapp3.0</TargetFramework>
115+
</PropertyGroup>
116+
<ItemGroup>
117+
<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.12.0" />
118+
</ItemGroup>
119+
</Project>
120+
121+
```
104122
### CosmosClient code example (JavaScript)
105123
[CosmosClient](/javascript/api/@azure/cosmos/cosmosclient) connects to an Azure Cosmos DB instance. The Azure Cosmos DB documentation recommends that you [use a singleton Azure Cosmos DB client for the lifetime of your application](../cosmos-db/performance-tips.md#sdk-usage). The following example shows one pattern for doing that in a function:
106124

0 commit comments

Comments
 (0)