Skip to content

Commit ac9c445

Browse files
author
Rami Bououni
committed
sqldb deploy
1 parent 1d7d378 commit ac9c445

File tree

1 file changed

+35
-27
lines changed

1 file changed

+35
-27
lines changed

docs/pipelines/targets/azure-sqldb.md

+35-27
Original file line numberDiff line numberDiff line change
@@ -253,19 +253,20 @@ For Classic release pipelines, select **Start with an empty pipeline**, link the
253253

254254
* * *
255255

256-
## Deploying conditionally
256+
## Deploy database conditionally
257257

258-
You may choose to deploy only certain builds to your Azure database.
258+
You can choose to deploy only specific builds to your Azure database, giving you more control over which changes are applied based on criteria like the source branch or build status.
259259

260260
#### [YAML](#tab/yaml/)
261261
::: moniker range="<=azure-devops"
262262

263263
To do this in YAML, you can use one of these techniques:
264264

265-
* Isolate the deployment steps into a separate job, and add a condition to that job.
266-
* Add a condition to the step.
265+
* Isolate the deployment steps into a separate job and apply a condition to that job.
267266

268-
The following example shows how to use step conditions to deploy only those builds that originate from main branch.
267+
* Add a condition directly to the step.
268+
269+
The example below shows how to deploy only builds from the main branch using [conditions](../process/conditions.md):
269270

270271
```yaml
271272
- task: SqlAzureDacpacDeployment@1
@@ -279,31 +280,28 @@ The following example shows how to use step conditions to deploy only those buil
279280
DacpacFile: '<Location of Dacpac file in $(Build.SourcesDirectory) after compilation>'
280281
```
281282

282-
To learn more about conditions, see [Specify conditions](../process/conditions.md).
283-
284283
::: moniker-end
285284

286285
#### [Classic](#tab/classic/)
287286

288-
In your release pipeline, you can implement various checks and conditions to control the deployment.
287+
With Classic release pipelines, you can implement various checks and conditions to control when and which deployments are triggered. Here are some strategies you can use:
289288

