Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzureFunctionApp@1 has a bug in appSettings parsing #15481

Closed
Yevhen-Mordak opened this issue Nov 5, 2021 · 4 comments
Closed

AzureFunctionApp@1 has a bug in appSettings parsing #15481

Yevhen-Mordak opened this issue Nov 5, 2021 · 4 comments
Assignees

Comments

@Yevhen-Mordak
Copy link

Required Information

The task AzureFunctionApp@1 has a bug in appSettings argument parsing. The trailing space is required after each line in appSettings for proper parsing.

Type: Bug
Task Name: AzureFunctionApp@1

Environment

  • Server - Azure Pipelines
  • Agent - Hosted

Issue Description

the all marked trailing spaces are mandatory.
image

image

Desired fix: new line is enough and trailing spaces have zero influence on how appSettings are parsed.

@v-ibshaik v-ibshaik added environment:need-to-triage Issues need to be triage by environment-deployment team environment:bug and removed bug environment:need-to-triage Issues need to be triage by environment-deployment team route labels Nov 8, 2021
@v-ibshaik v-ibshaik self-assigned this Nov 10, 2021
@v-ibshaik
Copy link
Contributor

Hello Yevhen,

Its not trailing spaces. app settings is considered as single string and we need spaces between two settings. it is documented on official task doc: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-function-app?view=azure-devops#arguments

@Yevhen-Mordak
Copy link
Author

I know spaces are required. I just raise I'm the second person in a team who spent hours to figure out that.

Can you please add '\n' as a valid separator same as the space? that would be great

@v-jkarri
Copy link
Contributor

Issue has been fixed and it will take 30 to 45 days to deploy the fix in production.

v-jkarri added a commit that referenced this issue Dec 22, 2021
* AzureFunctionApp@1 has a bug in appSettings parsing

* AzureFunctionApp@1 has a bug in appSettings parsing #15481

* AzureFunctionApp@1 has a bug in appSettings parsing #15481-added space

* Added space
@sergioprates
Copy link

sergioprates commented May 8, 2024

Hi,

I'm facing the same issue here. To work, I need to put a whitespace at the end of each pair. For anyone facing the same issue, I created a PowerShell script as a workaround.

- task: PowerShell@2
  displayName: 'Parsing secrets'
  inputs:
    targetType: 'inline'
    script: |
      $blob_storage_function = $env:blob_storage_function
      $api_host_url= $env:api_host_url

      $appsettings = "-AzureWebJobsStorage `"$blob_storage_function`" "
      $appsettings += "-ApiUrl `"$api_host_url`" "

      Write-Host "##vso[task.setvariable variable=APPSETTINGS_VALUE]$appsettings"

- task: AzureFunctionApp@1
  displayName: Publish Azure Function
  inputs:
    azureSubscription: "service connection"
    appType: 'functionApp'
    appName: 'app-name'
    package: '$(ArtifactPath)'
    resourceGroupName: "rg-resource-group"
    deploymentMethod: 'auto'
    appSettings: "$(APPSETTINGS_VALUE)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants