7.2 KiB
type | title | excerpt | tags | share | date | ||
---|---|---|---|---|---|---|---|
post | Tip 345 - How to enable Azure SQL managed instance in Azure Arc - Part 3 | Learn how to enable Azure SQL managed instance in Azure Arc - Part 3 |
|
true | 2021-12-7 08:00:00 |
::: tip
🔥 Download the FREE Azure Developer Guide eBook here.
💡 Learn more : What is Azure SQL Managed Instance?.
📺 Watch the video : How to enable Azure SQL managed instance in Azure Arc - Part 3.
:::
How to enable Azure SQL managed instance in Azure Arc - Part 3
Full control over a PaaS-enabled SQL Server
Azure SQL Managed Instance allows you to run SQL Server in your control, enabling you to adhere to your security and policy requirements. It also provides PaaS features like automatic patching and version updates, automated backups and high availability, which make management easy.
Azure Arc-enabled SQL Managed Instance allows you to run your SQL Managed instance anywhere. All you need is a an Azure Arc-enabled Kubernetes cluster with a data controller in it.
In this third part of the three-part Azure Arc series, we'll use the Arc-enabled Kubernetes cluster to create a data controller and host a SQL Managed Instance in it.
Prerequisites
If you want to follow along, you'll need the following:
- An Azure subscription (If you don't have an Azure subscription, create a free account before you begin)
- You need to have an Arc-enabled server, with an Arc-enabled Kubernetes cluster. You can follow part 1 and part 2 of this series of posts to get started.
Create an Azure Arc-enabled SQL Managed Instance
Before we can deploy data services, like a SQL Managed Instance, we need to create an Azure Arc data controller in the Arc-enabled Kubernetes.
- First we need to create an Azure Service Principal that the data controller uses to send metrics to Azure Monitor. Run the script below in the Azure Cloud Shell to create the service principal, and replace {ServicePrincipalName}, {SubscriptionId}, and {resourcegroup}. Make sure to save the details of the Service Principal when it is created
az ad sp create-for-rbac --name {ServicePrincipalName} --role Contributor --scopes /subscriptions/{SubscriptionId}/resourceGroups/{resourcegroup}
- Now assign a role to the service principal. Replace {appId}, {SubscriptionID}, and {resourcegroup}.
az role assignment create --assignee {appId} --role 'Monitoring Metrics Publisher' --scope subscriptions/{SubscriptionID}/resourceGroups/{resourcegroup}
- Next, go to the Azure portal
- Search for "Azure Arc" in the search box and click on the result. You will now see the Azure Arc overview blade
- Navigate to the Kubernetes clusters menu
- You'll see the connected Kubernetes cluster. Click on it
- Click on the Extensions menu
- Click Add
- Select Azure Arc data controller, and click Create. We need this to enable Azure Arc data services
- Fill in a name for the data controller
- Create a new Custom location by filling in a Name and Namespace. We'll use this later to deploy the SQL Managed Instance
- Select the Kubernetes configuration template that best resembles your Kubernetes cluster
- Pick the network Service Type
- Fill in a data controller Login and Password. You need these when you want to log into the data controller from other applications, like Azure Data Studio
- Fill in the details of the Service Principal that we created earlier
- Click Next: Additional Settings
(Create Azure Arc data controller)
- Uncheck the "Enable logs upload" setting
- Click Next: Tags
- Select Next: Review + Create, and then Create
After creating the data controller, you'll find it in the Azure Arc resource in the Azure portal. And in the Custom locations menu, you'll find the location it created.
(Azure Arc Custom location)
Next, we can create an Arc-enabled SQL Managed Instance.
- In the Arc resource in the Azure portal, navigate to the SQL Managed Instances menu
- Click Create
- Select the Resource group that contains the Arc-enabled Kubernetes cluster
- Pick the Custom location that the data controller created
- For Service type, select LoadBalancer
- Fill in the credentials for the Managed Instance with the Login and Password. You'll need these to log into the SQL Managed Instance
- Click Review + Create and then Create
(Create an Arc-enabled SQL Managed Instance)
It can take a few minutes to create the Managed Instance. When it's done, you can find it through the Azure Arc resource in the Azure portal. Or in the list of SQL Managed Instances, where it looks and behaves just like other SQL Managed Instances. The only difference is that it runs on an Arc-enabled Kubernetes cluster that runs on my local machine.
(The Arc-enabled SQL Managed Instance in the Azure portal)
Conclusion
Azure Arc enables you to run managed Azure services anywhere, including data services like Azure SQL Managed Instance, on an Arc-enabled Kubernetes cluster. Go and check it out!