通过YAML部署Azure Container Instance时租户复用部署问题
解决Azure容器实例(ACI)YAML部署失败问题
问题诊断
部署失败的核心原因是配置了dnsNameLabelReusePolicy但未指定dnsNameLabel字段。复用策略是针对DNS名称标签生效的,缺少这个关联字段会导致部署校验不通过。
修正后的YAML配置
添加dnsNameLabel字段(需保证该标签在目标区域内唯一),同时保留复用策略配置:
apiVersion: '2021-10-01' location: centralindia name: helloworldcontainer properties: containers: - name: helloworld properties: image: mcr.microsoft.com/azuredocs/aci-helloworld ports: - port: 80 protocol: TCP osType: Linux ipAddress: type: Public ports: - protocol: tcp port: '80' dnsNameLabel: helloworld-aci-centralindia # 替换为目标区域内唯一的标签名 dnsNameLabelReusePolicy: Default tags: {}
额外说明
dnsNameLabel必须在所选Azure区域内唯一,若重复会提示“DNS名称标签已被使用”,需更换名称dnsNameLabelReusePolicy的可选值包括Default(仅当原资源已删除时复用)和Unsecured(允许直接复用同区域内其他资源的标签)
内容的提问来源于stack exchange,提问作者Lakshman.S
相关产品推荐
相关产品推荐

