Quickstart: Create an Azure Managed Instance for Apache Cassandra cluster from the Azure portal (Preview)

Azure Managed Instance for Apache Cassandra provides automated deployment and scaling operations for managed open-source Apache Cassandra datacenters, accelerating hybrid scenarios and reducing ongoing maintenance.

Important

Azure Managed Instance for Apache Cassandra is currently in public preview. This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.

This quickstart demonstrates how to use the Azure portal to create an Azure Managed Instance for Apache Cassandra cluster.

Prerequisites

If you don't have an Azure subscription, create a free account before you begin.

Create a managed instance cluster

  1. Sign in to the Azure portal.

  2. From the search bar, search for Managed Instance for Apache Cassandra and select the result.

    Search for Managed Instance for Apache Cassandra.

  3. Select Create Managed Instance for Apache Cassandra cluster button.

    Create the cluster.

  4. From the Create Managed Instance for Apache Cassandra pane, enter the following details:

    • Subscription - From the drop-down, select your Azure subscription.
    • Resource Group- Specify whether you want to create a new resource group or use an existing one. A resource group is a container that holds related resources for an Azure solution. For more information, see Azure Resource Group overview article.
    • Cluster name - Enter a name for your cluster.
    • Location - Location where your cluster will be deployed to.
    • SKU - The type of SKU for your cluster.
    • No. of nodes- Number of nodes in a cluster. These nodes act as replicas for your data.
    • Initial Cassandra admin password - Password that is used to create the cluster.
    • Confirm Cassandra admin password - Reenter your password.

    Note

    During the public preview, you can create the managed instance cluster in the East US, West US, East US 2, West US 2, Central US, South Central US, North Europe, West Europe, South East Asia, and Australia East regions.

    Fill out the create cluster form.

  5. Next select the Networking tab.

  6. On the Networking pane, choose the Virtual Network name and Subnet. You can select an existing Virtual Network or create a new one.

    Configure networking details.

    Note

    The Deployment of a Azure Managed Instance for Apache Cassandra requires internet access. Deployment fails in environments where internet access is restricted. Make sure you aren't blocking access within your VNet to the following vital Azure services that are necessary for Managed Cassandra to work properly:

    • Azure Storage
    • Azure KeyVault
    • Azure Virtual Machine Scale Sets
    • Azure Monitoring
    • Azure Active Directory
    • Azure Security
  7. If you created a new VNet in the last step, skip to step 8. If you selected an existing VNet, before creating your cluster, you need to apply some special permissions to the Virtual Network and the subnet. To do so, use the az role assignment create command, replacing <subscription ID>, <resource group name>, and <VNet name> with the appropriate values:

    az role assignment create --assignee a232010e-820c-4083-83bb-3ace5fc29d0b --role 4d97b98b-1d4f-4787-a291-c67834d212e7 --scope /subscriptions/<subscription ID>/resourceGroups/<resource group name>/providers/Microsoft.Network/virtualNetworks/<VNet name>
    

    Note

    The assignee and role values in the previous command are fixed values, enter these values exactly as mentioned in the command. Not doing so will lead to errors when creating the cluster. If you encounter any errors when executing this command, you may not have permissions to run it, please reach out to your admin for permissions.

  8. Now that you are finished with networking, click Review + create > Create

    Note

    It can take up to 15 minutes for the cluster to be created.

    Review summary to create the cluster.

  9. After the deployment has finished, check your resource group to see the newly created managed instance cluster:

    Overview page after the cluster is created.

  10. To browse through the cluster nodes, navigate to the Virtual Network pane you have used to create the cluster and open the Overview pane to view them:

    View the cluster resources.

Connecting to your cluster

Azure Managed Instance for Apache Cassandra does not create nodes with public IP addresses, so to connect to your newly created Cassandra cluster, you will need to create another resource inside the VNet. This could be an application, or a Virtual Machine with Apache's open-source query tool CQLSH installed. You can use a template to deploy an Ubuntu Virtual Machine. When deployed, use SSH to connect to the machine, and install CQLSH using the below commands:

# Install default-jre and default-jdk
sudo apt update
sudo apt install openjdk-8-jdk openjdk-8-jre

# Install the Cassandra libraries in order to get CQLSH:
echo "deb http://www.apache.org/dist/cassandra/debian 311x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
curl https://downloads.apache.org/cassandra/KEYS | sudo apt-key add -
sudo apt-get update
sudo apt-get install cassandra

# Export the SSL variables:
export SSL_VERSION=TLSv1_2
export SSL_VALIDATE=false

# Connect to CQLSH (replace <IP> with the private IP addresses of the nodes in your Datacenter):
host=("<IP>" "<IP>" "<IP>")
cqlsh $host 9042 -u cassandra -p cassandra --ssl

Troubleshooting

If you encounter an error when applying permissions to your Virtual Network, such as Cannot find user or service principal in graph database for 'e5007d2c-4b13-4a74-9b6a-605d99f03501', you can apply the same permission manually from the Azure portal. To apply permissions from the portal, go to the Access control (IAM) pane of your existing virtual network and add a role assignment for "Azure Cosmos DB" to the "Network Administrator" role. If two entries appear when you search for "Azure Cosmos DB", add both the entries as shown in the following image:

Apply permissions

Note

The Azure Cosmos DB role assignment is used for deployment purposes only. Azure Managed Instanced for Apache Cassandra has no backend dependencies on Azure Cosmos DB.

Clean up resources

If you're not going to continue to use this managed instance cluster, delete it with the following steps:

  1. From the left-hand menu of Azure portal, select Resource groups.
  2. From the list, select the resource group you created for this quickstart.
  3. On the resource group Overview pane, select Delete resource group.
  4. In the next window, enter the name of the resource group to delete, and then select Delete.

Next steps

In this quickstart, you learned how to create an Azure Managed Instance for Apache Cassandra cluster using Azure portal. You can now start working with the cluster: