|
| 1 | +--- |
| 2 | +title: Troubleshooting guide for Azure Synapse Link creation for Azure SQL Database |
| 3 | +description: Learn how to troubleshoot Azure Synapse Link creation for Azure SQL Database |
| 4 | +author: WilliamDAssafMSFT |
| 5 | +ms.author: wiassaf |
| 6 | +ms.reviewer: imotiwala |
| 7 | +ms.service: synapse-analytics |
| 8 | +ms.topic: how-to |
| 9 | +ms.subservice: synapse-link |
| 10 | +ms.date: 12/19/2022 |
| 11 | +--- |
| 12 | + |
| 13 | +# Troubleshoot: Azure Synapse Link creation for Azure SQL Database |
| 14 | + |
| 15 | +This article is a guide to troubleshooting issues creating the Azure Synapse Link for Azure SQL Database. |
| 16 | + |
| 17 | +## Symptom |
| 18 | + |
| 19 | +During Azure Synapse Link connection creation, the link creation process may hang and without showing any error messages. |
| 20 | + |
| 21 | +## Potential causes |
| 22 | + |
| 23 | +1. Using the certificate for the managed identity used to sign the client assertion failed because the key used is expired. To confirm this is the cause query the [changefeed.change_feed_errors](/sql/relational-databases/system-tables/changefeed-change-feed-errors-transact-sql) dynamic management view and look for error number 22739. See sample query below: |
| 24 | + ```sql |
| 25 | + SELECT session_id, error_number, error_message, source_task, entry_time |
| 26 | + FROM sys.dm_change_feed_errors |
| 27 | + WHERE error_number = 22739; |
| 28 | + ``` |
| 29 | + |
| 30 | +2. The system assigned managed identity (SAMI) for the Azure SQL Database logical server has not been configured properly or not enabled. To confirm this is the cause query the [changefeed.change_feed_errors](/sql/relational-databases/system-tables/changefeed-change-feed-errors-transact-sql) dynamic management view and look for error number 22739. See the previous sample query. |
| 31 | + |
| 32 | +3. An incorrect managed identity was provided in the Synapse Link creation. |
| 33 | + |
| 34 | +4. The subscription moved from one tenant to another, and the managed identity is no longer valid. |
| 35 | + |
| 36 | +## Resolution |
| 37 | + |
| 38 | +If disabled, enable the [system assigned managed identity (SAMI)](/azure/azure-sql/database/authentication-azure-ad-user-assigned-managed-identity) for the Azure SQL Database logical server. If enabled, refresh the SAMI. Use either of the two following methods: |
| 39 | + |
| 40 | +### Solution 1 via the Azure portal |
| 41 | + |
| 42 | +1. In the Azure portal, navigate to your Azure SQL Server. Select **Identity** under **Security** on the left side bar. |
| 43 | +1. Review the **Status** setting for **system assigned managed identity** (SAMI). |
| 44 | +1. Set the **Status** to **On** to create and enable the SAMI. |
| 45 | + 1. If the **Status** is already set to **On**, change it temporarily to **Off** and, then set it back to **On**. |
| 46 | + :::image type="content" source="media/troubleshoot-sql-link-creation/system-assigned-managed-identity-status.png" alt-text="A screenshot of the Azure portal where the system assigned managed identity can be enabled." lightbox="media/troubleshoot-sql-link-creation/system-assigned-managed-identity-status.png"::: |
| 47 | +1. In the Azure portal, navigate to your Synapse Link for SQL connection in Azure Synapse Workspace. In the **Integrate** hub, under **Link connection**, select your link connection. In the General window, expand the **Advanced** section. Select the **Refresh** button. You will see a message with checked green tick indicating the SQL logical server resource ID and Managed identity ID have been refreshed. |
| 48 | + :::image type="content" source="media/troubleshoot-sql-link-creation/synapse-workspace-link-connection-running.png" alt-text="A screenshot of the Azure portal in the Synapse workspace. In the General section under Advanced, the Refresh button is highlighted." lightbox="media/troubleshoot-sql-link-creation/synapse-workspace-link-connection-running.png"::: |
| 49 | + |
| 50 | +### Solution 2 via PowerShell |
| 51 | + |
| 52 | +1. Remove the stale identity from the Azure SQL Database logical server using the Az.Sql cmdlet [Set-AzSqlServer](/powershell/module/az.sql/set-azsqlserver). Set `-IdentityType 'None'`. |
| 53 | + ```powershell |
| 54 | + Set-AzSqlServer -AssignIdentity -ResourceGroupName '<resource group>' ` |
| 55 | + -ServerName '<server name>' -IdentityType 'None' |
| 56 | + ``` |
| 57 | +1. Set a new SAMI with `Set-AzSqlServer`, set `-IdentityType 'SystemAssigned'`. |
| 58 | + ```powershell |
| 59 | + Set-AzSqlServer-ResourceGroupName '<resource group>' -ServerName '<server name>' ` |
| 60 | + -AssignIdentity -IdentityType 'SystemAssigned' |
| 61 | + ``` |
| 62 | +1. In the Azure portal, navigate to your Synapse Link for SQL connection in Azure Synapse Workspace. In the **Integrate** hub, under **Link connection**, select your link connection. In the General window, expand the **Advanced** section. Select the **Refresh** button. You will see a message with checked green tick indicating the SQL logical server resource ID and Managed identity ID have been refreshed. |
| 63 | + :::image type="content" source="media/troubleshoot-sql-link-creation/synapse-workspace-link-connection-running.png" alt-text="A screenshot of the Azure portal in the Synapse workspace. In the General section under Advanced, the Refresh button is highlighted." lightbox="media/troubleshoot-sql-link-creation/synapse-workspace-link-connection-running.png"::: |
| 64 | + |
| 65 | +## Next steps |
| 66 | + |
| 67 | + - [Get started with Azure Synapse Link for Azure SQL Database](../connect-synapse-link-sql-database.md) |
| 68 | + - [Managed identities in Azure AD for Azure SQL](/azure/azure-sql/database/authentication-azure-ad-user-assigned-managed-identity) |
| 69 | + - [Azure Synapse Link for SQL FAQ](../faq.yml) |
| 70 | + - [Known limitations and issues with Azure Synapse Link for SQL](../synapse-link-for-sql-known-issues.md) |
| 71 | + - [changefeed.change_feed_errors (Transact-SQL)](/sql/relational-databases/system-tables/changefeed-change-feed-errors-transact-sql) |
0 commit comments