gog
gog

Reputation: 12988

How to replace appsettings.json variables on team services?

Im trying to make a CD enviroment with as ASP.NET Core (.Net Framework) using team services. The build definition gerates a zipped artifact with the website.

Then in my Release configuration i would like to change some values of my appsettings.json properties, but the artifact is zipped, so apparently the release management has no access to the appsettings.json the logs says that Error: NO JSON file matched with specific pattern: appsettings.json, what is the correct way to do that?

Upvotes: 0

Views: 3745

Answers (1)

Marina Liu
Marina Liu

Reputation: 38136

I eventually run this task both for build and release successfully now. To troubleshooting the issue:

  1. If your release was run on private agent, you should check in the drop folder to check if the artifacts are zipped.
  2. In related build definition check if $(Build.ArtifactStagingDirectory) has zip file. If there has no zip file, you can add Archive Files task to to zip files in $(Build.ArtifactStagingDirectory).
  3. If the appsettings.json is no in the root of zip folder, use **/appsettings.json for JSON variable substitution in Azure App Service Deploy task.

Upvotes: 2

Related Questions