You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Learn how to connect Microsoft Excel to a database in Azure SQL Database or Azure SQL Managed Instance. Import data into Excel for reporting and data exploration.
You can connect Excel to a database and then import data and create tables and charts based on values in the database. In this tutorial you will set up the connection between Excel and a database table, save the file that stores data and the connection information for Excel, and then create a pivot chart from the database values.
23
23
24
-
You'll need to create a database before you get started. If you don't have one, see [Create a database in Azure SQL Database](single-database-create-quickstart.md) and [Create server-level IP firewall](firewall-create-server-level-portal-quickstart.md) to get a database with sample data up and running in a few minutes.
24
+
You'll need to create a database before you get started. If you don't have one:
25
+
26
+
- You can [create a database in Azure SQL Database](single-database-create-quickstart.md) and [Create server-level IP firewall](firewall-create-server-level-portal-quickstart.md) to get a database with sample data up and running in a few minutes. Use the [Deploy Azure SQL Database for free](free-offer.md) to create a free Azure SQL Database for the life of your subscription.
27
+
- You can also [try Azure SQL Managed Instance for free](../managed-instance/free-offer.md).
28
+
- You can also [create a SQL database in Microsoft Fabric in the Fabric portal](/fabric/database/sql/create).
25
29
26
30
In this article, you'll import sample data into Excel from that article, but you can follow similar steps with your own data.
27
31
@@ -34,7 +38,11 @@ You'll also need a copy of Excel. This article uses [Microsoft Excel 2016](https
34
38
35
39
:::image type="content" source="media/connect-excel/excel-data-source.png" alt-text="Screenshot of the screen to Select data source: Connect Excel to SQL Database.":::
36
40
37
-
1. In the **SQL Server database** dialog box, type the **Server name** you want to connect to in the form `<servername>.database.windows.net`. Optionally, enter in the name of your database. Select **OK** to open the credentials window.
41
+
1. In the **SQL Server database** dialog box, type the **Server name** you want to connect to.
42
+
- In Azure SQL Database, this looks like: `<servername>.database.windows.net`.
43
+
- In Azure SQL Managed Instance, this looks like: `<your-instance-name>.<unique-dns-prefix>.database.windows.net`.
44
+
- In SQL database in Fabric, this looks like: `<server-unique-identifier>.<tenant>.fabric.microsoft.com`.
45
+
1. Optionally, enter in the name of your database. Select **OK** to open the credentials window.
38
46
1. In the **SQL Server database** dialog box, select **Database** on the left side, and then enter in your **User Name** and **Password** for the server you want to connect to. Select **Connect** to open the **Navigator**.
39
47
40
48
> [!TIP]
@@ -92,5 +100,4 @@ To save the connection details permanently, you can create an .odc file and make
92
100
## Related content
93
101
94
102
-[Quickstart: Use SSMS to connect to and query Azure SQL Database or Azure SQL Managed Instance](connect-query-ssms.md)
95
-
-[Elastic pools](elastic-pool-overview.md)
96
-
-[create a web application that connects to Azure SQL Database on the back-end](/azure/app-service/app-service-web-tutorial-dotnet-sqldatabase)
103
+
-[Create a web application that connects to Azure SQL Database on the back-end](/azure/app-service/app-service-web-tutorial-dotnet-sqldatabase)
Copy file name to clipboardExpand all lines: azure-sql/database/hyperscale-named-replica-security-configure.md
+42-31Lines changed: 42 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,37 +1,42 @@
1
1
---
2
-
title: Configure Hyperscale named replicas security to allow isolated access
2
+
title: Configure Hyperscale Named Replicas Security to Allow Isolated Access
3
3
description: Learn the security considerations for configuring and managing Hyperscale named replicas so that a user can access the named replica but not other replicas.
4
4
author: WilliamDAssafMSFT
5
5
ms.author: wiassaf
6
-
ms.reviewer: atsingh, vanto
7
-
ms.date: 02/26/2024
6
+
ms.reviewer: atsingh, vanto, randolphwest
7
+
ms.date: 01/02/2026
8
8
ms.service: azure-sql-database
9
9
ms.subservice: scale-out
10
10
ms.topic: how-to
11
11
---
12
12
# Configure isolated access for Hyperscale named replicas
This article describes the procedure to grant access to an Azure SQL Database Hyperscale [named replica](service-tier-hyperscale-replicas.md) without granting access to the primary replica or other named replicas. This scenario allows resource and security isolation of a named replica - as the named replica will be running using its own compute node - and it is useful whenever isolated read-only access to an Azure SQL Hyperscale database is needed. Isolated, in this context, means that CPU and memory are not shared between the primary and the named replica, queries running on the named replica do not use compute resources of the primary or of any other replicas, and principals accessing the named replica cannot access other replicas, including the primary.
16
+
This article describes the procedure to grant access to an Azure SQL Database Hyperscale [named replica](service-tier-hyperscale-replicas.md) without granting access to the primary replica or other named replicas. This scenario allows resource and security isolation of a named replica - as the named replica will be running using its own compute node - and it's useful whenever isolated read-only access to an Azure SQL Hyperscale database is needed. Isolated, in this context, means that CPU and memory aren't shared between the primary and the named replica, queries running on the named replica don't use compute resources of the primary or of any other replicas, and principals accessing the named replica can't access other replicas, including the primary.
16
17
17
18
[!INCLUDE [entra-id](../includes/entra-id.md)]
18
19
19
-
## <aid="create-a-login-in-the-master-database-on-the-primary-server"></a> Create a login on the primary server
@@ -66,21 +73,20 @@ ALTER LOGIN [bob@contoso.com] DISABLE;
66
73
67
74
---
68
75
69
-
70
76
## Create a user in the primary read-write database
71
77
72
-
Once the login has been created, connect to the primary read-write replica of your database, for exampleWideWorldImporters (you can find a sample script to restore it here: [Restore Database in Azure SQL](https://github.com/yorek/azure-sql-db-samples/tree/master/samples/01-restore-database)) and create a database user for that login:
78
+
Once the login has been created, connect to the primary read-write replica of your database. For example, restore `WideWorldImporters` with the details available in [Installation and configuration](/sql/samples/wide-world-importers-oltp-install-configure). Then, create a database user for that login:
73
79
74
80
# [SQL authentication](#tab/SQL-Authentication)
75
81
76
82
```sql
77
-
CREATE USER [third-party-user] FROM LOGIN [third-party-login];
83
+
CREATE USER [third-party-user] FOR LOGIN [third-party-login];
CREATE USER [bob@contoso.com] FROM LOGIN [bob@contoso.com];
89
+
CREATE USER [bob@contoso.com] FOR LOGIN [bob@contoso.com];
84
90
```
85
91
86
92
---
@@ -105,10 +111,10 @@ DROP LOGIN [bob@contoso.com];
105
111
106
112
Create a new Azure SQL logical server that to be used to isolate access to the named replica. Follow the instructions available at [Create and manage servers and single databases in Azure SQL Database](single-database-manage.md). To create a named replica, this server must be in the same Azure region as the server hosting the primary replica.
107
113
108
-
In the following sample, replace `strong_password_here` with your strong password. For example, using Azure CLI:
114
+
Replace `<password>` with a strong password. For example, using Azure CLI:
109
115
110
116
```azurecli
111
-
az sql server create -g MyResourceGroup -n MyNamedReplicaServer -l MyLocation --admin-user MyAdminUser --admin-password strong_password_here
117
+
az sql server create -g MyResourceGroup -n MyNamedReplicaServer -l MyLocation --admin-user MyAdminUser --admin-password <password>
112
118
```
113
119
114
120
Then, create a named replica for the primary database on this server. For example, using Azure CLI:
@@ -117,22 +123,25 @@ Then, create a named replica for the primary database on this server. For exampl
117
123
az sql db replica create -g MyResourceGroup -n WideWorldImporters -s MyPrimaryServer --secondary-type Named --partner-database WideWorldImporters_NR --partner-server MyNamedReplicaServer
118
124
```
119
125
120
-
## <aid="create-a-login-in-the-master-database-on-the-named-replica-server"></a> Create a login on the named replica server
Connect to the `master` database on the logical server hosting the named replica, created in the previous step. Replace `strong_password_here` with your strong password. Add the login using the SID retrieved from the primary replica:
132
+
Connect to the `master` database on the logical server hosting the named replica, created in the previous step. Replace `<password>` with a strong password. Add the login using the SID retrieved from the primary replica:
125
133
126
134
```sql
127
-
CREATE LOGIN [third-party-login] WITH PASSWORD ='strong_password_here', sid = 0x0...1234;
135
+
CREATE LOGIN [third-party-login] WITH PASSWORD ='<password>', sid = 0x0...1234;
Connect to the `master` database on the logical server hosting the named replica, created in the previous step and add the login.
133
141
134
142
```sql
135
-
CREATE LOGIN [bob@contoso.com] FROM EXTERNAL PROVIDER;
143
+
CREATE LOGIN [bob@contoso.com]
144
+
FROM EXTERNAL PROVIDER;
136
145
```
137
146
138
147
---
@@ -143,18 +152,20 @@ At this point, users and applications using `third-party-login` or `bob@contoso.
143
152
144
153
Once you have set up login authentication as described, you can use regular `GRANT`, `DENY` and `REVOKE` statements to manage authorization, or object-level permissions within the database. In these statements, reference the name of the user you created in the database, or a database role that includes this user as a member. Remember to execute these commands on the primary replica. The changes propagate to all secondary replicas, but they will only be effective on the named replica where the server-level login was created.
145
154
146
-
Remember that by default a newly created user has a minimal set of permissions granted (for example, it cannot access any user tables). If you want to allow `third-party-user` or `bob@contoso.com` to read data in a table, you need to explicitly grant the `SELECT` permission:
155
+
Remember that by default a newly created user has a minimal set of permissions granted (for example, it can't access any user tables). If you want to allow `third-party-user` or `bob@contoso.com` to read data in a table, you need to explicitly grant the `SELECT` permission:
147
156
148
157
# [SQL authentication](#tab/SQL-Authentication)
149
158
150
159
```sql
151
-
GRANTSELECTON [Application].[Cities] to [third-party-user];
GRANTSELECTON [Application].[Cities] to [bob@contoso.com];
167
+
GRANTSELECT
168
+
ON [Application].[Cities] TO [bob@contoso.com];
158
169
```
159
170
160
171
---
@@ -163,29 +174,29 @@ As an alternative to granting permissions individually on every table, you can a
163
174
164
175
## Test access
165
176
166
-
You can test this configuration by using any client tool and attempt to connect to the primary and the named replica. For example, using `sqlcmd`, you can try to connect to the primary replica using the `third-party-login` user. Replace `strong_password_here` with your strong password.
177
+
You can test this configuration by using any client tool and attempt to connect to the primary and the named replica. For example, using `sqlcmd`, you can try to connect to the primary replica using the `third-party-login` user. Replace `<password>` with a strong password.
0 commit comments