An Azure relational database service.
Hello **Julie
**You can absolutely point your Managed Instance VA to a storage account in another subscription – it isn’t limited to “same-sub” only. The trick is that when you call Update-AzSqlInstanceVulnerabilityAssessmentSetting you must reference the storage account by its full resource ID (or its key/SAS URI), not just by name. Here’s a quick PowerShell pattern you can adapt:
# 1. Make sure you’re logged into both subs (or have a context for the storage sub)
Connect-AzAccount
# (Optional) Set context to the storage subscription so Get-AzStorageAccount will find it:
Set-AzContext -SubscriptionId "<storage-subscription-id>"
# 2. Grab the StorageAccount object
$sa = Get-AzStorageAccount -ResourceGroupName "RG-Storage" -Name "myStorageAcct"
# 3. Switch context back to the MI subscription if needed
Set-AzContext -SubscriptionId "<mi-subscription-id>"
# 4. Update VA on your Managed Instance
Update-AzSqlInstanceVulnerabilityAssessmentSetting
-ResourceGroupName "RG-MI"
-InstanceName "myManagedInstance"
-StorageAccountName "mystorage"
-ScanResultsContainerName "vulnerability-assessment"
-RecurringScansInterval Weekly
Key things to check:
• Storage account must be GPv1 or GPv2, Standard performance, same region as your MI.
• The MI’s managed identity (or your user principal) needs these roles on the storage account:
- Storage Blob Data Reader (to read/write blobs)
- Owner or User Access Administrator (to let VA save its settings) • You also need SQL Security Manager on the Managed Instance itself.
If you still see “storage account not found,” double-check:
- That you’re targeting the correct subscription context when you call Get-AzStorageAccount or set the resource ID,
- That your PowerShell module (Az.Sql) is up to date, and
- Your identity has Microsoft.Storage/storageAccounts/read permission on that storage resource.
https://learn.microsoft.com/en-us/powershell/module/az.sql/update-azsqlinstancevulnerabilityassessmentsetting?view=azps-15.4.0
https://learn.microsoft.com/en-us/azure/defender-for-cloud/sql-azure-vulnerability-assessment-overview
https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles/storage#storage-blob-data-reader
Please do let us know if you have any further queries. I am happy to address you.