Azure-docs: Default Value of Variables

Created on 31 May 2020  Â·  4Comments  Â·  Source: MicrosoftDocs/azure-docs

Hey !

I want to directly assign values passed as parameters to variables. To keep things cohesive, I only want to use variables in my pipeline. One obvious way to assign parameter value to a variable, a Set Variable activity.

Another way is via "defaultValue" attribute in variables. In case of string parameters, I can do this by adding @{pipeine().parameters.<< parameterName >>} to defaultValue of a variable, and value of variable becomes same as that of parameter.

For example, consider eventEndTime as a parameter of type string to my pipeline, if I do following the value passed for this parameter gets assigned to the variable EventEndTime automatically without a Set Variable activity.

"EventEndTime": {
                "type": "String",
                "defaultValue": "@{pipeline().parameters.eventEndTime}"
            }

How to do the same in case my parameter is of type Array instead of String?

Additionally, I know there is a limit of 50 parameters per pipeline, is their a similar limit on number of variables too?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 cxp data-factorsvc product-question triaged

All 4 comments

@Hasil-Sharma, Thanks for the feedback! We are taking a look into this and will get back to you soon.

@Hasil-Sharma Thank you for bringing this interesting issue to our attention. I have tried assigning expressions to array type variable default values, and run into the same issue. I will reach out internally for more info.

@Hasil-Sharma The developers have added to their backlog, a work item to allow you to assign the default value for array type variables, just like you are for string type variables. No ETA at this time.

Until then, you will need to use the Set Variable activity.

I did not hear back on the maximum number of variables. I did a test. I created a pipeline with ~53+ parameters and ~53 variables+. No errors were thrown when I debugged.

Thanks, Martin. Appreciate your efforts.

Not a blocker for me, though important as number of activities per pipeline are limited to 50 and using limited slots for Set-Variable activity to do a direct assignment seems to a drawback.

please-close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

varma31 picture varma31  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments

Favna picture Favna  Â·  3Comments

bityob picture bityob  Â·  3Comments