Skip to content

Commit dbff44e

Browse files
authored
Merge pull request #47 from MicrosoftDocs/main
Sync from main
2 parents bdb1eb0 + d3b8335 commit dbff44e

6 files changed

Lines changed: 67 additions & 1 deletion

File tree

azure-sql/database/automated-backups-change-settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ To change the PITR backup retention period or the differential backup frequency
5353
1. Go to the [logical server in Azure](logical-servers.md) with the databases whose retention period you want to change.
5454
1. Select **Backups** on the left pane, and then select the **Retention policies** tab.
5555
1. Select the databases for which you want to change the PITR backup retention.
56-
1. Select **Configure retention** from the action bar.
56+
1. Select **Configure policies** from the action bar.
5757

5858
:::image type="content" source="./media/automated-backups-overview/configure-backup-retention-sqldb.png" alt-text="Screenshot of the Azure portal, where you can change the PITR retention settings at the server level. ":::
5959

docs/tools/sqlpackage/sqlpackage-export.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ SqlPackage /Action:Export /TargetFile:"C:\AdventureWorksLT.bacpac" /UniversalAut
4747
/SourceConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
4848
```
4949

50+
```powershell
51+
# example export connecting using an access token associated with a service principal
52+
$Account = Connect-AzAccount -ServicePrincipal -Tenant $Tenant -Credential $Credential
53+
$AccessToken_Object = (Get-AzAccessToken -Account $Account -Resource "https://database.windows.net/")
54+
$AccessToken = $AccessToken_Object.Token
55+
56+
sqlpackage.exe /at:$AccessToken /Action:Export /TargetFile:"C:\AdventureWorksLT.bacpac" \
57+
/SourceConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
58+
# OR
59+
sqlpackage.exe /at:$($AccessToken_Object.Token) /Action:Export /TargetFile:"C:\AdventureWorksLT.bacpac" \
60+
/SourceConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
61+
```
62+
5063
## Parameters for the Export action
5164

5265
|Parameter|Short Form|Value|Description|

docs/tools/sqlpackage/sqlpackage-extract.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ SqlPackage /Action:Extract /TargetFile:"C:\AdventureWorksLT.dacpac" /UniversalAu
5757
/SourceConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
5858
```
5959

60+
```powershell
61+
# example extract to create a schema-only .dacpac file connecting using an access token associated with a service principal
62+
$Account = Connect-AzAccount -ServicePrincipal -Tenant $Tenant -Credential $Credential
63+
$AccessToken_Object = (Get-AzAccessToken -Account $Account -Resource "https://database.windows.net/")
64+
$AccessToken = $AccessToken_Object.Token
65+
66+
sqlpackage.exe /at:$AccessToken /Action:Extract /TargetFile:"C:\AdventureWorksLT.dacpac" \
67+
/SourceConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
68+
# OR
69+
sqlpackage.exe /at:$($AccessToken_Object.Token) /Action:Extract /TargetFile:"C:\AdventureWorksLT.dacpac" \
70+
/SourceConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
71+
```
72+
6073
## Parameters for the Extract action
6174

6275
|Parameter|Short Form|Value|Description|

docs/tools/sqlpackage/sqlpackage-import.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ SqlPackage /Action:Import /SourceFile:"C:\AdventureWorksLT.bacpac" /UniversalAut
4747
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
4848
```
4949

50+
```powershell
51+
# example import connecting using an access token associated with a service principal
52+
$Account = Connect-AzAccount -ServicePrincipal -Tenant $Tenant -Credential $Credential
53+
$AccessToken_Object = (Get-AzAccessToken -Account $Account -Resource "https://database.windows.net/")
54+
$AccessToken = $AccessToken_Object.Token
55+
56+
sqlpackage.exe /at:$AccessToken /Action:Import /SourceFile:"C:\AdventureWorksLT.bacpac" \
57+
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
58+
# OR
59+
sqlpackage.exe /at:$($AccessToken_Object.Token) /Action:Import /SourceFile:"C:\AdventureWorksLT.bacpac" \
60+
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
61+
```
62+
5063
## Parameters for the Import action
5164

5265
|Parameter|Short Form|Value|Description|

docs/tools/sqlpackage/sqlpackage-publish.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ SqlPackage /Action:Publish /SourceFile:"C:\AdventureWorksLT.dacpac" \
5757
/v:ETLUserPassword="asecurestringaddedhere" /v:AppUserPassword="asecurestringaddedhere"
5858
```
5959

60+
```powershell
61+
# example publish connecting using an access token associated with a service principal
62+
$Account = Connect-AzAccount -ServicePrincipal -Tenant $Tenant -Credential $Credential
63+
$AccessToken_Object = (Get-AzAccessToken -Account $Account -Resource "https://database.windows.net/")
64+
$AccessToken = $AccessToken_Object.Token
65+
66+
sqlpackage.exe /at:$AccessToken /Action:Publish /SourceFile:"C:\AdventureWorksLT.dacpac" \
67+
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
68+
# OR
69+
sqlpackage.exe /at:$($AccessToken_Object.Token) /Action:Publish /SourceFile:"C:\AdventureWorksLT.dacpac" \
70+
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
71+
```
72+
6073

6174
## Parameters for the Publish action
6275

docs/tools/sqlpackage/troubleshooting-issues-and-performance-with-sqlpackage.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@ The schema model is compiled in memory, so for large database schemas the memory
6161

6262
By default, SqlPackage sets the maximum server parallelism to 8. If you note low server resource consumption, increasing the value of the `MaxParallelism` parameter may improve performance.
6363

64+
### Handling access token
65+
66+
Using the `/AccessToken:` or `/at:` parameter enables token-based authentication for SqlPackage, however passing the token to the command can be tricky. If you are parsing an access token object in PowerShell either explicitly pass the string value or wrap the reference to the token property in $(). For example:
67+
68+
```powershell
69+
$Account = Connect-AzAccount -ServicePrincipal -Tenant $Tenant -Credential $Credential
70+
$AccessToken_Object = (Get-AzAccessToken -Account $Account -Resource "https://database.windows.net/")
71+
$AccessToken = $AccessToken_Object.Token
72+
73+
sqlpackage.exe /at:$AccessToken
74+
# OR
75+
sqlpackage.exe /at:$($AccessToken_Object.Token)
76+
```
77+
6478
## Diagnostics
6579
Logs are essential to troubleshooting. Capture the diagnostic logs to a file with the `/DiagnosticsFile:<filename>` parameter.
6680

0 commit comments

Comments
 (0)