How to export the rules of Network Security group from Azure classic deployment to excel. Also, we need to migrate this deployment to ARM. How is it done.

Girish Prajwal 706 Reputation points
2020-11-11T07:59:21.287+00:00

Hi Team,

I know its too late for me migrate the classic resource to ARM. We have few ACL's which were deployed in ASM. We want to migrate the network security rules configured on Classic Network security groups to ARM.

  1. Rules to be exported to Excel from old network security group
  2. Import the rules from excel to ARM NSG
  3. How do we migrate from Classic to ARM for NSG's
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,463 questions
{count} votes

Accepted answer
  1. Girish Prajwal 706 Reputation points
    2020-11-18T08:50:15.833+00:00

    After all my research, I was able to find the way to export Rules from classic NSG.

    Pre-requisite - you need to be co-administrator to access the classic resources at Subscription level.

    Export Classic NSG Rules

    (Get-AzureNetworkSecurityGroup -Name "Group <ResourceGroupName> <Classic NSG Name>" -Detailed).Rules | Export-Csv -Path C:\NSG01.csv -NoTypeInformation

    Hope this helps other users.

    Regards,

    Girish

    2 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. SaiKishor-MSFT 17,236 Reputation points
    2020-11-11T23:04:36.373+00:00

    @Girish Prajwal

    In general, network security groups associated with a subnet are cloned as part of the migration to the Resource Manager deployment model. The NSG in the classic deployment model is not removed during the migration. However, the management-plane operations for the NSG are blocked when the migration is in progress. Unassociated NSGs can be migrated using Move-AzureNetworkSecurityGroup.

    This is the usual process. Do you still want to export/import it via excel? Please let me know. Thank you!

    1 person found this answer helpful.

  2. Kevin Virani 21 Reputation points
    2022-10-05T19:39:16.807+00:00

    You can use Effective Security Rules in NSG to download rules. Super Simple.

    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.