Copy new appsettings.json to include in Azure DevOps publish

%3CLINGO-SUB%20id%3D%22lingo-sub-1822627%22%20slang%3D%22en-US%22%3ECopy%20new%20appsettings.json%20to%20include%20in%20Azure%20DevOps%20publish%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1822627%22%20slang%3D%22en-US%22%3E%3CP%3EBy%20using%20Azure%20DevOps%20build%20pipeline%20we%20want%20to%20copy%20a%20common%20%22appsettings.production.json%22%20from%20our%20solution%20into%20the%20ArtifactStagingDirectory%20before%20publishing%20the%20artifacts%20to%20the%20Azure%20container%20drop%20location.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20build%20pipelines%20is%26nbsp%3B%3C%2FP%3E%3CP%3E-%20%3CA%20href%3D%22mailto%3ADotNetCoreCLI%402%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EDotNetCoreCLI%402%3C%2FA%3E%26nbsp%3B(build)%3C%2FP%3E%3CP%3E-%20%3CA%20href%3D%22mailto%3ACopyFiles%402%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECopyFiles%402%3C%2FA%3E%3C%2FP%3E%3CP%3E-%20%3CA%20href%3D%22mailto%3ADotNetCoreCLI%402%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EDotNetCoreCLI%402%3C%2FA%3E%26nbsp%3B(publish%20with%20zip)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20can%20verify%20that%20the%20appsetting.production.json%20gets%20copied%20to%20the%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EBuild.SourcesDirectory%20-%20however%20once%20the%20artifact%20is%20zipped%20and%20dropped%2C%20the%20file%20is%20not%20included.%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIsn't%20it%20possible%20to%20include%20a%20file%20into%20the%20SourcesDirectory%20before%20pushlishing%20with%20zip%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

By using Azure DevOps build pipeline we want to copy a common "appsettings.production.json" from our solution into the ArtifactStagingDirectory before publishing the artifacts to the Azure container drop location.

 

The build pipelines is 

- DotNetCoreCLI@2 (build)

- CopyFiles@2

- DotNetCoreCLI@2 (publish with zip)

 

We can verify that the appsetting.production.json gets copied to the 

Build.SourcesDirectory - however once the artifact is zipped and dropped, the file is not included.

 

Isn't it possible to include a file into the SourcesDirectory before pushlishing with zip ?

0 Replies