Skip to content Skip to sidebar Skip to footer

Attaching Nsg To Subnet Using Python

I'm trying to create NSG and then attach it to a existing subnet. I've successfully able to create the NSG but it throws an error while attaching it to subnet. Stating that the add

Solution 1:

that means you are not passing it the address prefix it should use. According to the docs you need to pass in address_prefix parameter. so add it to your params_create, something like this:

params_create = Subnet(
    address_prefix = "10.0.0.0/24",
    network_security_group = azure.mgmt.network.models.NetworkSecurityGroup(xxx)
)

Post a Comment for "Attaching Nsg To Subnet Using Python"