0

I am using Packer to build images and upload them to Azure China. Some of the images are built successfully /the docker and consul images/ however the rest, such as the elastic search data and master are giving me the error below once packer build was called.

Build 'azure-arm' errored: adal: Refresh request failed. Status Code = '400'. 
Response body: 
{"error":"invalid_request","error_description":"AADSTS90002: Tenant 'XXX'
not found. This may happen if there are no active subscriptions for the tenant. 
Check with your subscription administrator. ...}

All the images are built from the same script:

    packer build \
        -var tag=$tag \
        -var base_img=$base_img \
        -var client_id=$client_id \
        -var resource_group_name=$resource_group \
        -var client_secret=$client_secret \
        -var tenant_id=$tenant_id \
        -var subscription_id=$subscription_id \
        -var az_cloud_environment_name=China\
        packer.json

Where the resource group, subscription id, tenant, secrets are the same for all the images. That is why I believe it is not due to issues with mismatched credentials or tenant. Any help/ideas will be appreciated.

yanis
  • 303
  • 3
  • 15
  • It seems there is no active subscription in your tenant. You need to check if the subscription exists and active. – Charles Xu Nov 07 '19 at 01:26
  • Yes, the subscription exists and is active. I am able to successfully create an image which contains docker and consul. However, if I try creating a different image it fails with this not image specific error. Looks like there is an issue in `github` https://github.com/hashicorp/consul/issues/5040 . But not sure how to use it to fix my problem. – yanis Nov 07 '19 at 17:26

0 Answers0