@Maheswararaju P Welcome to Microsoft Q&A Forum, Thank you for posting your query here!
To push all the accumulated individual flow logs of any storage accounts to one common storage account, you can follow the below steps:
Create a new storage account that will be used as the centralized common storage account.
Create a new Azure Function App that will be used to copy the NSG flow logs from the individual storage accounts to the centralized common storage account.
Configure the Azure Function App to copy the NSG flow logs from the individual storage accounts to the centralized common storage account.
Here are the detailed steps:
Create a new storage account that will be used as the centralized common storage account. You can use the following command to create a new storage account:
New-AzStorageAccount `
-Location <location> `
-<span class="active-doc-0" data-doc-items="0">Name <replace-with-your-unique-storage-account-name[1](#doc-pos=0)</span>> `
-ResourceGroupName <resource-group-name> `
-SkuName Standard_LRS `
-Kind StorageV2
Create a new Azure Function App that will be used to copy the NSG flow logs from the individual storage accounts to the centralized common storage account. You can use the following command to create a new Azure Function App:
New-AzFunctionApp `
-ResourceGroupName <resource-group-name> `
-Name <function-app-name> `
-StorageAccountName <storage-account-name> `
-Runtime dotnet `
-FunctionsVersion 3
Configure the Azure Function App to copy the NSG flow logs from the individual storage accounts to the centralized common storage account2. You can use the following code as a starting point for your Azure Function:
using System;
using System.IO;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
public static void Run(TimerInfo myTimer, ILogger log)
{
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
// Get the connection string for the centralized common storage account
string centralizedStorageConnectionString = Environment.GetEnvironmentVariable("CentralizedStorageConnectionString");
// <span class="active-doc-0" data-doc-items="0">Get the connection string for the individual storage accounts[1](#doc-pos=0)</span>
string[] individualStorageConnectionStrings = Environment.GetEnvironmentVariable("IndividualStorageConnectionStrings").Split(';');
// Get the name of the container that contains the NSG flow logs
string containerName = Environment.GetEnvironmentVariable("ContainerName
Reference link: Flow logs for network security groups Enable Azure Network Watcher Please let us know if you have any further queries. I’m happy to assist you further.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.