将NAT与子网相关联的是子网络网络误差错误
我创建了一个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我尝试了以下PowerShell cmdlet以设置
natgateway
在subnet
中。 >只有没有错误。我还使用PowerShell版本5.x和7.x以及运行此CMDLET。< img src =“ https://i.sstatic.net/tcu3p.png” alt =“在此处输入图像说明”>
即使我已经使用
-natgateway
而不是-InputObject
我得到了相同的警告,并且natgateway
无法将其设置为子网。似乎他们正在破坏
set-azvirtualnetworksubnetconfig
中的更改或错误。因此,这可能是它无法正常工作的原因。 powerShell/essess?q = set-azvirtualnetworksubnetConfig“ rel =“ nofollow noreferrer”> linkI tried with this below powershell cmdlet to set
NatGateway
in asubnet
.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.Even though i have used
-NatGateway
instead of-InputObject
i am getting the same warning andNatgateway
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 regardingSet-AzVirtualNetworkSubnetConfig
using this LinkSo for workaorund please use portal only to set Nat Gatway to the subnet. using portal it is working fine.