Hyperledger Cello Ansible Azure using Service Principal

92 views Asked by At

I am trying to configure Fabric network using Cello on Azure. I am using Service Principal as the authentication method.

I have a resource group in Azure which I have configured in my azure.yml file with proper subscriptionId. But, I am getting an Error: Azure Error: SubscriptionNotFound\nMessage: The subscription '********' could not be found.

Has anyone faced this error? How this can be resolved?

logs:

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
2

There are 2 answers

0
Nitish Bhardwaj On BEST ANSWER

Just found out that there was an issue with Ansible scripts. Please follow this link for more details.

  1. Use Ansible 2.7 if you are using AzureUSGovernment Cloud.
  2. Need to configure cloud_environment as cloud_environment: "AzureUSGovernment" as environment variable

Hope this helps.

1
Kylie On

Your subscription ID is not found.

Refer to this document from microsoft to know how to configure your service principal.