Azure-pipelines-tasks: Azure Functions Deploy Task Fails if setting contains a comma

Created on 30 Apr 2020  路  5Comments  路  Source: microsoft/azure-pipelines-tasks

Note

Issues in this repo are for tracking bugs, feature requests and questions for the tasks in this repo

For a list:
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

If you have an issue or request for the Azure Pipelines service, use developer community instead:

https://developercommunity.visualstudio.com/spaces/21/index.html )

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: BUG

Enter Task Name: Azure Functions Deploy v.1

list here (V# not needed):
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

Environment

  • Server - Azure Pipelines or TFS on-premises?

    • If using TFS on-premises, provide the version:

    • If using Azure Pipelines, provide the account name, team project name, build definition name/build number: dfe-ssp, S122-Assessment-Service, ReleaseId=1020, EnvironmentId=2590

  • Agent - Hosted or Private:

    • If using Hosted agent, provide agent queue name: Queue ID: 323

    • If using private agent, provide the OS of the machine running the agent and the agent version:

Issue Description

When deploying Azure Functions and I suspect but havent tested App Services, if a setting values string contains a comma the the parameters are parsed incorrectly. See around the user.

2020-04-30T07:35:30.8984214Z Trying to update App Service Application settings. Data: {"OperationalDb":"Server=tcp:***;Database=***;User","":"ID=***;Password=***;Trusted_Connection=False;Encrypt=True;","AuditServiceBus":"***","AuditTopic":"audit-topic","AuditSubscriptionName":"audit-subscription"}
2020-04-30T07:35:31.1995137Z ##[error]Error: Failed to update App service 'xxxx' application settings. Error: BadRequest - Parameter name cannot be empty. (CODE: 400)

Task logs

[Enable debug logging and please provide the zip file containing all the logs for a speedy resolution]

Troubleshooting

Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting

Error logs

[Insert error from the logs here for a quick overview]

Release bug

Most helpful comment

Please use Azure App Service Settings for updating app/configuration settings for all the app services. We have added JSON parsing which handles all the special characters.

All 5 comments

@colinbull Please confirm which task are you using.
We have moved to JSON parsing now in the new task which should not cause this error:
https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/AzureAppServiceSettingsV1

Please use Azure App Service Settings for updating app/configuration settings for all the app services. We have added JSON parsing which handles all the special characters.

I am using Azure App Service Settings but still i got below error

Trying to update App Service Application settings. Data: {"":"[\n   {\n      \"name\

##[error]Error: Failed to update App service 'cli-test-func-app' application settings. Error: BadRequest - Parameter name cannot be empty. (CODE: 400)

I see while pipeline is pushing the settings, the key is missing in the start, you can find in above code also

I am using Azure App Service Settings but still i got below error

Trying to update App Service Application settings. Data: {"":"[\n   {\n      \"name\

##[error]Error: Failed to update App service 'cli-test-func-app' application settings. Error: BadRequest - Parameter name cannot be empty. (CODE: 400)

I see while pipeline is pushing the settings, the key is missing in the start, you can find in above code also

The real problem lies that we should not give the settings in JSON format and should follow -Key value format

We should update the documentation here https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-app-service-settings?view=azure-devops where appsettings is still json format as below
[ { "name": "APPINSIGHTS_INSTRUMENTATIONKEY", "value": "$(Key)", "slotSetting": false }, { "name": "MYSQL_DATABASE_NAME", "value": "$(DB_Name)", "slotSetting": false } ]

Was this page helpful?
0 / 5 - 0 ratings