File tree 1 file changed +18
-0
lines changed 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,25 @@ public static async Task Run(string input)
100
100
// Rest of function
101
101
}
102
102
```
103
+ If you are working with functions v3.x, you need a refernce to Microsoft.Azure.DocumentDB.Core. Add a reference in the code:
103
104
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
+ ```
104
122
### CosmosClient code example (JavaScript)
105
123
[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 :
106
124
You can’t perform that action at this time.
0 commit comments