I want to create a Nuget package of my Azure functions V2 project so that i can push it to octopus for deployment. But I am facing issues, Currently I am using dotnet pack <.csproj> to package my code into .nupkg. If I use simple console .net core application or library .net core than I am able to get nupkg file but if I run dotnet pack <.csproj> on my azure functions project than I get publish folder as bin\Debug\netcoreapp2.1\publish. And in publish folder my code files and dlls are present. But where is the nupkg file?
Asked
Active
Viewed 364 times
1 Answers
1
This question is an old question, take a look here:
https://github.com/Azure/azure-functions-vs-build-sdk/issues/110
dotnet pack cannot package azure function. The IsPackable property seems to be forcibly locked to false, and even modifying the property manually will not help. dotnet cli will refuse to generate .nupkg files.
In fact, simply referencing Microsoft.NET.Sdk.Functions in your project will invalidate the dotnet pack. This is not your mistake, but the design of the azure function.

Cindy Pau
- 13,085
- 1
- 15
- 27
-
1Great, thanks. I was using dotnet pack task in my build pipeline in Azure DevOps. I replaced it with Package Application for Octopus task and I was able to package it, other way would be to build the project and use Nuspec file to package all the stuff in it. – Bilal Shafqat Mar 24 '20 at 11:50