Skip to content

Commit 737fb93

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/sql-docs-pr into fixes
2 parents 2124ccf + 132fd07 commit 737fb93

24 files changed

Lines changed: 478 additions & 299 deletions

azure-sql/database/auditing-overview.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ You can use SQL Database auditing to:
3939
4040
### Auditing limitations
4141

42-
- **User managed identity** authentication type for enabling auditing to **storage behind firewall** is not currently supported.
4342
- Enabling auditing on a paused **Azure Synapse** is not supported. To enable auditing, resume Azure Synapse.
4443
- Auditing for **Azure Synapse SQL pools** supports default audit action groups **only**.
4544
- When you configure the auditing for your [logical server in Azure](logical-servers.md) or Azure SQL Database with log destination as the storage account, the target storage account must be enabled with access to storage account keys. If the storage account is configured to use Azure AD authentication only and not configured for access key usage, the auditing cannot be configured. <!-- REST API reference: - /rest/api/sql/2021-08-01-preview/server-blob-auditing-policies/create-or-update -->

azure-sql/database/high-availability-sla.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ Consider the following when using zone redundancy:
9696

9797

9898
During preview, zone redundancy for SQL Managed Instance is available in the Business Critical service tier and supported in the following regions:
99+
99100
| Geography | Regions supporting zone redundancy for Business Critical service tier |
100-
|:-- |:-- |
101+
| :--- | :--- |
101102
| Europe, Middle East, Africa | North Europe, Norway East, South Africa North, Sweden Central, Switzerland North, West Europe, UAE North, UK South |
102103
| Americas | Brazil South, Canada Central, East US, South Central US, West US 3 |
103104
| Asia Pacific | Australia East, East Asia, India Central, Japan East, Korea Central |

