小编Nor*_*Rad的帖子

ARM 模板,不正确的段长度

我正在尝试构建一个 ARM 模板并不断收到错误消息:

'The template resource 'udr-sub-w05-w05-w05-agw-10.10.10.32/27' for type 
'Microsoft.Network/routeTables' at line '141' and column '5' has incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root resource type must 
have segment length one greater than its resource name.
Run Code Online (Sandbox Code Playgroud)

创建路由表代码的嵌套模板如下:

{
      "name": "[variables('routeTable1')]",
      "type": "Microsoft.Network/routeTables",
      "apiVersion": "[variables('routeTableApiVersion')]",
      "location": "[resourceGroup().location]",
      "properties": {
        "routes": [
        ],
        "disableBgpRoutePropagation": false
      }
    },
    {
      "name": "[variables('routeTable2')]",
      "type": "Microsoft.Network/routeTables",
      "apiVersion": "[variables('routeTableApiVersion')]",
      "location": "[resourceGroup().location]",
      "properties": {
        "routes": [ …
Run Code Online (Sandbox Code Playgroud)

azure azure-resource-manager azure-rm-template azure-template

5
推荐指数
1
解决办法
2584
查看次数

重新部署到不同区域时出现 Azure 错误

我最近错误地部署到了 WestEurope,我删除了资源并认为我可以重新部署到 UKSouth,但是每当我尝试重新部署时都会收到以下错误:

 - At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details. (Code: DeploymentFailed)
   - {
  "error": {
    "code": "InvalidDeploymentLocation",
    "message": "Invalid deployment location 'uk south'. The deployment already exists in location 'westeurope'."
  }
} (Code:Conflict)
CorrelationId: 8c2a4cd6-4409-46c3-9b7c-544134f0f942
Run Code Online (Sandbox Code Playgroud)

主模板调用多个嵌套模板,我在尝试确定问题所在时遇到困难。我已经检查过,任何地方都没有启用软删除,而且资源也肯定已从 Azure 中删除。

帮助..

提前致谢 :)

powershell json azure

4
推荐指数
1
解决办法
2963
查看次数

有关Path变量的if语句-Powershell-正确/错误测试

基本上,我想检查目录是否存在,如果没有退出,请运行此部分。

我的脚本是:

$Path = Test-Path  c:\temp\First

if ($Path -eq "False")
{
  Write-Host "notthere" -ForegroundColor Yellow
}
elseif ($Path -eq "true")
{
  Write-Host " what the smokes"
}
Run Code Online (Sandbox Code Playgroud)

但是它什么也没返回。

powershell conditional boolean

2
推荐指数
1
解决办法
910
查看次数