12345678910111213141516 |
- def create_azure_account(env, CloudCheckrApiKey, account_name, AzureDirectoryId, AzureCloudCheckrApplicationId,
- AzureCloudCheckrApplicationSecret, AzureSubscriptionId):
- """
- Creates an Azure Account in CloudCheckr. It will populate it with azure subscription credentials that were provided.
- """
- api_url = env + "/api/account.json/add_azure_inventory_account"
- add_azure_account_info = json.dumps(
- {"account_name": account_name, "azure_ad_id": AzureDirectoryId, "azure_app_id": AzureCloudCheckrApplicationId,
- "azure_api_access_key": AzureCloudCheckrApplicationSecret, "azure_subscription_id": AzureSubscriptionId})
- r7 = requests.post(api_url, headers={"Content-Type": "application/json", "access_key": CloudCheckrApiKey},
- data=add_azure_account_info)
- print(r7.json())
|