290-
> [!NOTE]
291-
> In some setups, you might need to allowlist the range of IP addresses for the specific region that is updated in the [weekly JSON file](https://www.microsoft.com/download/details.aspx?id=56519). Learn about [networking Microsoft-hosted agents](../agents/hosted.md#networking).
289+
* Use branch filters to set up your [continuous deployment triggers](../release/triggers.md#predeployment-approvals) to trigger a release whenever a new build from a specific branch becomes available.
292290

293-
* Set **branch filters** to configure the **continuous deployment trigger** on the artifact of the release pipeline.
294-
* Set **pre-deployment approvals** as a pre-condition for deployment to a stage.
295-
* Configure **gates** as a pre-condition for deployment to a stage.
296-
* Specify conditions for a task to run.
291+
* Use [pre-deployment approvals](../release/approvals/approvals.md#predeployment-approvals) to designate approvers who can either approve or reject deployment to a specific stage.
297292

298-
For more information, see [Release, branch, and stage triggers](../release/triggers.md), [Release deployment control using approvals](../release/approvals/approvals.md), [Release deployment control using gates](../release/approvals/gates.md), and [Specify conditions for running a task](../process/conditions.md).
293+
* Define a set of [gates](../release/deploy-using-approvals.md#set-up-gates) to ensure that the release pipeline meets specific criteria before deployment without requiring user intervention.
294+
295+
> [!NOTE]
296+
> In some scenarios, you might need allowlist the IP address range for the specific region, which is updated in the [weekly JSON file](https://www.microsoft.com/download/details.aspx?id=56519). See [networking Microsoft-hosted agents](../agents/hosted.md#networking) for more details.
299297

300298
* * *
299+
301300
## More SQL actions
302301

303-
**SQL Azure Dacpac Deployment** may not support all SQL server actions
304-
that you want to perform. In these cases, you can simply use PowerShell or command-line scripts to run the commands you need.
305-
This section shows some of the common use cases for invoking the [SqlPackage.exe tool](/sql/tools/sqlpackage-download).
306-
As a prerequisite to running this tool, you must use a self-hosted agent and have the tool installed on your agent.
302+
The SQL Azure Dacpac Deployment task might not cover all the SQL server actions you need to perform. In such cases, you can use PowerShell or command-line scripts to execute the required commands.
303+
304+
This section covers common use cases for invoking the [SqlPackage.exe tool](/sql/tools/sqlpackage-download). Before running this tool, make sure you're using a self-hosted agent with the tool installed.
307305

308306
> [!NOTE]
309307
> If you execute **SQLPackage** from the folder where it is installed, you must prefix the path with `&` and wrap it in double-quotes.
@@ -312,9 +310,9 @@ As a prerequisite to running this tool, you must use a self-hosted agent and hav
312310

313311
`<Path of SQLPackage.exe> <Arguments to SQLPackage.exe>`
314312

315-
You can use any of the following SQL scripts depending on the action that you want to perform
313+
You can use any of the following SQL scripts based on the action you wish to perform:
316314

317-
### Extract
315+
#### [Extract](#tab/extract/)
318316

319317
Creates a database snapshot (.dacpac) file from a live SQL server or Microsoft Azure SQL Database.
320318

@@ -346,7 +344,7 @@ SqlPackage.exe /TargetFile:"C:\temp\test.dacpac" /Action:Extract /SourceServerNa
346344
sqlpackage.exe /Action:Extract /?
347345
```
348346

349-
### Publish
347+
#### [Publish](#tab/publish/)
350348

351349
Incrementally updates a database schema to match the schema of a source .dacpac file. If the database doesn’t exist on the server, the publish operation will create it. Otherwise, an existing database will be updated.
352350

@@ -370,7 +368,7 @@ SqlPackage.exe /SourceFile:"E:\dacpac\ajyadb.dacpac" /Action:Publish /TargetServ
370368
sqlpackage.exe /Action:Publish /?
371369
```
372370

373-
### Export
371+
#### [Export](#tab/export/)
374372

375373
Exports a live database, including database schema and user data, from SQL Server or Microsoft Azure SQL Database to a BACPAC package (.bacpac file).
376374

@@ -394,7 +392,7 @@ SqlPackage.exe /TargetFile:"C:\temp\test.bacpac" /Action:Export /SourceServerNam
394392
sqlpackage.exe /Action:Export /?
395393
```
396394

397-
### Import
395+
#### [Import](#tab/import/)
398396

399397
Imports the schema and table data from a BACPAC package into a new user database in an instance of SQL Server or Microsoft Azure SQL Database.
400398

@@ -418,7 +416,7 @@ SqlPackage.exe /SourceFile:"C:\temp\test.bacpac" /Action:Import /TargetServerNam
418416
sqlpackage.exe /Action:Import /?
419417
```
420418

421-
### DeployReport
419+
#### [DeployReport](#tab/deployreport/)
422420

423421
Creates an XML report of the changes that would be made by a publish action.
424422

@@ -442,7 +440,7 @@ SqlPackage.exe /SourceFile:"E: \dacpac\ajyadb.dacpac" /Action:DeployReport /Targ
442440
sqlpackage.exe /Action:DeployReport /?
443441
```
444442

445-
### DriftReport
443+
#### [DriftReport](#tab/driftreport/)
446444

447445
Creates an XML report of the changes that have been made to a registered database since it was last registered.
448446

@@ -466,7 +464,7 @@ SqlPackage.exe /Action:DriftReport /TargetServerName:"DemoSqlServer.database.win
466464
sqlpackage.exe /Action:DriftReport /?
467465
```
468466

469-
### Script
467+
#### [Script](#tab/script/)
470468

471469
Creates a Transact-SQL incremental update script that updates the schema of a target to match the schema of a source.
472470

@@ -490,3 +488,13 @@ SqlPackage.exe /Action:Script /SourceFile:"E:\dacpac\ajyadb.dacpac" /TargetServe
490488
```command
491489
sqlpackage.exe /Action:Script /?
492490
```
491+
492+
***
493+
494+
## Related content
495+
496+
- [Azure Resource Manager service connections](../library/connect-to-azure.md)
497+
498+
- [Troubleshoot pipeline runs](../troubleshooting/troubleshooting.md)
499+
500+
- [Troubleshoot ARM service connections](../release/azure-rm-endpoint.md)

0 commit comments

Comments
 (0)