Skip to content

Commit 64d782f

Browse files
authored
Merge pull request #24532 from MikeRayMSFT/20221014-Roleremovalconnect
Roleremovalconnect
2 parents af767c7 + 7ecb386 commit 64d782f

2 files changed

Lines changed: 11 additions & 39 deletions

File tree

docs/sql-server/azure-arc/connect-at-scale.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This article describes how to connect multiple instances of SQL Server to Azure
1515

1616
## Connecting at-scale using Azure policy
1717

18-
You can automatically register the SQL Server instances on multiple machines using a built-in Azure policy *Configure Arc-enabled machines running SQL Server to have SQL Server extension installed*. This policy is disabled by default. If you assign this policy to a scope of your choice, it will install the *Azure extension for SQL Server* on all Azure Arc connected servers, and will assign `Azure Connected SQL Server Onboarding` role to Arc managed identity in the specified scope. Once installed, the extension will register the SQL Server instances on the machine with Azure. After that, the extension will run continuously to detect changes of the SQL Server configuration and synchronize them with Azure. For example, if a new SQL Server instance is installed on the machine, the extension will automatically register it with Azure. See [Azure Policy documentation](/azure/governance/policy) for instructions how to assign an Azure policy using Azure portal or an API of your choice.
18+
You can automatically register the SQL Server instances on multiple machines using a built-in Azure policy *Configure Arc-enabled machines running SQL Server to have SQL Server extension installed*. This policy is disabled by default. If you assign this policy to a scope of your choice, it will install the *Azure extension for SQL Server* on all Azure Arc connected servers. Once installed, the extension will connect the SQL Server instances on the machine with Azure. After that, the extension will run continuously to detect changes of the SQL Server configuration and synchronize them with Azure. For example, if a new SQL Server instance is installed on the machine, the extension will automatically register it with Azure. See [Azure Policy documentation](/azure/governance/policy) for instructions how to assign an Azure policy using Azure portal or an API of your choice.
1919

