Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I configure ENV values from task AzureFunctionApp in ADO pipeline?

How can I configure ENV values from task AzureFunctionApp in ADO pipeline? Basically, when I have a FunctionApp that was created separately from Terraform, on this task that uploads the .jar file, how can I include some environment variables with the push?

Is this possible?

I tried this, but it doesn’t work, and gets a compile error.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

  - task: AzureFunctionApp@1
    inputs:
      azureSubscription: ${{ parameters.serviceConnection }}
      appType: 'functionApp'
      appName: 'my-api-$(environment)'
      package: '$(Pipeline.Workspace)/my-api/my-api-1.0.0'
      runtimeStack: 'JAVA|11'
      configurationStrings:
        - TEST: "what"

I also tried this, which compiles and runs, and it didn’t work for me either. The env variable doesn’t show up in the app settings after deploy.

  - task: AzureFunctionApp@1
    inputs:
      azureSubscription: ${{ parameters.serviceConnection }}
      appType: 'functionApp'
      appName: 'my-api-$(environment)'
      package: '$(Pipeline.Workspace)/my-api/my-api-1.0.0'
      runtimeStack: 'JAVA|11'
      appSettings: "-TEST what"

>Solution :

According to the Azure Function App Task Documentation, the yaml key that you need is appSettings

Try this way:

  - task: AzureFunctionApp@1
    inputs:
      azureSubscription: ${{ parameters.serviceConnection }}
      appType: 'functionApp'
      appName: 'my-api-$(environment)'
      package: '$(Pipeline.Workspace)/my-api/my-api-1.0.0'
      runtimeStack: 'JAVA|11'
      appSettings: '-MY_ENV_VARIABLE test'

Application settings should follow the syntax -key value. Values containing spaces should be enclosed in double quotes.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading