Closed madhukargilla closed 2 years ago
Hi @madhukargilla
We unfortunately don't have a Python sample right now. I will create a task for that and keep this issue open until it's done. Thank you,
If this could help, I got it working like this somehow:
Assumes RG1 with VNET1 and RG2 with VNET21 There's a VPN gateway in VNET2 for which we'll allow traffic from VNET1
from azure.mgmt.network import NetworkManagementClient
from azure.mgmt.network.models import SubResource
from azure.mgmt.network.models import VirtualNetworkPeering
from azure.mgmt.resource import ResourceManagementClient
res1 = resource_client.resources.get("rg1", "Microsoft.Network", "", "virtualNetworks", "vnet1", "2017-06-01")
res2 = resource_client.resources.get("rg2", "Microsoft.Network", "", "virtualNetworks", "vnet2", "2017-06-01")
subres1 = SubResource(id=res1.id)
subres2 = SubResource(id=res2.id)
peering_params1 = VirtualNetworkPeering(allow_virtual_network_access=True, use_remote_gateways=True, remote_virtual_network=subres1)
peering_params2 = VirtualNetworkPeering(allow_virtual_network_access=True, use_remote_gateways=False, allow_gateway_transit=True, remote_virtual_network=subres2)
poller1 = network_client.virtual_network_peerings.create_or_update("rg2", "vnet2", "rg2-rg1-peering", peering_params1)
poller2 = network_client.virtual_network_peerings.create_or_update("rg1", "vnet1", "rg1-rg2-peering", peering_params2)
Thanks @ecgg !
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @aznetsuppgithub.
@madhukargilla could you check if this works for you?
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
Hi @madhukargilla. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve
” to remove the “issue-addressed” label and continue the conversation.
Hi @madhukargilla, since you haven’t asked that we “/unresolve
” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve
” to reopen the issue.
HI,
Can you point us to a Vnet peering example, using the Python SDK please.
Thanks