0

I have one VS Solution with multiple function Projects. If I run the solution build in VS, it all works well as it is going to push the bin & function.json in to respective project folder. However, when I run msbuild or dotnet.exe in command line and output into a common folder (for ex: msbuild MB.Azure.sln -property:outdir=\msbuildout), I can see all the libraries going to bin folder but the function.json file is getting deleted for all projects except for the last one that's built in the build chain.

Is this expected behaviour? Is there any way that I can still keep all the function.JSON files? Or is it possible to manually generate the files instead of automatic system generated?

-Srikanth

Srikanth Alluri
  • 133
  • 1
  • 12

1 Answers1

1

I suspect if you are using the same output folder for all projects.

Unless you have a specific requirement to have each function in a separate project, I suggest you create your functions in the same project. Simply create a class file per function.

After you have built the project there will be a folder for all functions, each containing the related function.json.

MMThornberg
  • 344
  • 1
  • 5
  • Yes, there is a reason why all these functions are in different projects. This helps in my deployment - avoid redeploying functions that are not touched or there could be a chance some functions might be still in testing phase.. – Srikanth Alluri Nov 08 '20 at 11:01
  • For testing (and approving) Functions in your Function App before making them live, you can use deployment slots to have a staging "environment" - you can read more about deployment slots at https://learn.microsoft.com/en-us/azure/azure-functions/functions-deployment-slots#why-use-slots – MMThornberg Nov 17 '20 at 06:41
  • Thanks @MMThornberg, we are using deployment slots. but the main idea is - Deploy only the changes what you made, not others. for ex: some functions might have changes that are tested and approved but we still don't want them to be live yet. if all functions are in the same project then there is no way for me to control this scenario. – Srikanth Alluri Nov 18 '20 at 05:53
  • For that scenario you could use multiple Function Apps to provide the separation you need. This does not impact cost. – MMThornberg Nov 19 '20 at 07:12
  • having multiple function apps is not a best approach for us - coz' if all the functions are in one place there is a high chance for us that the functions are hitting more frequently which intern reduces my warmup period. if functions are scattered across multiple functions then some of the functions might not be hitting as frequently as the others which leads them in to longer warmup time. – Srikanth Alluri Nov 19 '20 at 11:08