-1

I'm trying to deploy an Azure App Service using Azure Devops.

I'm using the Task Azure App Service deploy version 4.*

I started noticing the following error in the log recently with the deployment failing (saw it first on 24th September)

Applying JSON variable substitution for **/appsettings.json
##[error]Error: NO JSON file matched with specific pattern: **/appsettings.json.

In the pipeline I use the task Extract files to extract *.zip, then use the result to search for **/appsettings.json.

The same task was running fine till a few days ago.
I tried redeploying an old release which was successful earlier, but it failed now with the same above error.

I double checked, there was no changes done in the pipeline recently for this to break.

How can I fix this.

Alen Alex
  • 897
  • 4
  • 15
  • 31
  • 1
    Is it possible to share your complete pipeline definition? Recently we made some changes to the task which would result in this issue, sharing complete pipeline definition would be much better to locate the cause and the solution. Are you using this App deploy task in release pipeline? Have you used Extract task before the app deploy task in your release pipeline? – Mengdi Liang Sep 28 '20 at 02:35
  • 1
    Thanks @MerlinLiang-MSFT for the comment. I figured the issue was with `Extract files` task. – Alen Alex Sep 29 '20 at 07:54

1 Answers1

0

Turns out my issue was not with the task Azure App Service deploy, but with the task Extract Files.

A rough look on my pipeline is as below:

Before the fix

  1. Extract files
    enter image description here
  2. Deploy Azure App Service enter image description here

The JSON variable substitution failed because the Extract files task was not able to find *.zip files in the root folder and hence extracted nothing. So, there was no appsettings.json file in the folder structure at all.

The Fix

  • Update the Extract files task search pattern as **/*.zip

Now my pipeline looks like below.

  1. Extract files
    enter image description here
  2. Deploy Azure App Service enter image description here

It now works fine for me.

Alen Alex
  • 897
  • 4
  • 15
  • 31