使用Azure CLI配置Azure Front Door:添加多自定义域路由遇问题
解决Azure CLI配置AFD路由添加多自定义域失败的问题
修正参数格式:Azure CLI中
--custom-domains参数的多值输入要求用逗号分隔,而非空格。你之前用空格分隔两个域ID会导致CLI解析错误,正确写法如下:--custom-domains "$afd_custom_domain_1,$afd_custom_domain_2"完整命令示例:把修正后的参数带入创建路由的完整命令(替换占位符为你的实际资源信息):
az afd route create \ --resource-group your-resource-group-name \ --profile-name your-afd-profile-name \ --endpoint-name your-afd-endpoint-name \ --route-name your-route-name \ --custom-domains "$afd_custom_domain_1,$afd_custom_domain_2" \ --origin-group your-origin-group-name \ --supported-protocols Http Https \ --forwarding-protocol HttpsOnly \ --https-redirect Enabled额外检查项:
- 确保两个自定义域已成功关联到你的AFD配置文件,且完成了DNS验证和HTTPS证书配置(如果启用HTTPS)
- 检查Azure CLI版本是否为最新,旧版本可能存在参数解析bug,运行
az upgrade完成升级
内容的提问来源于stack exchange,提问作者Herald Gjura
相关产品推荐
相关产品推荐

