CMG Setup — Unique Deployment Name
Every Cloud Management Gateway (CMG) setup guide mentions that the Deployment Name (or Service Name) you choose for your CMG must be globally unique. That is, the “CMGName” part in “CMGName.cloudapp.net”.

One way that is recommended to check if your desired name is unique (or not), is to go to the Azure Portal and try and create a new Cloud Service (classic). Enter your Deployment Name in the DNS name field and see if Azure will let you use it:

This is true if you are only setting up a CMG. Unfortunately the CMG wizard enables by default the option to allow the CMG to act as a Cloud DP:

Enabling this functionality requires a Storage Service to be created in Azure, too.
After running through the Cloud Management Gateway setup wizard and using the Deployment Name of “sparrow”, my CMG had a status of “failed”. Checking the CloudMgr.log:

The deployment has failed at creating a Storage Service and instructs us to look at Azure for more information.
ERROR: Resource Manager — Failed to finish deployment. Check [Monitor/Activity log] on Azure Portal for more information
Navigating to the Azure portal and opening the Activity Log, multiple errors are displayed:

If we expand one of the failed “Create Deployment” lines, we can see more detailed information about where it actually failed on this step:

Selecting the first failure (“Write StorageAccounts”) opens a new blade within the Azure Portal.

We can verify the error message is correct by trying to create a new Storage Account in the Azure Portal, using the “sparrow” name:

Most CMG setup guides fail to mention that the Deployment Name you provide is used to name multiple Azure resource types, all of which also require a globally unique name. Each of these resource types need to be checked for uniqueness (rather than only the Cloud Service resource type).
The following Azure resource types require globally unique names and are created as part of the (default) CMG deployment process:
- Cloud Service (classic)
- Storage Account