我和我的同事有Azure帐户(使用BizSpark计划)。我们都在每个中创建了VNets和一些虚拟机。现在,他想访问我创建的一些虚拟机,因此我们尝试在这些帐户之间设置VNet对等。有可能吗?
PS:我们尝试使用VNet对等选项,因为VPN成本很高。
更多信息:
PPS:跟随 the tutorial
时更多信息我有两个订阅:
Sub1:
SubscriptionName:Visual Studio Enterprise:BizSpark
SubscriptionId:79409421-0edc-40c5-a55b-4ef3ccfb0d53
TenantId:b726dcac-a1f2-420b-8713-cbee132aa6cc
用户登录ID:aaaa@example.com
VNet名称:vnet1
资源组:newRG
Sub2:
SubscriptionName:Visual Studio Enterprise:BizSpark
SubscriptionId:3a97ecb8-5b69-4f7b-a46b-a678eb05ae00
TenantId:88cc20a7-90cf-4854-9201-6f1424ebf7fa
用户登录ID:bbbb@example.com
VNet名称:vnet2
资源组:newRG
我打开了两个Powershell窗口并按如下方式运行命令
Task<bar2.GetType()>
当我运行上面的命令时,我得到的错误是
Login-AzureRmAccount ( logged in with aaaa@example.com )
Get-AzureRmSubscription
Select-AzureRmSubscription -SubscriptionId "79409421-0edc-40c5-a55b-4ef3ccfb0d53"
New-AzureRmRoleAssignment -SignInName "bbbb@example.com" -RoleDefinitionName "Network Contributor" -Scope /subscriptions/79409421-0edc-40c5-a55b-4ef3ccfb0d53/resourceGroups/newRG/providers/Microsoft.Network/VirtualNetworks/vnet2
然后当我运行命令
New-AzureRmRoleAssignment : The provided information does not map to an AD object id.
At line:1 char:1
+ New-AzureRmRoleAssignment -SignInName "bbbb@example.com" -RoleDefi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureRmRoleAssignment], KeyNotFoundException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.NewAzureRoleAssignmentCommand
错误是
$vnet1 = Get-AzureRmVirtualNetwork -ResourceGroupName newRG -Name vnet1
Add-AzureRmVirtualNetworkPeering -name LinkTovnet2 -VirtualNetwork $vnet1 -RemoteVirtualNetworkId "/subscriptions/3a97ecb8-5b69-4f7b-a46b-a678eb05ae00/resourceGroups/newRG/providers/Microsoft.Network/virtualNetworks/vnet2" -BlockVirtualNetworkAccess
Add-AzureRmVirtualNetworkPeering : The client has permission to perform action 'Microsoft.Network/virtualNetworks/peer/action' on scope '/subscriptions/79409421-0edc-40c5-a55b-4ef3ccfb0d53/resourceGroups/newRG/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/LinkTovnet2', however the linked subscription '3a97ecb8-5b69-4f7b-a46b-a678eb05ae00'is not in current tenant 'b726dcac-a1f2-420b-8713-cbee132aa6cc'.
StatusCode: 403
ReasonPhrase: Forbidden
OperationID : 'a2e1807b-df0d-4ef5-b832-a166a781bfbe'
At line:1 char:1
+ Add-AzureRmVirtualNetworkPeering -name LinkTovnet2 -VirtualNet ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Add-AzureRmVirtualNetworkPeering], NetworkCloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Network.AddAzureVirtualNetworkPeeringCommand
当我运行上面的命令时,得到与上面相同的错误
答案 0 :(得分:1)
是的,“只要两个订阅的特权用户授权对等并且订阅与同一个Active Directory租户相关联,就可以在两个不同订阅中的虚拟网络之间建立对等。”
我在下面链接的页面上还有一些其他警告,例如。你不能有重叠的IP地址范围。