fix(azure): fix empty subscriptions case (#2455)

This commit is contained in:
Nacho Rivera
2023-06-06 17:31:43 +02:00
committed by GitHub
parent b047b54545
commit 37e180827a

View File

@@ -168,6 +168,13 @@ class Azure_Provider:
)
identity.subscriptions.update({subscription.display_name: id})
# If there are no subscriptions listed -> checks are not going to be run against any resource
if not identity.subscriptions:
logger.critical(
"It was not possible to retrieve any subscriptions, please check your permission assignments"
)
sys.exit(1)
tenants = subscriptions_client.tenants.list()
for tenant in tenants:
identity.tenant_ids.append(tenant.tenant_id)