gpt4 book ai didi

Azure流量管理器ARM模板不会采用resourceTargetId

转载 作者:行者123 更新时间:2023-12-05 09:26:10 33 4
gpt4 key购买 nike

我尝试使用 ARM 模板部署流量管理器配置文件,但在部署时出现以下错误。我将资源 ID 引用为“resourceTargetId”。此外,当我从门户创建流量管理器配置文件时,它似乎适用于两个已部署的应用程序,并且没有显示任何错误。

错误

The 'resourceTargetId' property of endpoint 'Primarysite' is invalid or missing. The property must be specified only for the following endpoint types: AzureEndpoints, NestedEndpoints. You must have read access to the resource to which it refers.

ARM 模板


{
"$schema":"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion":"1.0.0.0",
"parameters":{
"DnsName":{
"type":"string"
},
"Name":{
"type":"String"
},
"RoutingMethod":{
"type":"String"
},
"Location":{
"type":"String"
}
},
"resources":[
{
"type":"Microsoft.Network/trafficmanagerprofiles",
"apiVersion":"2018-08-01",
"name":"[parameters('Name')]",
"location":"[parameters('Location')]",
"properties":{
"profileStatus":"Enabled",
"trafficRoutingMethod":"[parameters('RoutingMethod')]",
"dnsConfig":{
"relativeName":"[parameters('DnsName')]",
"ttl":30
},
"monitorConfig":{
"protocol":"HTTPS",
"port":443,
"path":"/",
"expectedStatusCodeRanges":[
{
"min":200,
"max":202
},
{
"min":301,
"max":302
}
]
},
"endpoints":[
{
"type":"Microsoft.Network/TrafficManagerProfiles/AzureEndpoints",
"name":"Primarysite",
"properties":{
"target":"https://website1.azurewebsites.net",
"resourceTargetId":"/subscriptions/xxxxxxxxx-xxxxx-xxxxx-xxxx-xxxxxxxxxxxxxxxx/resourceGroups/RGTest/providers/Microsoft.Web/sites/website1",
"endpointStatus":"Enabled",
"endpointLocation":"eastus"
}
},
{
"type":"Microsoft.Network/TrafficManagerProfiles/AzureEndpoints",
"name":"Secondarysite",
"properties":{
"target":"https://website2.azurewebsites.net",
"resourceTargetId":"/subscriptions/xxxxxxxxx-xxxxx-xxxxx-xxxx-xxxxxxxxxxxxxxxxx/resourceGroups/RGTest/providers/Microsoft.Web/sites/website2",
"endpointStatus":"Enabled",
"endpointLocation":"westus"
}
}
]
}
}
]
}

最佳答案

我不确定您从哪里获得问题中提到的 ARM 模板。但问题在于 ARM 模板中 EndpointProperties 属性的名称。属性名称应为“targetResourceId”,而不是“resourceTargetId”。

以下是 EndpointProperties 中支持的属性名称列表:

  • 自定义标题
  • 端点位置
  • 端点监控状态
  • 端点状态
  • 地理映射
  • minChildEndpoints
  • minChildEndpointsIPv4
  • minChildEndpointsIPv6
  • 优先
  • 子网
  • 目标
  • 目标资源ID
  • 体重

有关属性的更多信息可在以下 EndpointProperties 中找到。链接。

您还可以在以下 official azure quickstart templates 中找到示例流量管理器 ARM 模板。链接。

关于Azure流量管理器ARM模板不会采用resourceTargetId,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74160182/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com