{
"ExternalServices": [
{
"Name": "ExternalSimple-Test",
"Url": "",
"ClientId": "myAzureClientId",
"Scopes": [
"myAzureScope"
]
},
...
]}
您可以利用Consul的DNS接口。这种方法允许您的微服务在运行时通过 DNS 查询解析服务地址和端口。在 nomad 作业规范中放置 env:
env {
SERVICE_B_URL = "http://service-b.service.consul:PORT"
}
参考资料:https://developer.hashicorp.com/consul/docs/services/discovery/dns-overview