Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create the .zip file for a C# Azure Functions zip deployment in Visual Studio 2019?

Using Visual Studio 2019, I created a C#, .NET Core Azure Function.

I like to do a zip deployment the way that it is explained here:

https://docs.microsoft.com/en-us/azure/azure-functions/deployment-zip-push

What is the most automated option to use Visual Studio 2019 to create the zip file for the zip deployment?

like image 265
Allan Xu Avatar asked Oct 31 '19 03:10

Allan Xu


1 Answers

Navigate to the root folder of your Functionapp where your functionApp.csproj exists and run the below command

dotnet build /p:DeployOnBuild=true /p:DeployTarget=Package;CreatePackageOnPublish=true

This will publish the folders and files which are ready to be zipped in the bin/Publish folder. You can now use the Compress-Archive powershell cmdlet to zip the folder or any other way which you prefer.

like image 173
HariHaran Avatar answered Jan 03 '23 01:01

HariHaran