Azure Pipelines中变量的最大长度是多少? [英] What is the maximum length of a variable in Azure Pipelines?

查看:79
本文介绍了Azure Pipelines中变量的最大长度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在添加以编程方式生成的长字符串作为Azure Pipelines变量(作为测试更改而不是将文件推送到我的仓库中的一种快速简便的方法)后,我得到了此警告:

I got this warning after adding a long string generated programmatically as an Azure Pipelines variable (as a quick and easy way to test changes instead of pushing a file to my repo):

##[warning]Environment variable 'INPUT_SCRIPT' exceeds the maximum supported length. Environment variable length: 40384 , Maximum supported length: 32766

该警告很容易理解,并且在给定常规环境变量的情况下似乎很适当,但是使用此新管道变量的任务按预期工作(假定存在整个字符串).此警告相关吗?如果我只是……留在那儿,它会在后面咬我吗?

The warning is pretty clear to understand and seems appropriate given a regular environment variable, but the task that used this new pipelines variable works as expected (assuming the entire string is there). Is this warning relevant? Will it bite me in the back later if I just ... leave it in?

推荐答案

环境变量的理论最大长度约为32,760个字符.所有环境变量必须一起存在于单个环境块中,该环境块本身最多可以包含32767个字符.实际上,您必须与该块中的所有其他变量共享该环境块,因此您可以使用32,760-字符串不太可能成功.这还取决于您如何设置变量;即您的环境变量设置技术在传递给SetEnvironmentVariable调用之前通过的代码.有关详细信息,请参考此链接.

The theoretical maximum length of an environment variable is around 32,760 characters. All environment variables must live together in a single environment block, which itself has a limit of 32767 characters.In practice, you have to share the environment block with all the other variables in the block, so your random call to SetEnvironmentVariable with a 32,760-character string is unlikely to succeed.It also depends on how you’re setting the variable; i.e., the code that your environment-variable-setting technique passes through before it gets to the SetEnvironmentVariable call. For details ,please refer to this link.

以下两种情况具有相同的警告,以供参考: 1

Here are two cases with the same warning for reference: 1 and 2

此警告是否相关?如果我愿意的话,它会在后面咬我吗 ...留在里面吗?

Is this warning relevant? Will it bite me in the back later if I just ... leave it in?

对于此问题,我没有发现此警告引起的错误.由于您已经关注此问题,因此如果遇到错误,可以在此处共享.让我们进一步调查它们.

For this issue, I have not found the errors caused by this warning. Since you have already paid attention to this issue, if you encounter errors, you can share them here. Let us investigate them further.

这篇关于Azure Pipelines中变量的最大长度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