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.
Prerequisites
Verify you have available the subscription name and subscription ID.
Procedure
- On the left navigation pane, go to .
- On the Public Cloud Accounts page, click Add Account.
The
Add Public Cloud Account window displays.
- Select Azure under Cloud Provider and Single account under Method.
- On the next page, enter the Azure subscription details and click Next.
- On the Connect Account page, locate the script on the right and copy its content.
- Go to the Azure portal and open the Azure Cloud Shell.
- Run the command you copied from the Carbon Black Cloud wizard:
curl https://dev.cwp.cbdtest.io/public-cloud/dev01/azure/pre-onboarding-setup/shell/setup-cbc-pre-account-onboarding.sh -o setup-cbc-pre-account-onboarding.sh && bash setup-cbc-pre-account-onboarding.sh --SubscriptionId <Subscription_ID>
The script takes the following parameters.
ScriptURL |
The onboarding environment. For example, https://dev.cwp.cbdtest.io/public-cloud/dev01/azure/pre-onboarding-setup/shell/setup-cbc-pre-account-onboarding.sh |
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.
- Enter these values in the Connect Account details page of Add Public Cloud Account wizard and click Next.
- To enable the event stream mechanism, copy the script and run it in the Azure Cloud Shell.
curl https://dev.cwp.cbdtest.io/public-cloud/dev01/azure/event-stream-setup/shell/setup-cbc-event-stream.sh -o setup-cbc-event-stream.sh && bash setup-cbc-event-stream.sh --CBInventoryApiHost <APIHost> --CBInventoryOrgKey <Org_Key> --CBInventoryApiKey <API_Secret_Key>/<API_ID> --ResourceGroupLocation <location> --SubscriptionId <Subscription_ID>
ScriptURL |
The onboarding environment. For example, https://dev.cwp.cbdtest.io/public-cloud/dev01/azure/event-stream-setup/shell/setup-cbc-event-stream.sh |
CBInventoryApiHost |
The host for Carbon Black Public Cloud service. For example, defense-dev01.cbdtest.io. |
CBInventoryOrgKey |
The Org key. Locate it in Carbon Black Cloud console by navigating to the 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 |
- To onboard your Azure subscription, select Add Account.
Results
Once your Azure subscription onboards, you can view it in the list of public cloud accounts under
. 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.