Azure-pipelines-tasks: App Service Deploy: Extra spaces in settings causes BadRequest

Created on 20 Jul 2018  Â·  15Comments  Â·  Source: microsoft/azure-pipelines-tasks

Environment

VSTS Hosted Linux Preview
adamtuliper.visualstudio.com
new.dot.net-custom-branch / Build 0.1.92+g44e6a2bc21
project: new.dot.net

Note: I've worked with @vincentdass on this issue via skype.

Issue Description

Task Name: Azure App Service Deploy
When you edit the "Application and Configuration settings/App Settings" section, if there's an extra space between key/values the parsing routine seems to think they are new key/values and it fails on the post request.

Example
-Key1 true -Key2 "12345"
Note the whitespace between true and -Key2. This will cause
BadRequest - Parameter name cannot be empty. (CODE: 400)

Error logs

From this configuration setting:
-UseAci true -AzureAdClientId "private"

We get the following post request. Note the empty double quotes because of the extra whitespace above.

2018-07-20T15:19:23.3087924Z Updating App Service Application settings. Data: {"UseAci":"true","":"","AzureAdClientId":"private"} 2018-07-20T15:19:23.3090434Z ##[debug][POST]https://management.azure.com/subscriptions/402fe320-hidden/resourceGroups/newdotnet/providers/Microsoft.Web/sites/hidden/config/appsettings/list?api-version=2016-08-01 2018-07-20T15:19:23.5960955Z ##[debug][PUT]https://management.azure.com/subscriptions/402fe320-hidden/resourceGroups/newdotnet/providers/Microsoft.Web/sites/hidden/config/appsettings?api-version=2016-08-01 2018-07-20T15:19:24.2656180Z ##[debug]task result: Failed 2018-07-20T15:19:24.2715267Z ##[error]Error: Failed to update App service 'hidden' application settings. Error: BadRequest - Parameter name cannot be empty. (CODE: 400)

AzureAppService Release bug

Most helpful comment

I had the same issue, but it was due to spaces in my variable value.

Ex:
-Key1 value1 -Key2 $(VariableKey)

The value of Variable Key in the pipeline variable contains spaces. To fix it I have added quotes :
-Key1 value1 -Key2 "$(VariableKey)"

Maybe it will help you @HemanthsGithub; @lavanya56

All 15 comments

@adamtuliper , thanks for reporting the issue.
This is a genuine issue and will be fixed.

The issue is resolved and the fix will be available in upcoming deployment.

Hi Vincent.. Could you please let us know how the issue got resolve cause I am facing the same issue as above

@lavanya56 , the issue is fixed long back. Can you please share the task version that is failing.
If you are in version 3.*, I recommend you to move to 4.*

Vincent, We are using version 4.* for azure app service deploy

@lavanya56 , Can you please share the exact app settings string that caused this issue?

closing the issue as there is no response.

This issue still not yet fixed and keep on throwing the same error message "]Error: Failed to update App service 'xxxx' application settings. Error: BadRequest - Parameter name cannot be empty. (CODE: 400)"

It is a bit tough job to configure each app setting, at least "json" support would have been much better, but basic syntax as per the given example is not working. Using Task version "4"

@HemanthsGithub , Can you please share the appsettings string that caused the issue?
I am unable to repro the issue on my side,
We also have a L0 to cover this case.

Still the issue exists

On Mon, Mar 25, 2019 at 2:29 PM Vincent A (vinca) notifications@github.com
wrote:

@HemanthsGithub https://github.com/HemanthsGithub , Can you please
share the appsettings string that caused the issue?
I am unable to repro the issue on my side,

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/azure-pipelines-tasks/issues/7799#issuecomment-476107574,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Aj8bPtFRkDUbkqhU0xm4KTza_z_pDgUtks5vaI_1gaJpZM4VYdw1
.

--
Thanks & Regards
Hemanth Kumar.P

I had the same issue, but it was due to spaces in my variable value.

Ex:
-Key1 value1 -Key2 $(VariableKey)

The value of Variable Key in the pipeline variable contains spaces. To fix it I have added quotes :
-Key1 value1 -Key2 "$(VariableKey)"

Maybe it will help you @HemanthsGithub; @lavanya56

@HemanthsGithub , Can you please help us reproduce the error?
You can share the logs to RM_CUSTOMER_QUERIES [at] Microsoft [dot] com privately.

@HemanthsGithub Closing this. Please send debug logs (set variable "system.debug" to "true") and send it to RM_CUSTOMER_QUERIES [at] Microsoft [dot] com privately if you are still seeing this.

If anyone comes across this and it isn't a space in your variable issue, this error also appears when the word Azure is in your app setting name.

Error messages that are different when the situation or reason behind them is different would be helpful. I also haven't found in the documentation where it says the word Azure can't be used in your app settings names is, but I'm sure it is a needle in one of the heystacks.

My appsettings that I was trying to update were like this:

{
  "AzureBlobStorage": {
    "ContainerA": "...",
    "ContainerB": "..."
  }
}

Hi All,
I have tried to pass "TriggerTime":0 */2 * * * * as environment variable to azure function using Azure Devops. But,Am facing an error like "application settings. Error: BadRequest - Parameter name cannot be empty. (CODE: 400)". Can anyone please suggest.

For workaround, updating "Trigger Time" manually at Config Tab in Azure Function. Please suggest permanent solution for this.

Thanks In Advance.

Was this page helpful?
0 / 5 - 0 ratings