【发布时间】:2021-05-05 07:13:27
【问题描述】:
我正在编写一个 shell 脚本来删除 Azure 中的虚拟机。作为其中的一部分,我需要访问一个 YAML 文件(如下所示),该文件具有用于不同订阅的 azure 服务主体。现在我不确定如何在我的脚本中加载这个 YAML 文件。
123456-5897-1223357-7889:
subscription_id: "123456789"
client_id: "123456789"
secret: "123456789"
tenant: "1234567899"
azure_cloud_environment: "AzureCloud"
578945-5897-1223357-7889:
subscription_id: "987456123"
client_id: "987456123"
secret: "987456123"
tenant: "987456123"
azure_cloud_environment: "AzureCloud"
有没有办法像我们在 GCP 中那样获取这个文件,或者有没有办法从 YAML 文件中加载文件
gcloud auth activate-service-account --key-file="/tmp/project1.json"
gcloud config set project project1
【问题讨论】:
标签: bash azure shell azure-virtual-machine azure-cli