Skip to content

Commit aae4e88

Browse files
Refine Azure credential handling in log shipping
Updated logic to only specify AzureCredential for storage account key authentication. For SAS tokens, SQL Server automatically finds the credential by URL, removing unnecessary assignment.
1 parent ee798c4 commit aae4e88

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

public/Invoke-DbaDbLogShipping.ps1

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,12 +1493,10 @@ function Invoke-DbaDbLogShipping {
14931493
Type = "Full"
14941494
}
14951495

1496-
# Explicitly specify Azure credential - use base URL for credential name
1496+
# Only specify credential for storage account key authentication
1497+
# For SAS tokens, SQL Server finds credential automatically by URL
14971498
if ($AzureCredential) {
14981499
$splatBackup.AzureCredential = $AzureCredential
1499-
} else {
1500-
# For SAS tokens, credential is named after the base URL
1501-
$splatBackup.AzureCredential = $SharedPath
15021500
}
15031501

15041502
$LastBackup = Backup-DbaDatabase @splatBackup

0 commit comments

Comments
 (0)