Reputation: 986
I am using following command :
Select-AzureRMSubscription -SubscriptionId $subscriptionID
Set-AzureRmSqlDatabaseAuditingPolicy -ResourceGroupName $resourceGroupName -ServerName $servername -DatabaseName $dbServer.DatabaseName -StorageAccountName $storageAccount
Storage Account and DB server belong to different subscriptions , how can I execute a command that will allow to access resources from multiple subscription
Upvotes: 1
Views: 1059
Reputation: 281
You can use following command to select subscription :-
az account set --subscription "Subscription Name or Subscription Id"
Upvotes: 1
Reputation: 13974
how can I execute a command that will allow to access resources from multiple subscription
We can share your resource groups to different subscriptions, to achieve this, we should invite user B(subscription 2) to AAD (subscription 1), and grant resource group permission to user B, then we can use PowerShell to get the resource groups.
Here a similar case about you, please refer to it.
Upvotes: 1