Azure / Azure/azure-functions-host

Visual Studio v1 app publishing deploys unnecessary files

Open
#2,558 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

Apologies if this is the wrong repo. I noticed my deployment from Visual Studio seemed unnecessarily slow. When investigating, I observed that a lot of files are being deployed to my function app that should not be.

Here is my project file.

```xml


net461
v1




```

Note that the [Microsoft.Azure.WebJobs.Extensions.DurableFunctions](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask) extension dual-targets .NET Framework 4.6 and .NET Standard 2.0, as does [Microsoft.NET.Sdk.Functions](https://www.nuget.org/packages/Microsoft.NET.Sdk.Functions/)

Here is the publish output:

```
1>------ Build started: Project: DFMapReduce, Configuration: Release Any CPU ------
1>DFMapReduce -> c:\users\cgillum\source\repos\DFMapReduce\bin\Release\net461\bin\DFMapReduce.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Publish Started
DFMapReduce -> c:\users\cgillum\source\repos\DFMapReduce\bin\Release\net461\bin\DFMapReduce.dll
DFMapReduce -> c:\users\cgillum\source\repos\DFMapReduce\obj\Release\net461\PubTmp\Out\
Adding directory (DFMapReduce\bin).
Adding directory (DFMapReduce\bin\de).
Adding directory (DFMapReduce\bin\es).
Adding directory (DFMapReduce\bin\fr).
Adding directory (DFMapReduce\bin\it).
Adding directory (DFMapReduce\bin\ja).
Adding directory (DFMapReduce\bin\ko).
Adding directory (DFMapReduce\bin\ru).
Adding directory (DFMapReduce\bin\runtimes).
Adding directory (DFMapReduce\bin\runtimes\osx).
Adding directory (DFMapReduce\bin\runtimes\osx\lib).
Adding directory (DFMapReduce\bin\runtimes\osx\lib\netstandard1.6).
Adding directory (DFMapReduce\bin\runtimes\unix).
Adding directory (DFMapReduce\bin\runtimes\unix\lib).
Adding directory (DFMapReduce\bin\runtimes\unix\lib\netstandard1.1).
Adding directory (DFMapReduce\bin\runtimes\unix\lib\netstandard1.3).
Adding directory (DFMapReduce\bin\runtimes\unix\lib\netstandard1.6).
Adding directory (DFMapReduce\bin\runtimes\win).
Adding directory (DFMapReduce\bin\runtimes\win\lib).
Adding directory (DFMapReduce\bin\runtimes\win\lib\net45).
Adding directory (DFMapReduce\bin\runtimes\win\lib\net46).
Adding directory (DFMapReduce\bin\runtimes\win\lib\net461).
Adding directory (DFMapReduce\bin\zh-Hans).
Adding directory (DFMapReduce\bin\zh-Hant).
Adding directory (DFMapReduce\GetDataFiles).
Adding directory (DFMapReduce\MapReduceOrchestration).
Adding directory (DFMapReduce\ProcessTripDataFile).
Adding directory (DFMapReduce\StartMapReduce).
Adding file (DFMapReduce\bin\de\Microsoft.Data.Edm.resources.dll).
Adding file (DFMapReduce\bin\de\Microsoft.Data.OData.resources.dll).
Adding file (DFMapReduce\bin\de\Microsoft.Data.Services.Client.resources.dll).
Adding file (DFMapReduce\bin\de\System.Spatial.resources.dll).
Adding file (DFMapReduce\bin\DFMapReduce.dll).
Adding file (DFMapReduce\bin\DFMapReduce.pdb).
Adding file (DFMapReduce\bin\DurableTask.AzureStorage.dll).
Adding file (DFMapReduce\bin\DurableTask.Core.dll).
Adding file (DFMapReduce\bin\es\Microsoft.Data.Edm.resources.dll).
Adding file (DFMapReduce\bin\es\Microsoft.Data.OData.resources.dll).
Adding file (DFMapReduce\bin\es\Microsoft.Data.Services.Client.resources.dll).
Adding file (DFMapReduce\bin\es\System.Spatial.resources.dll).
Adding file (DFMapReduce\bin\fr\Microsoft.Data.Edm.resources.dll).
Adding file (DFMapReduce\bin\fr\Microsoft.Data.OData.resources.dll).
Adding file (DFMapReduce\bin\fr\Microsoft.Data.Services.Client.resources.dll).
Adding file (DFMapReduce\bin\fr\System.Spatial.resources.dll).
Adding file (DFMapReduce\bin\ImpromptuInterface.dll).
Adding file (DFMapReduce\bin\it\Microsoft.Data.Edm.resources.dll).
Adding file (DFMapReduce\bin\it\Microsoft.Data.OData.resources.dll).
Adding file (DFMapReduce\bin\it\Microsoft.Data.Services.Client.resources.dll).
Adding file (DFMapReduce\bin\it\System.Spatial.resources.dll).
Adding file (DFMapReduce\bin\ja\Microsoft.Data.Edm.resources.dll).
Adding file (DFMapReduce\bin\ja\Microsoft.Data.OData.resources.dll).
Adding file (DFMapReduce\bin\ja\Microsoft.Data.Services.Client.resources.dll).
Adding file (DFMapReduce\bin\ja\System.Spatial.resources.dll).
Adding file (DFMapReduce\bin\ko\Microsoft.Data.Edm.resources.dll).
Adding file (DFMapReduce\bin\ko\Microsoft.Data.OData.resources.dll).
Adding file (DFMapReduce\bin\ko\Microsoft.Data.Services.Client.resources.dll).
Adding file (DFMapReduce\bin\ko\System.Spatial.resources.dll).
Adding file (DFMapReduce\bin\Microsoft.Azure.KeyVault.Core.dll).
Adding file (DFMapReduce\bin\Microsoft.Azure.WebJobs.dll).
Adding file (DFMapReduce\bin\Microsoft.Azure.WebJobs.Extensions.dll).
Adding file (DFMapReduce\bin\Microsoft.Azure.WebJobs.Extensions.DurableTask.dll).
Adding file (DFMapReduce\bin\Microsoft.Azure.WebJobs.Extensions.Http.dll).
Adding file (DFMapReduce\bin\Microsoft.Azure.WebJobs.Host.dll).
Adding file (DFMapReduce\bin\Microsoft.Data.Edm.dll).
Adding file (DFMapReduce\bin\Microsoft.Data.OData.dll).
Adding file (DFMapReduce\bin\Microsoft.Data.Services.Client.dll).
Adding file (DFMapReduce\bin\Microsoft.Extensions.Logging.Abstractions.dll).
Adding file (DFMapReduce\bin\Microsoft.Win32.Primitives.dll).
Adding file (DFMapReduce\bin\Microsoft.WindowsAzure.Storage.dll).
Adding file (DFMapReduce\bin\NCrontab.dll).
Adding file (DFMapReduce\bin\Newtonsoft.Json.dll).
Adding file (DFMapReduce\bin\ru\Microsoft.Data.Edm.resources.dll).
Adding file (DFMapReduce\bin\ru\Microsoft.Data.OData.resources.dll).
Adding file (DFMapReduce\bin\ru\Microsoft.Data.Services.Client.resources.dll).
Adding file (DFMapReduce\bin\ru\System.Spatial.resources.dll).
Adding file (DFMapReduce\bin\runtimes\osx\lib\netstandard1.6\System.Security.Cryptography.Algorithms.dll).
Adding file (DFMapReduce\bin\runtimes\unix\lib\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll).
Adding file (DFMapReduce\bin\runtimes\unix\lib\netstandard1.3\System.IO.Compression.dll).
Adding file (DFMapReduce\bin\runtimes\unix\lib\netstandard1.3\System.Security.Cryptography.Encoding.dll).
Adding file (DFMapReduce\bin\runtimes\unix\lib\netstandard1.6\System.Net.Http.dll).
Adding file (DFMapReduce\bin\runtimes\unix\lib\netstandard1.6\System.Security.Cryptography.Algorithms.dll).
Adding file (DFMapReduce\bin\runtimes\unix\lib\netstandard1.6\System.Security.Cryptography.X509Certificates.dll).
Adding file (DFMapReduce\bin\runtimes\win\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll).
Adding file (DFMapReduce\bin\runtimes\win\lib\net46\System.IO.Compression.dll).
Adding file (DFMapReduce\bin\runtimes\win\lib\net46\System.Net.Http.dll).
Adding file (DFMapReduce\bin\runtimes\win\lib\net46\System.Security.Cryptography.Encoding.dll).
Adding file (DFMapReduce\bin\runtimes\win\lib\net461\System.Security.Cryptography.Algorithms.dll).
Adding file (DFMapReduce\bin\runtimes\win\lib\net461\System.Security.Cryptography.X509Certificates.dll).
Adding file (DFMapReduce\bin\System.AppContext.dll).
Adding file (DFMapReduce\bin\System.Console.dll).
Adding file (DFMapReduce\bin\System.Diagnostics.DiagnosticSource.dll).
Adding file (DFMapReduce\bin\System.Globalization.Calendars.dll).
Adding file (DFMapReduce\bin\System.IO.Compression.dll).
Adding file (DFMapReduce\bin\System.IO.Compression.ZipFile.dll).
Adding file (DFMapReduce\bin\System.IO.FileSystem.dll).
Adding file (DFMapReduce\bin\System.IO.FileSystem.Primitives.dll).
Adding file (DFMapReduce\bin\System.Net.Http.dll).
Adding file (DFMapReduce\bin\System.Net.Http.Formatting.dll).
Adding file (DFMapReduce\bin\System.Net.Sockets.dll).
Adding file (DFMapReduce\bin\System.Runtime.InteropServices.RuntimeInformation.dll).
Adding file (DFMapReduce\bin\System.Security.Cryptography.Algorithms.dll).
Adding file (DFMapReduce\bin\System.Security.Cryptography.Encoding.dll).
Adding file (DFMapReduce\bin\System.Security.Cryptography.Primitives.dll).
Adding file (DFMapReduce\bin\System.Security.Cryptography.X509Certificates.dll).
Adding file (DFMapReduce\bin\System.Spatial.dll).
Adding file (DFMapReduce\bin\System.Threading.Tasks.Dataflow.dll).
Adding file (DFMapReduce\bin\System.ValueTuple.dll).
Adding file (DFMapReduce\bin\System.Web.Http.dll).
Adding file (DFMapReduce\bin\System.Xml.ReaderWriter.dll).
Adding file (DFMapReduce\bin\zh-Hans\Microsoft.Data.Edm.resources.dll).
Adding file (DFMapReduce\bin\zh-Hans\Microsoft.Data.OData.resources.dll).
Adding file (DFMapReduce\bin\zh-Hans\Microsoft.Data.Services.Client.resources.dll).
Adding file (DFMapReduce\bin\zh-Hans\System.Spatial.resources.dll).
Adding file (DFMapReduce\bin\zh-Hant\Microsoft.Data.Edm.resources.dll).
Adding file (DFMapReduce\bin\zh-Hant\Microsoft.Data.OData.resources.dll).
Adding file (DFMapReduce\bin\zh-Hant\Microsoft.Data.Services.Client.resources.dll).
Adding file (DFMapReduce\bin\zh-Hant\System.Spatial.resources.dll).
Adding file (DFMapReduce\GetDataFiles\function.json).
Updating file (DFMapReduce\host.json).
Adding file (DFMapReduce\MapReduceOrchestration\function.json).
Adding file (DFMapReduce\ProcessTripDataFile\function.json).
Adding file (DFMapReduce\StartMapReduce\function.json).
Publish Succeeded.
Publish completed.
```
Basically, it looks like a lot of .NET Standard assemblies are being deployed, even though my project is targeting Functions v1. I'm also seeing macOS dependencies getting deployed, even though the target system is Windows. This file I/O seems to add significant time to my deployments. Not sure about cold-starts, but i worry that could be affected as well.

My version of Visual Studio is **15.4.4**. My version of the Functions CLI is **1.0.9**.

Contributor guide

Open the contributing guide

Research direction

Begin with the supplied project file and publish output, reproducing the deployment with Visual Studio 15.4.4 and Functions CLI 1.0.9. Trace how the v1/net461 target selects files, including the listed runtimes folders, and compare the published contents with the Windows target. Done means unnecessary .NET Standard and macOS assemblies are no longer included.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.