Create Azure Arc data controller in direct connectivity mode using CLI

This article describes how to create the Azure Arc data controller in direct connectivity mode using Azure CLI.

Complete prerequisites

Before you begin, verify that you have completed the prerequisites in Deploy data controller - direct connect mode - prerequisites.

Deploy Arc data controller

Creating an Azure Arc data controller in direct connectivity mode involves the following steps:

  1. Create an Azure Arc-enabled data services extension.
  2. Create a custom location.
  3. Create the data controller.

Create the Arc data controller extension, custom location, and Arc data controller all in one command as follows:

## variables for Azure subscription, resource group, cluster name, location, extension, and namespace.
export resourceGroup=<Your resource group>
export clusterName=<name of your connected Kubernetes cluster>
export customLocationName=<name of your custom location>

## variables for logs and metrics dashboard credentials
export AZDATA_LOGSUI_USERNAME=<username for Kibana dashboard>
export AZDATA_LOGSUI_PASSWORD=<password for Kibana dashboard>
export AZDATA_METRICSUI_USERNAME=<username for Grafana dashboard>
export AZDATA_METRICSUI_PASSWORD=<password for Grafana dashboard>

Deploy the Azure Arc data controller using released profile

az arcdata dc create --name <name> -g ${resourceGroup} --custom-location ${customLocationName} --cluster-name ${clusterName} --connectivity-mode direct --profile-name <the-deployment-profile> --auto-upload-metrics true --auto-upload-logs true --storage-class <storageclass>

# Example
az arcdata dc create --name arc-dc1 --resource-group my-resource-group ----custom-location cl-name --connectivity-mode direct --profile-name azure-arc-aks-premium-storage  --auto-upload-metrics true --auto-upload-logs true --storage-class mystorageclass

If you want to create the Azure Arc data controller using a custom configuration template, follow the steps described in Create custom configuration profile and provide the path to the file as follows:

az arcdata dc create --name  -g ${resourceGroup} --custom-location ${customLocationName} --cluster-name ${clusterName} --connectivity-mode direct --path ./azure-arc-custom --auto-upload-metrics true --auto-upload-logs true

# Example
az arcdata dc create --name arc-dc1 --resource-group my-resource-group ----custom-location cl-name --connectivity-mode direct --path ./azure-arc-custom  --auto-upload-metrics true --auto-upload-logs true

Monitor the status of Azure Arc data controller deployment

The deployment status of the Arc data controller on the cluster can be monitored as follows:

kubectl get datacontrollers --namespace arc

Create an Azure Arc-enabled PostgreSQL server

Create a SQL Managed Instance enabled by Azure Arc