[英]Authenticate Azure Functions
I am using a HTTP Function App, I would like to authenticate it using client id and function keys (inside my function) using python .我正在使用 HTTP Function 应用程序,我想使用客户端 ID和function 密钥(在我的函数内)使用python对其进行身份验证。
I have a API Management setup for the current service but would like to authenticate on function app level.我有当前服务的 API 管理设置,但想在 function 应用程序级别进行身份验证。
Thanks谢谢
For this one of the workaround is that you can set its Authorization level to Function.对于此解决方法之一,您可以将其授权级别设置为 Function。
Note: Make sure you are providing function key as a URL query string parameter in code property (ie, https://< Your Function App>.azurewebsites.net/api/< Your Function Name>?code=< Your Function Key>
) .注意:确保您在代码属性中提供 function 键作为 URL 查询字符串参数(即
https://< Your Function App>.azurewebsites.net/api/< Your Function Name>?code=< Your Function Key>
) 。 Alternatively, If you are calling function from postman you can just add x-functions-key
header and set function key to it.或者,如果您从 postman 调用 function,您只需添加
x-functions-key
header 并为其设置 function 键。
You can find all the function keys from Trigger >> Function Keys您可以从Trigger >> Function Keys中找到所有 function 键
but from the Official Documention you can see that it is not a good practice to distribute shared secret in public apps.但从官方文档可以看出,在公共应用程序中分发共享密钥并不是一个好的做法。
If your function is being called from a public client, you may want to consider implementing another security mechanism
如果您的 function 是从公共客户端调用的,您可能需要考虑实施另一种安全机制
Alternatively, you can use AAD to authenticate your Function App (ie, Through App registration).或者,您可以使用 AAD 来验证您的 Function 应用程序(即,通过应用程序注册)。 For more information, you can refer Azure Function authentication using Azure Active Directory
有关更多信息,您可以参考Azure Function 使用 Azure Active Directory 进行身份验证
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.