如何在python中读取my azure函数键

2024-05-19 15:19:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个python中的azure函数。我也在功能键中定义了键值

如何在python程序中读取此内容。我知道我可以在函数应用程序的配置中添加键值对。但我需要特定于函数的这些值

My azure函数基于python 3.7 enter image description here


Tags: 函数程序应用程序内容定义myazure键值
1条回答
网友
1楼 · 发布于 2024-05-19 15:19:57

从Microsoft documentation中,可以使用Key management APIs以编程方式获取函数键

Key management API

The Functions Runtime exposes a management API that enables consumers to programmatically add, delete, and update function keys.

Since this API is exposed by the runtime, the base URL is: https://<functionappname>.azurewebsites.net/

Function keys collection resource: admin/functions/{functionname}/keys

GET Retrieves the function keys

Request:

GET /admin/functions/{functionname}/keys

回应

{
  "keys": [
    {
      "name": "keyname",
      "value": "keyvalue",
      "links": [
        {
          "rel": "self",
          "href": "https://baseuri/admin/functions/{functionname}/keys/{keyname}"
        }
      ]
    }
  ],
  "links": [
    {
      "rel": "self",
      "href": "http://baseuri/admin/functions/{functionname}/keys"
    }
  ]
}

相关问题 更多 >