1

I am writing an azure function that needs a NuGet package Sendgrid. The only way I found was to update the .csproj file.

Now in the View File option, I can't go back to the parent directory, but I can go from the Console. I just need to update the .csproj file in the parent directory so that I can update the Nuget packages.

I need to all the work in the provided in the portal editor. I know I can publish the code by any IDE

Thanks

UPDATE 1: Link to update csproj but the reference to Sendgrid is not established after the link

UPDATE 2: (ANSWER) Link to manually add Nuget Package This worked for me. But Update 1 was worth trying

JB's
  • 606
  • 13
  • 30

1 Answers1

1

The only way I found was to update the .csproj file

To add a NuGet package to an Azure function, you can add it to the project.json file in the portal:

enter image description here

Then reference it in the .csx file:

enter image description here

stuartd
  • 70,509
  • 14
  • 132
  • 163
  • Sorry to hear that. Have you added the `using` references to the function .csx file? Have you tried what the link you posted suggested, upload an extensions.csproj file? – stuartd Nov 23 '18 at 10:39
  • Yes, I had already tried the #r with the using but no progress. From the reference, it says to upload the csproj file but its not possible because there is now way to do that. However I have found a way through Kudus, update the csproj file but it didn't either solve the issue – JB's Nov 23 '18 at 10:42
  • The Link https://learn.microsoft.com/mt-mt/azure/azure-functions/install-update-binding-extensions-manual – JB's Nov 23 '18 at 10:42
  • _" I had already tried the #r with the using"_ - you can only use `#r` with certain assemblies, NuGet packages have regular `using` statements: updated answer. – stuartd Nov 23 '18 at 10:48
  • I have also done that but the references are not getting resolved, you please assist how did you bind you `project.json` wih `csproj ` – JB's Nov 23 '18 at 10:50
  • I don't have a .csproj file, I just write the functions in the portal.. – stuartd Nov 23 '18 at 11:03
  • `csproj` does exists in the parent directory of your directory you are working in or in the parent directory where your csx exists – JB's Nov 23 '18 at 11:07
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/184137/discussion-between-jackboys-and-stuartd). – JB's Nov 23 '18 at 11:09