You can onboard an Azure account automatically by using scripts instead of manually registering an application and creating event mechanism. You can copy the pre-defined Carbon Black Cloud scripts from the Carbon Black Cloud console, execute them in the Azure portal, and automatically retrieve all the data for onboarding your Azure account.

To add your Azure account automatically to the Carbon Black Cloud console you use the Add Public Cloud Account wizard. This Carbon Black Cloud wizard provides two scripts that you must run in the Azure portal. The first script outputs details for the Connect Account page of the wizard and the second script enables the event stream mechanism.


Verify you have available the subscription name and subscription ID.


  1. On the left navigation pane, go to Settings > Public Cloud Accounts.
  2. On the Public Cloud Accounts page, click Add Account.
    The Add Public Cloud Account window displays.
  3. Select Azure under Cloud Provider and Single account under Method.
  4. On the next page, enter the Azure subscription details and click Next.
  5. On the Connect Account page, locate the script on the right and copy its content.
  6. Go to the Azure portal and open the Azure Cloud Shell.
  7. Run the command you copied from the Carbon Black Cloud wizard: curl -o && bash --SubscriptionId <Subscription_ID>
    The script takes the following parameters.
    ScriptURL The onboarding environment. For example,
    SubscriptionId The Azure subscription ID. For example, a1866144-6ff3-4715-b5ff-12239186786e
    After the script executes with success, the Azure portal prints out the details for connecting to the account.
  8. Enter these values in the Connect Account details page of Add Public Cloud Account wizard and click Next.
  9. To enable the event stream mechanism, copy the script and run it in the Azure Cloud Shell.
    curl -o && bash --CBInventoryApiHost <APIHost> --CBInventoryOrgKey <Org_Key> --CBInventoryApiKey <API_Secret_Key>/<API_ID> --ResourceGroupLocation <location> --SubscriptionId <Subscription_ID>
    ScriptURL The onboarding environment. For example,
    CBInventoryApiHost The host for Carbon Black Public Cloud service. For example,
    CBInventoryOrgKey The Org key. Locate it in Carbon Black Cloud console by navigating to the > Settings > API Access > API Keys tab. For example, 8X5TJVYWQ.
    CBInventoryApiKey The API Key. It is stored in the secret manager and needs to be passed when sending the push notification to Carbon Black Cloud. For more details, see Create and Manage an API Key.
    ResourceGroupLocation Azure resources location.
    SubscriptionId The Azure subscription ID. For example, a1866144-6ff3-4715-b5ff-12239186786e
  10. To onboard your Azure subscription, select Add Account.


Once your Azure subscription onboards, you can view it in the list of public cloud accounts under Settings > Public Cloud Accounts. If in the process of onboarding your subscription you select Add Account without executing the event stream mechanism script, the subscription shows in the lists of accounts with the Event stream not enabled status.