-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
CXP Attention[Deprecated] The Azure CXP Support Team is responsible for this issue.[Deprecated] The Azure CXP Support Team is responsible for this issue.SQL - Backup & Restorecustomer-reportedquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Description
Description
We are trying to follow this tutorial trying to do the cross subscription
[hashtable]$tags = @{"region" = "eastus2"}
$SourceResourceGroupName = "xxttt"
$SourceSynapseWorkspaceName = "xxyy"
$SourceSqlPoolName = "sxxyy"
$RestorePointLabel = "abc"
$TargetResourceGroupName ="abc"
$TargetServerName = "abc"
$TargetDatabaseName = "ac"
$Sourcesqlpool = Get-AzSynapseSqlPool -ResourceGroupName $SourceResourceGroupName -WorkspaceName $SourceSynapseWorkspaceName -Name $SourceSqlPoolName
Write-Output $Sourcesqlpool
$restorePoint = $Sourcesqlpool | Get-AzSynapseSqlPoolRestorePoint | Where-Object {$_.RestorePointLabel -eq $RestorePointLabel}
Write-Output $restorePoint
$DestinationSubscriptionId = "abc"
Set-AzContext -SubscriptionId $DestinationSubscriptionId
$PointInTime = $RestorePoint.RestorePointCreationDate
Write-Output $PointInTime
$RestoredDatabase = Restore-AzSqlDatabase -FromPointInTimeBackup -PointInTime $PointInTime `
-ResourceGroupName $TargetResourceGroupName -Tag $tags `
-ServerName $TargetServerName -TargetDatabaseName $TargetDatabaseName `
-ResourceId $Sourcesqlpool.Id -Edition "DataWarehouse" `
-ServiceObjectiveName "DW100c"
This script was finally failing on Restore-AzSqlDatabase where the tags is not getting applied to the new sqldb
Issue script & Debug output
Resource 'synapsedb' was disallowed by policy. Policy identifiers:
| '[{"policyAssignment":{"name":"Mandate and Audit Tags on Supported Resources}Environment data
Name Value
---- -----
PSVersion 7.2.1
PSEdition Core
GitCommitId 7.2.1
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Module versions
Error output
Resource 'synapsedb' was disallowed by policy. Policy identifiers:
| '[{"policyAssignment":{"name":"Mandate and Audit Tags on Supported Resources}Metadata
Metadata
Assignees
Labels
CXP Attention[Deprecated] The Azure CXP Support Team is responsible for this issue.[Deprecated] The Azure CXP Support Team is responsible for this issue.SQL - Backup & Restorecustomer-reportedquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
