我有一个带有 staticwebapp.config.json 的 Azure 静态 Web 应用程序,如下所示:
"routes": [
{
"route": "/*",
"allowedRoles": ["authenticated"]
}
]
"navigationFallback": {
"rewrite": "index.html",
"exclude": ["/static/media/*.{png,jpg,gif,svg}", "/static/css/*"]
}
这有效,所有路由都需要经过身份验证。现在,我想向
/health
路由添加一个例外,以允许运行状况检查服务来查看我的网站是否已启动并运行。我怎样才能做到这一点?我尝试添加这样的路线:
"routes": [
{
"route": "/health",
"allowedRoles": ["anonymous"]
},
{
"route": "/*",
"allowedRoles": ["authenticated"]
}
]
"navigationFallback": {
"rewrite": "index.html",
"exclude": ["/static/media/*.{png,jpg,gif,svg}", "/static/css/*"]
}
但这不起作用,
/health
路由仍然需要身份验证。