azure-functions-templates
azure-functions-templates copied to clipboard
Update .NET project files to copy local.settings.json only if exists
Add a conditional, otherwise it fails when running msbuild in CI pipelines.
<None Update="local.settings.json" Condition="Exists('local.settings.json')">
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Edit: Looks like this might not work.
https://github.com/Azure/azure-functions-core-tools/issues/2252
In F#, this does work for me. The difference is that F# is Include
, not Update
.
<None Include="local.settings.json" Condition="Exists('local.settings.json')">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
Linking with PR #954 which shows a possible solution but has context as to the underlying issue