Skip to content

Commit 36ea65a

Browse files
authored
Merge pull request #36614 from MicrosoftDocs/FromPublicRepo
Confirm merge from FromPublicRepo to main to sync with https://github.com/MicrosoftDocs/sql-docs (branch live)
2 parents 45d70e4 + 7ce528c commit 36ea65a

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

docs/tools/sqlpackage/sqlpackage-deploy-drift-report.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,15 @@ SqlPackage {parameters}{properties}{SQLCMD Variables}
163163
|**/p:**|UnmodifiableObjectWarnings=(BOOLEAN 'True')|Specifies whether warnings should be generated when differences are found in objects that cannot be modified, for example, if the file size or file paths were different for a file.|
164164
|**/p:**|VerifyCollationCompatibility=(BOOLEAN 'True')|Specifies whether collation compatibility is verified.|
165165
|**/p:**|VerifyDeployment=(BOOLEAN 'True')|Specifies whether checks should be performed before publishing that will stop the publish action if issues are present that might block successful publishing. For example, your publish action might stop if you have foreign keys on the target database that do not exist in the database project, and that causes errors when you publish. |
166-
166+
167+
### DeployReport examples
168+
```bash
169+
# example deploy report using a source .dacpac file and a target connection string (Azure SQL)
170+
SqlPackage /Action:DeployReport /SourceFile:"C:\AdventureWorksLT.dacpac" \
171+
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=DW;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" \
172+
/DeployReportPath:"C:\AdventureWorksLTDeployReport.xml"
173+
```
174+
167175
## DriftReport action parameters
168176

169177
|Parameter|Short Form|Value|Description|
@@ -188,6 +196,14 @@ SqlPackage {parameters}{properties}{SQLCMD Variables}
188196
|**/TenantId:**|**/tid:**|{string}|Represents the Microsoft Entra tenant ID or domain name. This option is required to support guest or imported Microsoft Entra users as well as Microsoft accounts such as outlook.com, hotmail.com, or live.com. If this parameter is omitted, the default tenant ID for Microsoft Entra ID will be used, assuming that the authenticated user is a native user for this tenant. However, in this case any guest or imported users and/or Microsoft accounts hosted in this Microsoft Entra ID are not supported and the operation will fail. <br/> For more information, see [Universal authentication with SQL Database and Azure Synapse Analytics (SSMS support for MFA)](/azure/sql-database/sql-database-ssms-mfa-authentication).|
189197
|**/UniversalAuthentication:**|**/ua:**|{True&#124;False}|Specifies if universal authentication should be used. When set to True, the interactive authentication protocol is activated supporting MFA. This option can also be used for Microsoft Entra authentication without MFA, using an interactive protocol requiring the user to enter their username and password or integrated authentication (Windows credentials). When /UniversalAuthentication is set to True, no Microsoft Entra authentication can be specified in SourceConnectionString (/scs). When /UniversalAuthentication is set to False, Microsoft Entra authentication must be specified in SourceConnectionString (/scs). <br/> For more information, see [Universal authentication with SQL Database and Azure Synapse Analytics (SSMS support for MFA)](/azure/sql-database/sql-database-ssms-mfa-authentication).|
190198

191-
## Next Steps
199+
### DriftReport examples
200+
```bash
201+
# example drift report using a target connection string (Azure SQL)
202+
SqlPackage /Action:DriftReport \
203+
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" \
204+
/OutputPath:"C:\AdventureWorksLT.DriftReport.xml"
205+
```
206+
207+
## Next steps
192208

193209
- Learn more about [SqlPackage](sqlpackage.md)

docs/tools/sqlpackage/sqlpackage-extract.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ SqlPackage /Action:Extract /TargetFile:"C:\AdventureWorksLT.dacpac" /UniversalAu
6161
```
6262

6363
```powershell
64+
$ClientId = "<app-registration-client-id>"
65+
$ClientSecret = "<client-secret>"
66+
67+
# Convert the service principal client secret into a SecureString and create a PSCredential object for authentication.
68+
$SecureSecret = ConvertTo-SecureString $ClientSecret -AsPlainText -Force
69+
$Credential = New-Object System.Management.Automation.PSCredential($ClientId, $SecureSecret)
70+
6471
# example extract to create a schema-only .dacpac file connecting using an access token associated with a service principal
6572
$Account = Connect-AzAccount -ServicePrincipal -Tenant $Tenant -Credential $Credential
6673
$AccessToken_Object = (Get-AzAccessToken -Account $Account -Resource "https://database.windows.net/")

0 commit comments

Comments
 (0)