Azure website resource template error

后端 未结 5 1874
醉话见心
醉话见心 2021-01-01 09:52

I\'m attempting to use the AzureResourceManager PowerShell module to create and configure a website. I started with a template file generated by Visual Studio, which works

5条回答
  •  遥遥无期
    2021-01-01 10:18

    The 'incorrect segment lengths' error message is difficult to understand for non-English native so there's explanation in plain English/json: For example, you have a resource of type Microsoft.Network/trafficManagerProfiles resource and for some reason you need to define nested resource having type Microsoft.Network/trafficManagerProfiles/ExternalEndpoints as a separate resource.

    The nested resource must have name parent_resource_name/nested_res_name

    The correct (simplified) schema is:

    {
      "type": "Microsoft.Network/trafficManagerProfiles",
      "name": "[variables('trafManagerProfileName')]",
       ...
    },
    {
      "type": "Microsoft.Network/trafficManagerProfiles/ExternalEndpoints",
      "name": "[concat(variables('trafManagerProfileName'), '/Endpoint', copyIndex())]",
      "dependsOn": [
        "[concat('Microsoft.Network/trafficManagerProfiles/', variables('trafManagerProfileName'))]",
        "[parameters('app_name')]" # where the endpoint should look at
      ],
       ...
    }
    

    p.s. you might be interested in this question as well if you need to generate nested resources dynamically based on count of third resource: How do I dynamically generate Traffic Manager endpoints in an ARM template?

提交回复
热议问题