PowerShell script exchange
Post Reply
gjg_allegis
Novice
Posts: 4
Liked: 1 time
Joined: Nov 25, 2020 6:23 pm
Contact:

Restore to Azure with no NSG

Post by gjg_allegis »

Does anyone know if there is a way to do a restore to Azure in the PowerShell console, and not associate a network security group? So far I've had to do the restore with an NSG, then use the Az module to disassocate the NSG. We have a large number of restores to do and it would save time if we could skip that second step. Thanks.

jhoughes
Veeam Software
Posts: 228
Liked: 78 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: Restore to Azure with no NSG

Post by jhoughes »

The 'NetworkSecurityGroup' parameter is optional, it is not required for a restore to Azure using PowerShell.

You can see this in the examples on the cmdlet documentation page, or also in other demos that we have done in the past.
Husband, Father, Solutions Architect, Geek Extraordinaire | @AustinVMUG & @ATXPowerShell leader | VMUG US South Regional Champion | VMware vExpert | Cisco Champion

gjg_allegis
Novice
Posts: 4
Liked: 1 time
Joined: Nov 25, 2020 6:23 pm
Contact:

Re: Restore to Azure with no NSG

Post by gjg_allegis » 1 person likes this post

Thanks for the quick reply, but without specifying the parameter, one is still created and associated with the netowrk interface. What we want is an interface without any assocated NSG. So for example, with no "NetworkSecurityGroup" parameter, the restore does this:

AzureVM Name = "restoredvm01"
NetworkSecurityGroup = "restoredvm01netsecuritygroup"

We are going to use NSG's at the subnet level, and do not want one associated with any of the VM interfaces.

veremin
Product Manager
Posts: 18024
Liked: 1722 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Restore to Azure with no NSG

Post by veremin »

Correct, if you do not specify a network security group, backup server will automatically create a new one, allow RDP and SSH on it and connect network interfaces to it, this is done to guarantee that restored VM is accessible.

Currently, there is no way to bypass this behaviour, but thank you for your feedback, it's been taken into account.

gjg_allegis
Novice
Posts: 4
Liked: 1 time
Joined: Nov 25, 2020 6:23 pm
Contact:

Re: Restore to Azure with no NSG

Post by gjg_allegis »

OK, thanks very much. We'll stick with using the Az module to dis-associate the NSG after restore completes.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests