Enable Virtual Network Flow Logs
This template deploys a virtual network flow log resource inside the Network Watcher resource group.
Sample overview and deployed resources
This template creates a virtual network flow log for an existing virtual network. The flow log is deployed to the resource group that contains the Network Watcher instance for the virtual network's region.
The following resources are deployed as part of the solution.
Microsoft.Network
- Network Watcher: Uses the regional Network Watcher instance that owns the flow log resource.
- Virtual network flow log: Records IP traffic for the existing virtual network and sends the data to the deployed storage account.
Microsoft.Storage
- Storage account: Stores the virtual network flow log data.
Prerequisites
- Network Watcher must be enabled in the region of the virtual network. Network Watcher is enabled by default unless you explicitly disable it.
- The
Microsoft.Insightsresource provider must be registered in the subscription. - An existing virtual network is required. The virtual network must be in the same region as the Network Watcher instance.
- The deployment must target the resource group that contains the regional Network Watcher instance. By default, Azure creates Network Watcher instances in
NetworkWatcherRG, but the resource group and instance names can be customized. - The deploying account must have the permissions required to create a flow log and storage account in the Network Watcher resource group.
Deployment steps
Select Deploy to Azure or Deploy to Azure US Gov at the beginning of this document. In the Azure portal:
- Select the resource group that contains the Network Watcher instance for the virtual network's region.
- For Existing VNet, enter the full resource ID of the virtual network.
- Set Location to the virtual network's region.
- If your Network Watcher instance uses a custom name, update Network Watcher Name.
- Review the remaining flow log and storage account settings, and then deploy the template.
Useful links
- Virtual network flow logs overview
- Create, change, enable, disable, or delete virtual network flow logs
- Register the Microsoft.Insights provider
- Network Watcher deployment model
- What is NetworkWatcherRG?
- Azure RBAC permissions required to use Network Watcher
Tags: Network Watcher, virtual network flow logs, Microsoft.Storage/storageAccounts, Microsoft.Resources/deployments, Microsoft.Network/networkWatchers/flowLogs, JSON, Microsoft.Network/virtualNetworks