使用服务主体的 Hyperledger Cello Ansible Azure

Hyperledger Cello Ansible Azure using Service Principal

我正在尝试在 Azure 上使用 Cello 配置 Fabric 网络。我使用服务主体作为身份验证方法。

我在 Azure 中有一个 资源组 ,我在我的 azure.yml 文件中配置了正确的 subscriptionId。但是,我收到 错误:Azure 错误:SubscriptionNotFound\nMessage:找不到订阅“********”。

有人遇到过这个错误吗?如何解决?

日志:

PLAY [Get start timestamp] ******************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************
ok: [cloud]

TASK [set_fact] *****************************************************************************************************************************************************************************
ok: [cloud]

PLAY [Prepare to run the workload] **********************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************
ok: [cloud]

TASK [include_tasks] ************************************************************************************************************************************************************************
included: /home/cello/cello/src/operator-dashboard/agent/ansible/roles/cloud_azure/prepare/tasks/apply.yml for cloud

TASK [Setup env specific variables] *********************************************************************************************************************************************************
ok: [cloud]

TASK [Retrieve azure specific image details] ************************************************************************************************************************************************
ok: [cloud]

TASK [Print azure image results] ************************************************************************************************************************************************************
ok: [cloud] => {
    "found_images": {
    "ansible_facts": {
        "azure_vmimages": []
    },
    "changed": false,
    "failed": false
    }
}

TASK [Create azure resource group] **********************************************************************************************************************************************************
fatal: [cloud]: FAILED! => {"changed": false, "msg": "Error creating or updating resource group myresourceGroup - Azure Error: SubscriptionNotFound\nMessage: The subscription '********' could not be found."}
    to retry, use: --limit @/home/cello/cello/src/operator-dashboard/agent/ansible/provcluster.retry

PLAY RECAP **********************************************************************************************************************************************************************************
cloud                      : ok=7    changed=0    unreachable=0    failed=1

未找到您的订阅 ID。

请参阅 this document from microsoft 了解如何配置您的服务主体。

刚发现 Ansible 脚本有问题。请关注此link了解更多详情。

  1. 如果您使用的是 AzureUSGovernment Cloud,请使用 Ansible 2.7
  2. 需要配置cloud_environment为cloud_environment: "AzureUSGovernment"作为环境变量

希望对您有所帮助。