在什么情况下,azure function 的 authorization key 会发生变化?

In which case, authorization key of azure function will change?

我正在使用 http 触发器处理我的第一个 Azure 函数。代码存储在 TFS 中,我们的发布团队将使用章鱼部署它。 我的问题是在什么情况下,azure function 的 authorization key 会改变? 删除功能应用程序?删除功能?还有其他情况吗?

谢谢, 韦斯

my question is in which situation, authorization key of azure function will change? remove function app? delete function? any other case?

如果您提到授权密钥是http触发器的授权代码。 http tigger 功能有两种类型的密钥(API 密钥和主密钥)。

API 键:

  • Function App Level keys means that all of specific function are the same for the current app. (Unless delete the function app, the key will changed/not exist)

  • Function level keys apply to the specific functions(Delete the specific functions, it will change)


  • Host: Also commonly referred to as Function App Level keys. Keys defined at this level apply to the entire Function App. You have the ability to define Function Keys at this level, and they would allow clients to authenticate against any function. This is also where your Master Key is defined.

  • Function: Function level keys apply to the specific functions they're defined under, restricting its use for authentication to that function only.

主密钥:

The master key provides administrative access to the runtime APIs. You should exercise care if you choose to use the Admin authorization level for your functions as we do not recommend redistributing the master key.

我们也可以使用 Rest API to change the key. For more information about Http trigger function, please refer to this document.