I am attempting to configure the VNET of an app service. I am attempting to do this via a powershell script. I have been using the same powershell script for over a year and it has suddenly stopped working without any modifications to the script. The link that is failing is as follows:
$propertiesObject = @{
"vnetResourceId" = "/subscriptions/$($subscriptionId)/resourceGroups/$($vnetToaddResGroup)/providers/Microsoft.Network/virtualNetworks/$($vnetToAdd)"
}
New-AzureRmResource -Location $location -Properties $propertiesObject -ResourceName "$($WebApp)/$($vnetToAdd)/primary" -ResourceType "Microsoft.Web/sites/virtualNetworkConnections/gateways" -ApiVersion 2015-08-01 -ResourceGroupName $WebAppResourceGroup -Force
This then results in the following error:
New-AzureRmResource : {"Code":"NotFound","Message":"Cannot find Vnet with name
VNet-EUDEV02.","Target":null,"Details":[{"Message":"Cannot find Vnet with name
VNet-EUDEV02."},{"Code":"NotFound"},{"ErrorEntity":{"ExtendedCode":"51004","MessageTemplate":"Cannot find {0} with
name {1}.","Parameters":["Vnet","VNet-EUDEV02"],"Code":"NotFound","Message":"Cannot find Vnet with name
VNet-EUDEV02."}}],"Innererror":null}
At C:UsersAndreDesktopReposdevops-scriptingandre-script-remakeclusterswap.ps1:66 char:5
+ New-AzureRmResource -Location $location -Properties $propertiesOb ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureRmResource], ErrorResponseMessageException
+ FullyQualifiedErrorId : NotFound,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourc
eCmdlet
This is strange as I have checked the VNET exists, and also checked the the resource group, and have tried numerous other Vnets.
How can I add VNet integration via a powershell command using azureRM?
question from:
https://stackoverflow.com/questions/65877742/vnet-not-found-when-attempting-to-create-vnet-integration-via-azurerm 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…