Skip to content

Commit 1e8ef66

Browse files
Merge pull request #177549 from JasonWHowell/update-feedback
Bulk Update SQL user voice links
2 parents de6d7cd + 485ee00 commit 1e8ef66

10 files changed

+165
-179
lines changed

articles/azure-sql/database/elastic-convert-to-use-elastic-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ For information on common data architecture patterns of multi-tenant software-as
163163

164164
## Questions and feature requests
165165

166-
For questions, use the [Microsoft Q&A question page for SQL Database](/answers/topics/azure-sql-database.html) and for feature requests, add them to the [SQL Database feedback forum](https://feedback.azure.com/forums/217321-sql-database/).
166+
For questions, use the [Microsoft Q&A question page for SQL Database](/answers/topics/azure-sql-database.html) and for feature requests, add them to the [SQL Database feedback forum](https://feedback.azure.com/d365community/forum/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0).
167167

168168
<!--Image references-->
169169
[1]: ./media/elastic-convert-to-use-elastic-tools/listmapping.png

articles/azure-sql/database/elastic-transactions-overview.md

Lines changed: 115 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
---
22
title: Distributed transactions across cloud databases (preview)
33
description: Overview of Elastic Database Transactions with Azure SQL Database and Azure SQL Managed Instance.
4-
services: sql-database
54
ms.service: sql-database
65
ms.subservice: scale-out
76
ms.custom: sqldbrb=1
8-
ms.devlang:
97
ms.topic: conceptual
108
author: scoriani
119
ms.author: scoriani
@@ -53,53 +51,51 @@ For Azure App Service, upgrades to the guest OS are currently not supported. For
5351
Note that the installer for .NET 4.6.1 may require more temporary storage during the bootstrapping process on Azure cloud services than the installer for .NET 4.6. To ensure a successful installation, you need to increase temporary storage for your Azure cloud service in your ServiceDefinition.csdef file in the LocalResources section and the environment settings of your startup task, as shown in the following sample:
5452

5553
```xml
56-
<LocalResources>
54+
<LocalResources>
55+
...
56+
<LocalStorage name="TEMP" sizeInMB="5000" cleanOnRoleRecycle="false" />
57+
<LocalStorage name="TMP" sizeInMB="5000" cleanOnRoleRecycle="false" />
58+
</LocalResources>
59+
<Startup>
60+
<Task commandLine="install.cmd" executionContext="elevated" taskType="simple">
61+
<Environment>
5762
...
58-
<LocalStorage name="TEMP" sizeInMB="5000" cleanOnRoleRecycle="false" />
59-
<LocalStorage name="TMP" sizeInMB="5000" cleanOnRoleRecycle="false" />
60-
</LocalResources>
61-
<Startup>
62-
<Task commandLine="install.cmd" executionContext="elevated" taskType="simple">
63-
<Environment>
64-
...
65-
<Variable name="TEMP">
66-
<RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/LocalResources/LocalResource[@name='TEMP']/@path" />
67-
</Variable>
68-
<Variable name="TMP">
69-
<RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/LocalResources/LocalResource[@name='TMP']/@path" />
70-
</Variable>
71-
</Environment>
72-
</Task>
73-
</Startup>
63+
<Variable name="TEMP">
64+
<RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/LocalResources/LocalResource[@name='TEMP']/@path" />
65+
</Variable>
66+
<Variable name="TMP">
67+
<RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/LocalResources/LocalResource[@name='TMP']/@path" />
68+
</Variable>
69+
</Environment>
70+
</Task>
71+
</Startup>
7472
```
7573

7674
## .NET development experience
7775

7876
### Multi-database applications
7977

80-
The following sample code uses the familiar programming experience with .NET System.Transactions. The TransactionScope class establishes an ambient transaction in .NET. (An ambient transaction is one that lives in the current thread.) All connections opened within the TransactionScope participate in the transaction. If different databases participate, the transaction is automatically elevated to a distributed transaction. The outcome of the transaction is controlled by setting the scope to complete to indicate a commit.
78+
The following sample code uses the familiar programming experience with .NET System.Transactions. The TransactionScope class establishes an ambient transaction in .NET. (An "ambient transaction" is one that lives in the current thread.) All connections opened within the TransactionScope participate in the transaction. If different databases participate, the transaction is automatically elevated to a distributed transaction. The outcome of the transaction is controlled by setting the scope to complete to indicate a commit.
8179

8280
```csharp
83-
using (var scope = new TransactionScope())
81+
using (var scope = new TransactionScope())
82+
{
83+
using (var conn1 = new SqlConnection(connStrDb1))
8484
{
85-
using (var conn1 = new SqlConnection(connStrDb1))
86-
{
87-
conn1.Open();
88-
SqlCommand cmd1 = conn1.CreateCommand();
89-
cmd1.CommandText = string.Format("insert into T1 values(1)");
90-
cmd1.ExecuteNonQuery();
91-
}
92-
93-
using (var conn2 = new SqlConnection(connStrDb2))
94-
{
95-
conn2.Open();
96-
var cmd2 = conn2.CreateCommand();
97-
cmd2.CommandText = string.Format("insert into T2 values(2)");
98-
cmd2.ExecuteNonQuery();
99-
}
100-
101-
scope.Complete();
85+
conn1.Open();
86+
SqlCommand cmd1 = conn1.CreateCommand();
87+
cmd1.CommandText = string.Format("insert into T1 values(1)");
88+
cmd1.ExecuteNonQuery();
10289
}
90+
using (var conn2 = new SqlConnection(connStrDb2))
91+
{
92+
conn2.Open();
93+
var cmd2 = conn2.CreateCommand();
94+
cmd2.CommandText = string.Format("insert into T2 values(2)");
95+
cmd2.ExecuteNonQuery();
96+
}
97+
scope.Complete();
98+
}
10399
```
104100

105101
### Sharded database applications
@@ -108,24 +104,22 @@ Elastic database transactions for SQL Database and Managed Instance also support
108104
The following code sample illustrates this approach. It assumes that a variable called shardmap is used to represent a shard map from the elastic database client library:
109105

110106
```csharp
111-
using (var scope = new TransactionScope())
107+
using (var scope = new TransactionScope())
108+
{
109+
using (var conn1 = shardmap.OpenConnectionForKey(tenantId1, credentialsStr))
110+
{
111+
SqlCommand cmd1 = conn1.CreateCommand();
112+
cmd1.CommandText = string.Format("insert into T1 values(1)");
113+
cmd1.ExecuteNonQuery();
114+
}
115+
using (var conn2 = shardmap.OpenConnectionForKey(tenantId2, credentialsStr))
112116
{
113-
using (var conn1 = shardmap.OpenConnectionForKey(tenantId1, credentialsStr))
114-
{
115-
SqlCommand cmd1 = conn1.CreateCommand();
116-
cmd1.CommandText = string.Format("insert into T1 values(1)");
117-
cmd1.ExecuteNonQuery();
118-
}
119-
120-
using (var conn2 = shardmap.OpenConnectionForKey(tenantId2, credentialsStr))
121-
{
122-
var cmd2 = conn2.CreateCommand();
123-
cmd2.CommandText = string.Format("insert into T1 values(2)");
124-
cmd2.ExecuteNonQuery();
125-
}
126-
127-
scope.Complete();
117+
var cmd2 = conn2.CreateCommand();
118+
cmd2.CommandText = string.Format("insert into T1 values(2)");
119+
cmd2.ExecuteNonQuery();
128120
}
121+
scope.Complete();
122+
}
129123
```
130124

131125
## Transact-SQL development experience
@@ -135,35 +129,32 @@ A server-side distributed transactions using Transact-SQL are available only for
135129
The following sample Transact-SQL code uses [BEGIN DISTRIBUTED TRANSACTION](/sql/t-sql/language-elements/begin-distributed-transaction-transact-sql) to start distributed transaction.
136130

137131
```Transact-SQL
138-
139-
-- Configure the Linked Server
140-
-- Add one Azure SQL Managed Instance as Linked Server
141-
EXEC sp_addlinkedserver
142-
@server='RemoteServer', -- Linked server name
143-
@srvproduct='',
144-
@provider='sqlncli', -- SQL Server Native Client
145-
@datasrc='managed-instance-server.46e7afd5bc81.database.windows.net' -- Managed Instance endpoint
146-
147-
-- Add credentials and options to this Linked Server
148-
EXEC sp_addlinkedsrvlogin
149-
@rmtsrvname = 'RemoteServer', -- Linked server name
150-
@useself = 'false',
151-
@rmtuser = '<login_name>', -- login
152-
@rmtpassword = '<secure_password>' -- password
153-
154-
USE AdventureWorks2012;
155-
GO
156-
SET XACT_ABORT ON;
157-
GO
158-
BEGIN DISTRIBUTED TRANSACTION;
159-
-- Delete candidate from local instance.
160-
DELETE AdventureWorks2012.HumanResources.JobCandidate
161-
WHERE JobCandidateID = 13;
162-
-- Delete candidate from remote instance.
163-
DELETE RemoteServer.AdventureWorks2012.HumanResources.JobCandidate
164-
WHERE JobCandidateID = 13;
165-
COMMIT TRANSACTION;
166-
GO
132+
-- Configure the Linked Server
133+
-- Add one Azure SQL Managed Instance as Linked Server
134+
EXEC sp_addlinkedserver
135+
@server='RemoteServer', -- Linked server name
136+
@srvproduct='',
137+
@provider='sqlncli', -- SQL Server Native Client
138+
@datasrc='managed-instance-server.46e7afd5bc81.database.windows.net' -- Managed Instance endpoint
139+
-- Add credentials and options to this Linked Server
140+
EXEC sp_addlinkedsrvlogin
141+
@rmtsrvname = 'RemoteServer', -- Linked server name
142+
@useself = 'false',
143+
@rmtuser = '<login_name>', -- login
144+
@rmtpassword = '<secure_password>' -- password
145+
USE AdventureWorks2012;
146+
GO
147+
SET XACT_ABORT ON;
148+
GO
149+
BEGIN DISTRIBUTED TRANSACTION;
150+
-- Delete candidate from local instance.
151+
DELETE AdventureWorks2012.HumanResources.JobCandidate
152+
WHERE JobCandidateID = 13;
153+
-- Delete candidate from remote instance.
154+
DELETE RemoteServer.AdventureWorks2012.HumanResources.JobCandidate
155+
WHERE JobCandidateID = 13;
156+
COMMIT TRANSACTION;
157+
GO
167158
```
168159

169160
## Combining .NET and Transact-SQL development experience
@@ -175,51 +166,51 @@ The following sample Transact-SQL code uses [BEGIN DISTRIBUTED TRANSACTION](/sql
175166
Here is an example where transaction is explicitly promoted to distributed transaction with Transact-SQL.
176167

177168
```csharp
178-
using (TransactionScope s = new TransactionScope())
179-
{
180-
using (SqlConnection conn = new SqlConnection(DB0_ConnectionString)
181-
{
182-
conn.Open();
183-
184-
// Transaction is here promoted to distributed by BEGIN statement
185-
//
186-
Helper.ExecuteNonQueryOnOpenConnection(conn, "BEGIN DISTRIBUTED TRAN");
187-
// ...
188-
}
189-
 
190-
using (SqlConnection conn2 = new SqlConnection(DB1_ConnectionString)
191-
{
192-
conn2.Open();
193-
// ...
194-
}
195-
196-
s.Complete();
197-
}
169+
using (TransactionScope s = new TransactionScope())
170+
{
171+
using (SqlConnection conn = new SqlConnection(DB0_ConnectionString)
172+
{
173+
conn.Open();
174+
175+
// Transaction is here promoted to distributed by BEGIN statement
176+
//
177+
Helper.ExecuteNonQueryOnOpenConnection(conn, "BEGIN DISTRIBUTED TRAN");
178+
// ...
179+
}
180+
 
181+
using (SqlConnection conn2 = new SqlConnection(DB1_ConnectionString)
182+
{
183+
conn2.Open();
184+
// ...
185+
}
186+
187+
s.Complete();
188+
}
198189
```
199190

200191
Following example shows a transaction that is implicitly promoted to distributed transaction once the second SqlConnecton was started within the TransactionScope.
201192

202193
```csharp
203-
using (TransactionScope s = new TransactionScope())
204-
{
205-
using (SqlConnection conn = new SqlConnection(DB0_ConnectionString)
206-
{
207-
conn.Open();
208-
// ...
209-
}
210-
211-
using (SqlConnection conn = new SqlConnection(DB1_ConnectionString)
212-
{
213-
// Because this is second SqlConnection within TransactionScope transaction is here implicitly promoted distributed.
214-
//
215-
conn.Open();
216-
Helper.ExecuteNonQueryOnOpenConnection(conn, "BEGIN DISTRIBUTED TRAN");
217-
Helper.ExecuteNonQueryOnOpenConnection(conn, lsQuery);
218-
// ...
219-
}
220-
221-
s.Complete();
222-
}
194+
using (TransactionScope s = new TransactionScope())
195+
{
196+
using (SqlConnection conn = new SqlConnection(DB0_ConnectionString)
197+
{
198+
conn.Open();
199+
// ...
200+
}
201+
202+
using (SqlConnection conn = new SqlConnection(DB1_ConnectionString)
203+
{
204+
// Because this is second SqlConnection within TransactionScope transaction is here implicitly promoted distributed.
205+
//
206+
conn.Open();
207+
Helper.ExecuteNonQueryOnOpenConnection(conn, "BEGIN DISTRIBUTED TRAN");
208+
Helper.ExecuteNonQueryOnOpenConnection(conn, lsQuery);
209+
// ...
210+
}
211+
212+
s.Complete();
213+
}
223214
```
224215

225216
## Transactions across multiple servers for Azure SQL Database
@@ -275,9 +266,8 @@ The following limitations currently apply to distributed transactions in Managed
275266
## Next steps
276267

277268
* For questions, reach out to us on the [Microsoft Q&A question page for SQL Database](/answers/topics/azure-sql-database.html).
278-
* For feature requests, add them to the [SQL Database feedback forum](https://feedback.azure.com/forums/217321-sql-database/) or [Managed Instance forum](https://feedback.azure.com/forums/915676-sql-managed-instance).
279-
280269

270+
* For feature requests, add them to the [SQL Database feedback forum](https://feedback.azure.com/d365community/forum/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0) or [Managed Instance forum](https://feedback.azure.com/d365community/forum/a99f7006-3425-ec11-b6e6-000d3a4f0f84).
281271
282272
<!--Image references-->
283273
[1]: ./media/elastic-transactions-overview/distributed-transactions.png

articles/azure-sql/database/saas-tenancy-elastic-tools-multi-tenant-row-level-security.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: Multi-tenant apps with RLS and elastic database tools
33
description: Use elastic database tools with row-level security to build an application with a highly scalable data tier.
4-
services: sql-database
54
ms.service: sql-database
65
ms.subservice: scenario
76
ms.custom: sqldbrb=1
@@ -40,7 +39,7 @@ The goal is to use the elastic database client library [data-dependent routing](
4039

4140
This project extends the one described in [Elastic DB Tools for Azure SQL - Entity Framework Integration](elastic-scale-use-entity-framework-applications-visual-studio.md) by adding support for multi-tenant shard databases. The project builds a simple console application for creating blogs and posts. The project includes four tenants, plus two multi-tenant shard databases. This configuration is illustrated in the preceding diagram.
4241

43-
Build and run the application. This run bootstraps the elastic database tools shard map manager, and performs the following tests:
42+
Build and run the application. This run bootstraps the elastic database tools' shard map manager, and performs the following tests:
4443

4544
1. Using Entity Framework and LINQ, create a new blog and then display all blogs for each tenant
4645
2. Using ADO.NET SqlClient, display all blogs for a tenant
@@ -233,7 +232,7 @@ CREATE FUNCTION rls.fn_tenantAccessPredicate(@TenantId int)
233232
WITH SCHEMABINDING
234233
AS
235234
RETURN SELECT 1 AS fn_accessResult
236-
-- Use the user in your applications connection string.
235+
-- Use the user in your application's connection string.
237236
-- Here we use 'dbo' only for demo purposes!
238237
WHERE DATABASE_PRINCIPAL_ID() = DATABASE_PRINCIPAL_ID('dbo')
239238
AND CAST(SESSION_CONTEXT(N'TenantId') AS int) = @TenantId;
@@ -340,7 +339,7 @@ GO
340339

341340
## Summary
342341

343-
Elastic database tools and row-level security can be used together to scale out an applications data tier with support for both multi-tenant and single-tenant shards. Multi-tenant shards can be used to store data more efficiently. This efficiency is pronounced where a large number of tenants have only a few rows of data. Single-tenant shards can support premium tenants which have stricter performance and isolation requirements. For more information, see [Row-Level Security reference][rls].
342+
Elastic database tools and row-level security can be used together to scale out an application's data tier with support for both multi-tenant and single-tenant shards. Multi-tenant shards can be used to store data more efficiently. This efficiency is pronounced where a large number of tenants have only a few rows of data. Single-tenant shards can support premium tenants which have stricter performance and isolation requirements. For more information, see [Row-Level Security reference][rls].
344343

345344
## Additional resources
346345

@@ -352,7 +351,7 @@ Elastic database tools and row-level security can be used together to scale out
352351

353352
## Questions and Feature Requests
354353

355-
For questions, contact us on the [Microsoft Q&A question page for SQL Database](/answers/topics/azure-sql-database.html). And add any feature requests to the [SQL Database feedback forum](https://feedback.azure.com/forums/217321-sql-database/).
354+
For questions, contact us on the [Microsoft Q&A question page for SQL Database](/answers/topics/azure-sql-database.html). And add any feature requests to the [SQL Database feedback forum](https://feedback.azure.com/d365community/forum/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0).
356355

357356
<!--Image references-->
358357
[1]: ./media/saas-tenancy-elastic-tools-multi-tenant-row-level-security/blogging-app.png

0 commit comments

Comments
 (0)