将NAT与子网相关联的是子网络网络误差错误

发布于 2025-01-21 22:27:45 字数 1277 浏览 5 评论 0原文

我创建了一个 nat Gateway ,并且有一个现有的 vnet ,该具有 subnet 。我的功能应用程序已经具有VNET集成。我想整合到现有VNET 的NAT网关。所有功能应用程序,NAT,VNET和子网都在同一资源组中。

我的子网有一个子网委托给 microsoft.web/serverfarms

现在,当我尝试使用以下代码来集成到子网的NAT网关时,

$virtualNetwork = Get-AzVirtualNetwork -ResourceGroupName $ResourceGroupName
Set-AzVirtualNetworkSubnetConfig -Name $virtualNetwork.Subnets.Name -AddressPrefix $virtualNetwork.Subnets.AddressPrefix -VirtualNetwork $virtualNetwork -InputObject $natGateway
$virtualNetwork | Set-AzVirtualNetwork

我会收到以下错误,

Set-AzVirtualNetwork : Subnet
/subscriptions/6acxxxxx-xxxxxxxxxxxxxxx/resourceGroups/ResouceGroupName/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/Subnet1 requires any of the
following delegation(s) [Microsoft.Web/serverFarms] to reference service association link /subscriptions/6acxxxxx-xxxxxxxxxxxxxxx/resourceGroups/ResouceGroupName/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/Subnet1/serviceAssociationLinks/AppServiceLink.
StatusCode: 400
ReasonPhrase: Bad Request
ErrorCode: SubnetMissingRequiredDelegation

但我的VNET已经具有所需的委派,名称 Microsoft.web/serverfarms 。如何解决此错误?

I have created a NAT gateway and I have an existing vnet which has an subnet. My function app already has a vnet integration. I want to integrate the nat gateway to the existing vnet. All the function app, NAT, vnet and the subnet are in the same resource group.

My subnet has a subnet delegation to Microsoft.Web/serverFarms.

Now when I try to integrate the NAT gateway to the subnet using below code

$virtualNetwork = Get-AzVirtualNetwork -ResourceGroupName $ResourceGroupName
Set-AzVirtualNetworkSubnetConfig -Name $virtualNetwork.Subnets.Name -AddressPrefix $virtualNetwork.Subnets.AddressPrefix -VirtualNetwork $virtualNetwork -InputObject $natGateway
$virtualNetwork | Set-AzVirtualNetwork

I am getting the below error saying

Set-AzVirtualNetwork : Subnet
/subscriptions/6acxxxxx-xxxxxxxxxxxxxxx/resourceGroups/ResouceGroupName/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/Subnet1 requires any of the
following delegation(s) [Microsoft.Web/serverFarms] to reference service association link /subscriptions/6acxxxxx-xxxxxxxxxxxxxxx/resourceGroups/ResouceGroupName/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/Subnet1/serviceAssociationLinks/AppServiceLink.
StatusCode: 400
ReasonPhrase: Bad Request
ErrorCode: SubnetMissingRequiredDelegation

But my vnet already has the required delegation with name Microsoft.Web/serverfarms. How to fix this error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不寐倦长更 2025-01-28 22:27:45

我尝试了以下PowerShell cmdlet以设置natgatewaysubnet中。 >只有没有错误。我还使用PowerShell版本5.x和7.x以及运行此CMDLET。

< img src =“ https://i.sstatic.net/tcu3p.png” alt =“在此处输入图像说明”>

  $ResourceGroupName="v-XXXX-XXX"
    $natGateway=Get-AzNatGateway -ResourceGroupName "v-XXXX-XXX" -Name "TestNatGateway"
    $virtualNetwork = Get-AzVirtualNetwork -ResourceGroupName $ResourceGroupName
    Set-AzVirtualNetworkSubnetConfig -Name $virtualNetwork.Subnets.Name -AddressPrefix $virtualNetwork.Subnets.AddressPrefix -VirtualNetwork $virtualNetwork -NatGateway $natGateway
    $virtualNetwork | Set-AzVirtualNetwork

警告:CMDLET的即将发生的破坏变化
'set-azvirtualnetworksubnetconfig':更新属性名称cmdlet
调用更改:
旧方式: - 储藏
新方法:-NatgateWayID Update propert属性名称CMDLET调用更改:
旧方法:-InputObject
新方法:-natgateway注意:转到 https://aka.ms/azms/azps/azps-changewarnings 压制这个破裂
更改警告以及有关破坏Azure变化的其他信息
powershell。

即使我已经使用-natgateway而不是-InputObject我得到了相同的警告,并且natgateway无法将其设置为子网。

似乎他们正在破坏set-azvirtualnetworksubnetconfig中的更改或错误。因此,这可能是它无法正常工作的原因。 powerShell/essess?q = set-azvirtualnetworksubnetConfig“ rel =“ nofollow noreferrer”> link

到子网。使用门户网站正常工作。

I tried with this below powershell cmdlet to set NatGateway in a subnet.But i am getting a warning only without error. I am using powershell version 5.x and 7.x as well to run this cmdlet.

enter image description here

  $ResourceGroupName="v-XXXX-XXX"
    $natGateway=Get-AzNatGateway -ResourceGroupName "v-XXXX-XXX" -Name "TestNatGateway"
    $virtualNetwork = Get-AzVirtualNetwork -ResourceGroupName $ResourceGroupName
    Set-AzVirtualNetworkSubnetConfig -Name $virtualNetwork.Subnets.Name -AddressPrefix $virtualNetwork.Subnets.AddressPrefix -VirtualNetwork $virtualNetwork -NatGateway $natGateway
    $virtualNetwork | Set-AzVirtualNetwork

WARNING: Upcoming breaking changes in the cmdlet
'Set-AzVirtualNetworkSubnetConfig' : Update Property Name Cmdlet
invocation changes :
Old Way : -ResourceId
New Way : -NatGatewayId Update Property Name Cmdlet invocation changes :
Old Way : -InputObject
New Way : -NatGateway Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking
change warning, and other information on breaking changes in Azure
PowerShell.

Even though i have used -NatGateway instead of -InputObject i am getting the same warning and Natgateway is not able to set to the subnet.

Seems their is breaking changes or bug in Set-AzVirtualNetworkSubnetConfig. So this may be the reason it is not working as expected.You can check many bug has reported regarding Set-AzVirtualNetworkSubnetConfig using this Link

So for workaorund please use portal only to set Nat Gatway to the subnet. using portal it is working fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文