AZ-CLI现在允许我执行简单/基本操作,因此限制了我获取所需信息

发布于 2025-01-25 03:44:30 字数 600 浏览 2 评论 0原文

我正在为一个组织工作,该组织不允许使用仍在开发的功能,因此我的问题。

我正在通过Azure管道运行所有内容,因此我无法存储从AZ-CLI获得的变量,然后使用PowerShell例如在该变量上执行操作。

该问题特别在于列表(是的,实际上,就像所有计算机编程中最常见且文化良好的结构之一一样)。

我正在尝试获取我创建的V-NET拥有的可用IP地址。请记住,这是一个很大的组织,我无法自己指定这些组织,因为它是样本板YML代码来创建VNET的一项相当普遍的任务。

因此,我尝试在管道中立即运行AZ-CLI命令:

az network vnet list-available-ips -g MyResourceGroup -n MyVNet

这正确返回了我要寻找的可用IP-Addresses。

但是,存储一次这些值似乎是不可能的。我不允许在

--query [0]

命令之后运行,因为这是当前正在开发的命令。

我似乎无法对存储此列表的变量执行任何操作。我在这里迷路。如何访问此列表中的1个结果,然后将其存储为单独的变量?我需要能够将此值存储在我的库中,以获取开发管道中的进一步步骤

I am working for an organisation which doesn't allow to make use of functions that are still under development, hence my problem.

I am running everything through Azure Pipelines, so I can't store variables I get from the Az-Cli and then use powershell for example to perform operations on that variable.

The issue specifically lies in Lists (Yes, really, like one of the most common and well documented structures in all of computer programming).

I am trying to get the available IP-addresses my created V-NET has. Keep in mind, this being a big organisation I am not able to specify these myself as it's a fairly common task with boilerplate yml code to create the vnet.

Hence, I try running the az-cli command right after in the pipeline:

az network vnet list-available-ips -g MyResourceGroup -n MyVNet

This correctly returns the available ip-addresses that I am looking for.

HOWEVER storing once of these values seem to be impossible. I am not allowed to run

--query [0]

after the command as this is a command currently under development.

I do not seem to be able to perform ANY action on the variable in which I stored this list. I am at lost here. How do I get access to 1 of the results in this list and then store this as separate variable? I need to be able to store this value in my library for further steps in my development pipeline

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文