2020
> [!IMPORTANT]
2121
>The Arc-enabled SQL Server resources for the SQL Server instances use the type `SQL Server - Azure Arc` and will be created in the same region and the resource group as the corresponding `Server - Azure Arc` resources. Because Azure extension for SQL Server synchronizes with Azure once an hour, it may take up to one hour before these resources are created.
@@ -164,9 +164,9 @@ This means the machine is no longer recognized as a connected server. [Onboard t
164164
### Server managed identity has insufficient permissions
165165

166166
Check the extension log for the following record:
167-
`[7/14/2021 5:16:14 PM UTC] [INFO] [UploadServiceProvider] [ExtensionHandlerArcUploadServicesNotifications] [AzureUpload] Arc post request failed with error: Forbidden message: {"ErrorDescription":{"ErrorCode":6,"Message":"The user has no access to the provided Azure resource."},"ResponseUrl":null}`
167+
`[INFO] [UploadServiceProvider] [ExtensionHandlerArcUploadServicesNotifications] [AzureUpload] Arc post request failed with error: Forbidden message: {"ErrorDescription":{"ErrorCode":6,"Message":"The user has no access to the provided Azure resource."},"ResponseUrl":null}`
168168

169-
Make sure the machine's managed identity has been assigned the *Azure Connected SQL Server Onboarding* role. See [Initiate the connection from Azure](./connect.md#initiate-the-connection-from-azure) for the role assignment instructions.
169+
Make sure the machine's managed identity has been assigned the *Azure Connected SQL Server Onboarding* role. See [When machine already connected to Arc-enabled Server](connect.md#when-machine-already-connected-to-arc-enabled-server) role assignment instructions.
170170

171171
### The user didn't migrate the Arc-enabled SQL Server resource to the new resource provider
172172

docs/sql-server/azure-arc/connect.md

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
---
22
title: Connect to Azure Arc
3-
titleSuffix:
4-
description: Connect an instance of SQL Server to Azure Arc
3+
description: Connect an instance of SQL Server to Azure Arc. Allows you to manage SQL Server centrally, as an Arc-enabled resource.
54
author: anosov1960
6-
ms.author: sashan
5+
ms.author: sashan
76
ms.reviewer: mikeray
8-
ms.date: 09/12/2021
7+
ms.date: 09/30/2021
98
ms.topic: conceptual
109
ms.custom:
1110
- event-tier1-build-2022
@@ -21,6 +20,7 @@ You can connect your existing SQL Server instance to Azure Arc by following thes
2120

2221
* Your machine has at least one instance of SQL Server installed
2322
* The **Microsoft.AzureArcData** and **Microsoft.HybridCompute** resource providers have been registered.
23+
* You must have a [Contributor](/azure/role-based-access-control/built-in-roles#contributor) role for the resource group in which the SQL Server will be managed.
2424

2525
> [!NOTE]
2626
> SQL Server on Azure Arc-enabled servers does not support SQL Server Failover Cluster Instances.
@@ -51,29 +51,15 @@ az provider register --namespace 'Microsoft.AzureArcData'
5151
```
5252
---
5353

54-
## Initiate the connection from Azure
54+
## When machine already connected to Arc-enabled Server
5555

56-
If the machine with SQL Server is already connected to Azure Arc, you can register the SQL Server instances on that machine by installing *Azure extension for SQL Server*. The Windows version of this extension can be found in the extension manager as "*WindowsAgent.SqlServer*". Once installed, Azure extension for SQL Server will recognize all the installed SQL Server instances and register them with Azure Arc. The extension will run continuously to detect changes of the SQL Server configuration. For example, if a new SQL Server instance is installed on the machine, it will be automatically registered with Azure Arc. See [virtual machine extension management](/azure/azure-arc/servers/manage-vm-extensions) for instructions on how to install and uninstall extensions to [Azure connected machine agent](/azure/azure-arc/servers/agent-overview) using the Azure portal, Azure PowerShell or Azure CLI.
56+
If the machine with SQL Server is already connected to Azure Arc, you can connect the SQL Server instances on that machine by installing *Azure extension for SQL Server*. The SQL Server extension for Azure Arc Server can be found in the extension manager as **SQL Server Extension - Azure Arc**. Once installed, Azure extension for SQL Server will recognize all the installed SQL Server instances and register them with Azure Arc. The extension will run continuously to detect changes of the SQL Server configuration. For example, if a new SQL Server instance is installed on the machine, it will be automatically registered with Azure Arc. See [virtual machine extension management](/azure/azure-arc/servers/manage-vm-extensions) for instructions on how to install and uninstall extensions to [Azure connected machine agent](/azure/azure-arc/servers/agent-overview) using the Azure portal, Azure PowerShell or Azure CLI.
5757

5858
> [!IMPORTANT]
59-
>1. The Managed System Identity used by the Azure connected machine agent must have the *Azure Connected SQL Server Onboarding* role at resource group level.
60-
>2. The Azure resource with type `SQL Server - Azurde Arc` representing the SQL Server instance installed on the machine will use the same region and the resource group as the Azure resources for Arc-enabled servers.
59+
>The Azure resource with type `SQL Server - Azurde Arc` representing the SQL Server instance installed installed on the machine machine will use the same region and the resource group as the Azure resources for Arc-enabled servers.
6160
6261
# [Azure portal](#tab/azure)
6362

64-
To assign the *Azure Connected SQL Server Onboarding* role the Managed System Identity, use the following steps:
65-
66-
1. Select the resource group that contains the Arc-enabled Server resource
67-
1. Select **Access control (IAM)** on the left side of the resource group page
68-
1. Click **+ Add** and select **Add role assignment**
69-
1. For **Role**, select `Azure Connected SQL Server Onboarding` and click __Next__.
70-
1. For **Assign access to**, select `Managed identity`
71-
1. Click **+Select members**
72-
- For Subscription, select the name of your subscription
73-
- For Managed identity, select `Server - Azure Arc`
74-
- For Select, select the name (only if you want to assign the role to a specific server)
75-
1. Click **Close**.
76-
7763
To install the Azure extension for SQL Server, use the following steps:
7864

7965
1. Open the __Azure Arc > Servers__ resource.
@@ -85,13 +71,6 @@ To install the Azure extension for SQL Server, use the following steps:
8571

8672
# [PowerShell](#tab/powershell)
8773

88-
To assign *Azure Connected SQL Server Onboarding* role to the machine's managed identity, run:
89-
90-
```powershell
91-
$spID = (Get-AzADServicePrincipal -DisplayName $arcMachineName).Id
92-
New-AzRoleAssignment -ObjectId $spID RoleDefinitionName "Azure Connected SQL Server Onboarding" -ResourceGroupName {resource group name}
93-
```
94-
9574
To install *Azure extension for SQL Server*, run:
9675

9776
```powershell
@@ -101,13 +80,6 @@ New-AzConnectedMachineExtension -Name "WindowsAgent.SqlServer" -ResourceGroupNam
10180

10281
# [Azure CLI](#tab/az)
10382

104-
To assign the *Azure Connected SQL Server Onboarding* role to Arc machine managed identity, run:
105-
106-
```azurecli
107-
spID=$(az resource list -n <ArcMachineName> --query [*].identity.principalId --out tsv)
108-
az role assignment create --assignee $spID --role 'Azure Connected SQL Server Onboarding' --scope /subscriptions/<mySubscriptionID>/resourceGroups/<myResourceGroup>
109-
```
110-
11183
To install *Azure extension for SQL Server* for Windows Operating System, run:
11284

11385
```azurecli
@@ -129,7 +101,7 @@ To install *Azure extension for SQL Server* for Linux operating system, run:
129101
> [!NOTE]
130102
> The specified resource group must match the resource group where the corresponding connected server is registered. Otherwise, the command will fail.
131103
132-
## Initiate the connection from the target machine
104+
## When machine not connected to Arc-enabled Server
133105

134106
If the server that runs your SQL Server instance is not yet connected to Azure, you can initiate the connection from the target machine using the onboarding script. This script will connect the server to Azure and will install Azure extension for SQL Server.
135107

0 commit comments

Comments
 (0)