How to apply NSG FLOW LOGS to a particula storage account which has suffix of diag using powershell from a subscription.

Girish Prajwal 706 Reputation points
2024-01-12T09:00:10.7933333+00:00

Hi Team,I would like to apply the NSG flow logs to an NSG where it is not associated with a NSG FLOW LOG to a particular storage account in a subscription. This has to be taken to multiple subscriptions. The storage account has a suffix of diag where we have 2 such storage accounts in 2 different regions. All NSGs hosted in East US must be enabled with flow logs in East US only on that storage account in East US only. For the ones in West US, it must add the NSG flow logs to West US only. This Requirement is on powershell.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,227 questions
Azure Network Watcher
Azure Network Watcher
An Azure service that is used to monitor, diagnose, and gain insights into network performance and health.
173 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Priya Kumar 1,096 Reputation points Microsoft Employee
    2024-01-12T09:19:02.6+00:00

    Hello ,

    Thanks for reaching Microsoft Q and A platform.

    Your query is to create a NSG flow logs, where the Storage Account and NSG are in different subscription?

    • NSGs hosted in East US must be enabled with flow logs in East US only on that storage account in East US only. (So the NSG flow logs you would create for the NSG must be mapped to the respected Storage Account).
    • For the ones in West US, it must add the NSG flow logs to West US only. (For all the NSG present in the West US, must be mapped to the Storage Account which is in West US region.)
    • Now question arise on how would you map the NSG flow logs in different Subscription to the Storage Account.
    • If the storage account is in a different subscription, the network security group and storage account must be associated with the same Azure Active Directory tenant. The account you use for each subscription must have the necessary permissions.
    • The storage account can't have network rules that restrict network access to only Microsoft services or specific virtual networks.
    • For all the configuration via the Powershell, please follow this Document: https://learn.microsoft.com/en-us/azure/network-watcher/network-watcher-nsg-flow-logging-powershell

    Regards,

    Priya Kumar

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.