File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1483,19 +1483,22 @@ function Invoke-DbaDbLogShipping {
14831483 $Timestamp = Get-Date - format " yyyyMMddHHmmss"
14841484
14851485 if ($UseAzure ) {
1486- # Backup to Azure blob storage - use base URL, put database folder in filename
1486+ # Backup to Azure blob storage - use database-specific URL and explicitly specify credential
14871487 $splatBackup = @ {
14881488 SqlInstance = $SourceSqlInstance
14891489 SqlCredential = $SourceSqlCredential
14901490 Database = $ ($db.Name )
1491- AzureBaseUrl = $SharedPath
1492- BackupFileName = " $ ( $db .Name ) / FullBackup_$ ( $db.Name ) _PreLogShipping_$Timestamp .bak"
1491+ AzureBaseUrl = $DatabaseSharedPath
1492+ BackupFileName = " FullBackup_$ ( $db.Name ) _PreLogShipping_$Timestamp .bak"
14931493 Type = " Full"
14941494 }
14951495
1496- # For Azure credentials, explicitly pass if provided, otherwise let Backup-DbaDatabase auto-detect
1496+ # Explicitly specify Azure credential - use base URL for credential name
14971497 if ($AzureCredential ) {
14981498 $splatBackup.AzureCredential = $AzureCredential
1499+ } else {
1500+ # For SAS tokens, credential is named after the base URL
1501+ $splatBackup.AzureCredential = $SharedPath
14991502 }
15001503
15011504 $LastBackup = Backup-DbaDatabase @splatBackup
You can’t perform that action at this time.
0 commit comments