Azure AD身份验证 [英] Azure AD Authentication
问题描述
您好
我有一个带有Azure AD身份验证设置的功能应用...但是对于一个端点,我想要禁用身份验证(或使用其他类型的身份验证:密钥和身份验证)是否可能,或者我是否必须为此一个端点部署另一个没有
身份验证的功能应用程序?
请告知
/Søren
您可以尝试授权规则。
对于您的方案,启用身份验证/授权并允许在门户中进行匿名访问。接下来,您需要创建一个authorization.json
在您网站的根目录中输入
并定义两个路线:
在根位置禁用匿名访问。
启用匿名函数URL的匿名访问。
authorization.json{
" routes":[{
" path_prefix":" /" ;,
" policies":{" unauthenticated_action":" ; RedirectToLoginPage"}
},{
" path_prefix":" / api / HttpTrigger1",
" policies":{" unauthenticated_action":" AllowAnonymous"}
}]
}
注意: 确保在启用身份验证/授权
并在wwwroot文件夹中添加authorization.json文件后停止/启动功能应用程序。
Hi
I have a function app with Azure AD authentication setup... however for one endpoint I'd like to disable the authentication (or use some other kind of authentication: key and id) Is that somehow possible, or do I have to deploy another function app without authentication for this one endpoint?
Please advise
/Søren
You can try Authorization Rules.
For your scenario, Enable the Authentication/Authorization and allow anonymous access in the portal. Next, you'll want to create an
authorization.json
file in the root of your site and define two routes:
- Disable anonymous access at the root.
- Enable anonymous access for the anonymous function URL.
authorization.json
{ "routes": [{ "path_prefix": "/", "policies": { "unauthenticated_action": "RedirectToLoginPage" } },{ "path_prefix": "/api/HttpTrigger1", "policies": { "unauthenticated_action": "AllowAnonymous" } }] }
NOTE: Make sure to Stop/Start Function App after enabling the Authentication/Authorization and adding the authorization.json file at wwwroot folder.
这篇关于Azure AD身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!