Reputation: 429
I'm using Azure Function through the Azure Portal for Queue Triggers and I want to add a NuGet Package to it.
There is only two files "run.csx" & "function.json"
The function.json just contains the binding information. However, how do I add a NuGet package such as "Azure.Messaging.ServiceBus" to that function.json. I can't seem to find a clear document or explanation on how to do so.
Upvotes: 2
Views: 531
Reputation: 241450
Per the documentation, for C# Script (.csx) functions, you can upload a function.proj
file that contains a PackageReference
to a nuget package. This is similar to a .csproj file. In your case, it should probably be like so:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.1.2" />
</ItemGroup>
</Project>
Upvotes: 1