简体   繁体   English

认证 Azure 功能

[英]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 应用程序,我想使用客户端 IDfunction 密钥(在我的函数内)使用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.

相关问题 pip 在 azure 管道中安装 azure-functions 失败,执行 pip 身份验证任务 - pip install azure-functions in azure pipeline fails with pip authenticate task Azure 管道 - 在 powershell 中验证 git - Azure Pipelines - authenticate git in powershell 从 azure 中的 Dockerfile 向私人 npm 注册表进行身份验证? - Authenticate to private npm registry from Dockerfile in azure? 为什么我无法在 Azure 中验证应用程序 - Why I cannot authenticate an app in Azure Azure 函数和队列 - Azure Functions and queues 如何使用应用程序 ID(服务主体)的令牌向 Azure Devops 进行身份验证? - How to authenticate to Azure Devops by using token of an Application ID(service principal)? 在本地运行多个 Azure 函数 - Running multiple Azure Functions locally 使用 Nestjs + Azure 函数配置 swagger - Configure swagger with Nestjs + Azure functions 获取 swagger 以使用 Azure AD + spring 启动配置进行身份验证 - Get swagger to authenticate with Azure AD + spring boot configuration Azure 函数 Azurite 404 BlobNotFound - Azure Functions Azurite 404 BlobNotFound
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM