Add Azure accounts via the Cloudcraft API

Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.

Cloudcraft currently doesn’t offer a way to add multiple Azure accounts at once using the web interface, but you can do so via the API.

The ability to add and scan Azure accounts, as well as to use Cloudcraft's developer API, is only available to Pro subscribers. Check out Cloudcraft's pricing page for more information.

Prerequisites

Before you begin, make sure you have the following:

  • A Cloudcraft user with the Owner or Administrator role.
  • An active Cloudcraft Pro subscription.
  • An Azure account with proper permissions.
  • A Unix-like environment, such as Linux, macOS, or WSL on Windows with cURL installed.
  • A basic understanding of the command-line interface.
  • A basic understanding of how to use APIs.

You must also have the Application ID, Directory ID, Subscription ID, and Client secret for your Azure account. For help locating these values, see Connect your Azure account with Cloudcraft.

Adding an Azure account

To add your Azure account to Cloudcraft, open the command line and enter the following cURL command:

curl \
  --url 'https://api.cloudcraft.co/azure/account' \
  --tlsv1.2 \
  --proto '=https' \
  --silent \
  --header 'Content-Type: application/json' \
  --header "Authorization: Bearer ${API_KEY}" \
  --data-raw '{"name":"AZURE_ACCOUNT_NAME","applicationId": "APPLICATION_ID","directoryId": "DIRECTORY_ID","subscriptionId": "SUBSCRIPTION_ID","clientSecret": "CLIENT_SECRET"}'

Replace _AZURE_ACCOUNT_NAME_ with the name you want the account to have in Cloudcraft and the other values with the actual values. Replace _API_KEY_ with your API key.

After you successfully add the account, you can use the same command to add additional accounts to Cloudcraft.