Reference Object from another Subscription Azure Powershell

Viewed 30

I need to use this Powershell script but the storage account that I need to use is in a different subscription that the SqlDatabase so when I pass the name it wound find it in the current susbcription. How can I reference that object from another subscription in the parameter -StorageAccountName??

Thanks for your help

Get-AzSqlDatabase -ResourceGroupName $ResourceGroupName -ServerName $SQLServer `
| Where-Object {$_.DatabaseName -ne "master"}  `
| Update-AzSqlDatabaseVulnerabilityAssessmentSetting `
    -StorageAccountName $StorageAccountName `
    -ScanResultsContainerName "containerlogs" `
    -RecurringScansInterval Weekly `
    -EmailAdmins $true `
    -NotificationEmail @("xxx@mail.com" , "yyy@mail.com") 
0 Answers
Related