azure-sql/database/resource-limits-vcore-single-databases.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,6 @@ The [serverless compute tier](serverless-tier-overview.md) is currently availabl
217217
<sup>2</sup> Besides local SSD IO, workloads will use remote [page server](hyperscale-architecture.md#page-server) IO. Effective IOPS will depend on workload. For details, see [Data IO Governance](resource-limits-logical-server.md#resource-governance), and [Data IO in resource utilization statistics](hyperscale-performance-diagnostics.md#data-io-in-resource-utilization-statistics).
218218
<sup>3</sup> Latency is 1-2 ms for data on local compute replica SSD, which caches most used data pages. Higher latency for data retrieved from page servers.
219219

220-
## Hyperscale - provisioned compute - Gen5
221-
222220
## <a id="hyperscale---provisioned-compute---gen5"></a>Hyperscale - provisioned compute - standard-series (Gen5)
223221

224222
### <a id="gen5-hardware-part-1-2"></a>Hyperscale Standard-series (Gen5) compute generation (part 1 of 2)
@@ -1174,4 +1172,4 @@ This section includes details on previously available hardware.
11741172
- For information about general Azure limits, see [Azure subscription and service limits, quotas, and constraints](/azure/azure-resource-manager/management/azure-subscription-service-limits).
11751173
- For information about resource limits on a server, see [overview of resource limits on a server](resource-limits-logical-server.md) for information about limits at the server and subscription levels.
11761174
- [ALTER DATABASE - Azure SQL Database](/sql/t-sql/statements/alter-database-transact-sql?view=azuresqldb-current&preserve-view=true)
1177-
- [CREATE DATABASE - Azure SQL Database](/sql/t-sql/statements/create-database-transact-sql?view=azuresqldb-current&preserve-view=true)
1175+
- [CREATE DATABASE - Azure SQL Database](/sql/t-sql/statements/create-database-transact-sql?view=azuresqldb-current&preserve-view=true)

azure-sql/managed-instance/log-replay-service-migrate.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Make sure that you meet the following requirements for SQL Server:
4242
- A log backup (not split for a transaction log file).
4343
- For SQL Server versions 2008 to 2016, take a backup locally and [manually upload](#copy-existing-backups-to-your-blob-storage-account) it to your Azure Blob Storage account.
4444
- For SQL Server 2016 and later, you can [take your backup directly](#take-backups-directly-to-your-blob-storage-account) to your Azure Blob Storage account.
45-
- For SQL Server 2022, you can choose to use a managed identity instead of a shared access signature (SAS) token to authenticate to your Azure Blob Storage account.
45+
4646

4747

4848
Although having `CHECKSUM` enabled for backups isn't required, we highly recommend it for faster restore operations.
@@ -314,11 +314,7 @@ After your backups are ready, and you want to start migrating databases to a man
314314

315315
If you're on a supported version of SQL Server (starting with SQL Server 2012 SP1 CU2 and SQL Server 2014), and your corporate and network policies allow it, you can take backups from SQL Server directly to your Blob Storage account by using the native SQL Server [BACKUP TO URL](/sql/relational-databases/backup-restore/sql-server-backup-to-url) option. If you can use `BACKUP TO URL`, you don't need to take backups to local storage and upload them to your Blob Storage account.
316316

317-
When you take native backups directly to your Blob Storage account, you have to authenticate to the storage account. You can do so by using a SAS token or, if you're on SQL Server 2022, you can also use a managed identity.
318-
319-
320-
321-
### [SAS token](#tab/sas-token)
317+
When you take native backups directly to your Blob Storage account, you have to authenticate to the storage account.
322318

323319
Use the following command to create a credential that imports the SAS token to your SQL Server instance:
324320

@@ -331,20 +327,6 @@ SECRET = '<SAS_TOKEN>';
331327
For detailed instructions working with SAS tokens, review the tutorial [Use Azure Blob Storage with SQL Server](/sql/relational-databases/tutorial-use-azure-blob-storage-service-with-sql-server-2016#1---create-stored-access-policy-and-shared-access-storage).
332328

333329

334-
335-
### [Managed identity](#tab/managed-identity)
336-
337-
SQL Server 2022 has added support for managed identities. If you're on SQL Server 2022, you can authenticate to your storage account by using a managed identity.
338-
339-
Use the following command to create a credential that uses the managed identity on your SQL Server instance:
340-
341-
```sql
342-
CREATE CREDENTIAL [https://<mystorageaccountname>.blob.core.windows.net/<containername>]
343-
WITH IDENTITY = 'MANAGED IDENTITY'
344-
```
345-
346-
---
347-
348330
After you've created the credential to authenticate your SQL Server instance with Blob Storage, you can use the [BACKUP TO URL](/sql/relational-databases/backup-restore/sql-server-backup-to-url) command to take backups directly to the storage account. `CHECKSUM` is recommended, but not required.
349331

350332

azure-sql/managed-instance/managed-instance-link-feature-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The link supports single node SQL Server instances without existing availability
2828

2929
The link feature currently offers the following functionality:
3030

31-
- **One-way replication (SQL Server versions 2017 to 2019)**: Use the link feature to replicate data one way from a SQL Server instance to your managed instance. Although you can manually fail over to your managed instance if there's a disaster, doing so breaks the link, and failing back isn't supported.
31+
- **One-way replication (SQL Server versions 2016 to 2019)**: Use the link feature to replicate data one way from a SQL Server instance to your managed instance. Although you can manually fail over to your managed instance if there's a disaster, doing so breaks the link, and failing back isn't supported.
3232
- **Disaster recovery (SQL Server 2022)**: Use the link feature to replicate data from a SQL Server 2022 instance to your managed instance, manually fail over to your managed instance during a disaster, and fail back to the SQL Server instance after you've mitigated the disaster.
3333

3434
This feature is currently in limited public preview. [You must sign up for limited public preview](https://aka.ms/mi-link-dr-preview-signup) so that the product group can configure your environment for the preview.
Lines changed: 117 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
22
title: Use SDK-style projects with the SQL Database Projects extension
3-
description: Getting started using SDK-style SQL projects with the SQL Database Projects extension for Azure Data Studio or VS Code
3+
description: Getting started using SDK-style SQL projects with the SQL Database Projects extension for Azure Data Studio or Visual Studio Code
44
author: dzsquared
55
ms.author: drskwier
66
ms.reviewer: maghan
7-
ms.date: 5/24/2022
7+
ms.date: 2/14/2023
88
ms.service: azure-data-studio
99
ms.topic: conceptual
1010
ms.custom: intro-get-started
1111
---
1212

1313
# Use SDK-style SQL projects with the SQL Database Projects extension (Preview)
1414

15-
This article introduces [Microsoft.Build.Sql](https://www.nuget.org/packages/Microsoft.Build.Sql) for SDK-style SQL projects in the SQL Database Projects extension in Azure Data Studio or VS Code. SDK-style SQL projects are especially advantageous for applications shipped through pipelines or built in cross-platform environments. The initial announcement is available in [TechCommunity](https://techcommunity.microsoft.com/t5/azure-sql-blog/microsoft-build-sql-the-next-frontier-of-sql-projects/ba-p/3290628).
15+
This article introduces [Microsoft.Build.Sql](https://www.nuget.org/packages/Microsoft.Build.Sql) for SDK-style SQL projects in the SQL Database Projects extension in Azure Data Studio or Visual Studio Code. SDK-style SQL projects are especially advantageous for applications shipped through pipelines or built in cross-platform environments. The initial announcement is available in [TechCommunity](https://techcommunity.microsoft.com/t5/azure-sql-blog/microsoft-build-sql-the-next-frontier-of-sql-projects/ba-p/3290628).
1616

1717
> [!NOTE]
18-
> The SDK-style SQL projects is currently in preview.
18+
> Microsoft.Build.Sql is currently in preview.
1919
2020
## Create an SDK-style database project
2121

@@ -29,23 +29,132 @@ By default the selection for **SDK-style project (Preview)** is checked. When th
2929

3030
### From an existing database
3131

32-
In the **Project** view, select the **Import Project from Database** button and connect to a SQL Server. Once the connection is established, select a database from the list of available databases and set the name of the project. Select a target structure of the extraction.
32+
In the **Project** view, select the **Create Project from Database** button and connect to a SQL Server. Once the connection is established, select a database from the list of available databases and set the name of the project. Select a target structure of the extraction.
3333

3434
By default the selection for **SDK-style project (Preview)** is checked. When the dialog is completed, the new project is opened and contains SQL scripts for the contents of the selected database.
3535

3636
## Build and publish
3737

38-
From the Azure Data Studio and VS Code interfaces, building and publishing an SDK-style SQL project is completed in the same way as the previous SQL project format. For more on this process, see [Build and Publish a Project](sql-database-project-extension-build.md).
38+
From the Azure Data Studio and Visual Studio Code interfaces, building and publishing an SDK-style SQL project is completed in the same way as the previous SQL project format. For more on this process, see [Build and Publish a Project](sql-database-project-extension-build.md).
3939

4040
To build an SDK-style SQL project from the command line on Windows, macOS, or Linux, use the following command:
4141

4242
```bash
43-
dotnet build /p:NetCoreBuild=true
43+
dotnet build
4444
```
4545

46-
The `.dacpac` resulting from building an SDK-style SQL project is compatible with tooling associated with the data-tier application framework (`.dacpac`, `.bacpac`), including [SqlPackage](../../tools/sqlpackage/sqlpackage-publish.md).
46+
The `.dacpac` file resulting from building an SDK-style SQL project is compatible with tooling associated with the data-tier application framework (`.dacpac`, `.bacpac`), including [SqlPackage](../../tools/sqlpackage/sqlpackage-publish.md) and GitHub [sql-action](https://github.com/azure/sql-action).
47+
48+
## Project capabilities
49+
In SQL projects there are several capabilities that can be specified in the `.sqlproj` file that impact the database model either at project build or deployment. The following sections describe some of these capabilities that are available for Microsoft.Build.Sql projects.
50+
51+
### Target platform
52+
The target platform property is contained in the `DSP` tag in the `.sqlproj` file under the `<PropertyGroup>` item. The target platform is used during project build to validate support for features included in the project and is added to the `.dacpac` file as a property. By default, during deployment, the target platform is checked against the target database to ensure compatibility. If the target platform is not supported by the target database, the deployment fails unless an override [publish option](../../tools/sqlpackage/sqlpackage-publish.md) is specified.
53+
54+
```xml
55+
<Project DefaultTargets="Build">
56+
<Sdk Name="Microsoft.Build.Sql" Version="0.1.9-preview" />
57+
<PropertyGroup>
58+
<Name>AdventureWorks</Name>
59+
<DSP>Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider</DSP>
60+
</PropertyGroup>
61+
```
62+
63+
Valid settings for the target platform are:
64+
- `Microsoft.Data.Tools.Schema.Sql.Sql120DatabaseSchemaProvider`
65+
- `Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider`
66+
- `Microsoft.Data.Tools.Schema.Sql.Sql140DatabaseSchemaProvider`
67+
- `Microsoft.Data.Tools.Schema.Sql.Sql150DatabaseSchemaProvider`
68+
- `Microsoft.Data.Tools.Schema.Sql.Sql160DatabaseSchemaProvider`
69+
- `Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider`
70+
- `Microsoft.Data.Tools.Schema.Sql.SqlDwDatabaseSchemaProvider`
71+
72+
### Database references
73+
The database model validation at build time can be extended past the contents of the SQL project through database references. Database references specified in the `.sqlproj` file can reference another SQL project or a `.dacpac` file, representing either another database or more components of the same database.
74+
75+
The following attributes are available for database references that represent another database:
76+
- **DatabaseSqlCmdVariable:** the value is the name of the variable that is used to reference the database
77+
- Reference setting: `<DatabaseSqlCmdVariable>SomeOtherDatabase</DatabaseSqlCmdVariable>`
78+
- Usage example: `SELECT * FROM [$(SomeOtherDatabase)].dbo.Table1`
79+
- **ServerSqlCmdVariable:** the value is the name of the variable that is used to reference the server where the database resides. used with DatabaseSqlCmdVariable, when the database is in another server.
80+
- Reference setting: `<ServerSqlCmdVariable>SomeOtherServer</ServerSqlCmdVariable>`
81+
- Usage example: `SELECT * FROM [$(SomeOtherServer)].[$(SomeOtherDatabase)].dbo.Table1`
82+
- **DatabaseVariableLiteralValue:** the value is the literal name of the database as used in the SQL project, similar to `DatabaseSqlCmdVariable` but the reference to other database is a literal value
83+
- Reference setting: `<DatabaseVariableLiteralValue>SomeOtherDatabase</DatabaseVariableLiteralValue>`
84+
- Usage example: `SELECT * FROM [SomeOtherDatabase].dbo.Table1`
85+
86+
In a SQL project file, a database reference is specified as an `ArtifactReference` item with the `Include` attribute set to the path of the `.dacpac` file.
87+
88+
```xml
89+
<ItemGroup>
90+
<ArtifactReference Include="SampleA.dacpac">
91+
<DatabaseSqlCmdVariable>DatabaseA</DatabaseSqlCmdVariable>
92+
</ArtifactReference>
93+
</ItemGroup>
94+
</Project>
95+
```
96+
97+
### Package references
98+
Package references are used to reference NuGet packages that contain a `.dacpac` file and are used to extend the database model at build time similarly as a [database reference](#database-references).
99+
100+
The following example from a SQL project file references the `Microsoft.SqlServer.Dacpacs` [package](https://www.nuget.org/packages/Microsoft.SqlServer.Dacpacs) for the `master` database.
101+
102+
```xml
103+
<ItemGroup>
104+
<PackageReference Include="Microsoft.SqlServer.Dacpacs" Version="160.0.0" />
105+
</ItemGroup>
106+
</Project>
107+
```
108+
109+
In addition to the attributes available for [database references](#database-references), the following `DacpacName` attribute can be specified to select a `.dacpac` from a package that contains multiple `.dacpac` files.
110+
111+
```xml
112+
<ItemGroup>
113+
<PackageReference Include="Microsoft.SqlServer.Dacpacs" Version="160.0.0" />
114+
<DacpacName>msdb</DacpacName>
115+
</PackageReference>
116+
</ItemGroup>
117+
</Project>
118+
```
119+
120+
### SqlCmd variables
121+
SqlCmd variables can be defined in the `.sqlproj` file and are used to replace tokens in SQL objects and scripts during `.dacpac` [deployment](../../tools/sqlpackage/sqlpackage-publish.md#sqlcmd-variables). The following example from a SQL project file defines a variable named `EnvironmentName` that available for use in the project's objects and scripts.
122+
123+
```xml
124+
<ItemGroup>
125+
<SqlCmdVariable Include="EnvironmentName">
126+
<DefaultValue>testing</DefaultValue>
127+
<Value>$(SqlCmdVar__1)</Value>
128+
</SqlCmdVariable>
129+
</ItemGroup>
130+
</Project>
131+
```
132+
133+
```sql
134+
IF '$(EnvironmentName)' = 'testing'
135+
BEING
136+
-- do something
137+
END
138+
```
139+
140+
When a compiled SQL project (`.dacpac`) is deployed, the value of the variable is replaced with the value specified in the deployment command. For example, the following command deploys the `AdventureWorks.dacpac` and sets the value of the `EnvironmentName` variable to `production`.
141+
142+
```bash
143+
SqlPackage /Action:Publish /SourceFile:AdventureWorks.dacpac /TargetConnectionString:{connection_string_here} /v:EnvironmentName=production
144+
```
145+
146+
### Pre/post-deployment scripts
147+
Pre- and post-deployment scripts are SQL scripts that are included in the project to be executed during deployment. Pre/post-deployment scripts are included in the `.dacpac` but they are not compiled into or validated with database object model. A pre-deployment script is executed before the database model is applied and a post-deployment script is executed after the database model is applied. The following example from a SQL project file adds the file `populate-app-settings.sql` as post-deployment script.
148+
149+
```xml
150+
<ItemGroup>
151+
<PostDeploy Include="populate-app-settings.sql" />
152+
</ItemGroup>
153+
</Project>
154+
```
47155

48156

49157
## Next steps
50158

51159
- [Build and Publish a project with the SQL Database Projects extension](sql-database-project-extension-build.md)
160+
- [Install SqlPackage for deployment from the CLI](../../tools/sqlpackage/sqlpackage-download.md)

0 commit comments

Comments
 (0)