How to pass more than 5000 characters as command to Azure CLI task?

Nabeel 0 Reputation points
2023-05-08T00:59:29.5466667+00:00

There is an Azure CLI v2 task in one of my Azure DevOps release pipelines. Its Script Type is set as Shell and Script Location is set as Inline Script. The script contains a large az container create command at the moment and it works fine. I need to update this Inline Script with some additional environment variables but when copy/pasting the command in it I get the below error:

This input does not support more than 5,000 characters. The pasted content has been clipped.

What is a workaround for this?

Community Center Not monitored
{count} votes

1 answer

Sort by: Most helpful
  1. shiva patpi 13,366 Reputation points Microsoft Employee Moderator
    2023-05-08T01:38:54.87+00:00

    @Nabeel

    I think in Azure Devops pipeline we can use the concept of variable group(s). For example , you can create a variable group for additional environment variables and use that variable names in the InlineScript !!

    Syntax to use : If the variable name is test , in the script field you can refer it by $({nameofvariablegroupname.test})

    https://learn.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=yaml

    see the usage here:

    https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch

    One more alternative:-

    Use script Type: FilePath , give the path to the script file

    Regards,

    Shiva.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.