【发布时间】:2019-01-16 07:59:42
【问题描述】:
当我在脚本块中使用此 cmdlet 时,我不断收到此错误
Cannot parse the request.
StatusCode: 400
ReasonPhrase: Bad Request
OperationID : '2410b534-3ab9-4c82-b0fa-233e5a36e795'
+ CategoryInfo : CloseError: (:) [Set-AzureRmRouteTable], NetworkCloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Network.SetAzureRouteTableCommand
+ PSComputerName : localhost
对我来说毫无意义。每次我搜索此错误时,它都会引用与网络相关的 cmdlet。
$addConfigBlock = {
Param(
$udr,
$routeTableName,
$routeTableRG
)
$routeTable = Get-AzureRmRouteTable -ResourceGroupName $routeTableRG -Name $routeTableName
try{
Add-AzureRmRouteConfig -RouteTable $routeTable `
-Name $udr.Name `
-AddressPrefix $udr.properties.addressPrefix `
-NextHopType $udr.properties.nextHopType | `
Set-AzureRmRouteTable | Out-Null
}
catch {
$ErrorMessage = $_.Exception.Message
Write-Output "$ErrorMessage"
}
}
foreach( $routeTable in $routeTablesToUpdate){
Write-Output "Updating routes in route table : $($routeTable.Name) ..."
ForEach($udr in $udrGov){
Start-Job -ScriptBlock $addConfigBlock -ArgumentList $udr, $routeTable.Name, $routeTable.ResourceGroupName
}
}
一些新的配置被添加到我的路由表中,但出现了一些错误。嗯..
新错误 -
A retryable error occurred.
StatusCode: 429
ReasonPhrase:
OperationID : '927995e6-da07-4f99-bbf3-6dd59e7c3183'
+ CategoryInfo : CloseError: (:) [Set-AzureRmRouteTable], NetworkCloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Network.SetAzureRouteTableCommand
+ PSComputerName : localhost
【问题讨论】:
-
提供完整的 powershell 命令可能会有所帮助。
-
更新了!对不起。
-
我测试了你的命令,它在我这边运行良好。如果我使用现有的
addressPrefix,我会收到错误的请求错误。你可以检查一下。 -
嗯,所以我实际上得到了一个长长的地址列表(天蓝色的 govarizona 和 virgina),其中一些有效......我得到了 5/20 的更新......所以我我不确定它是否与工作有关..?重叠??
-
另外,你的命令中的
$udr表示route,但udr是azure路由表的简写,我建议你改一下,以免产生歧义。
标签: azure powershell azure-virtual-network powershell-jobs