Skip to content

Key management API

Paul Batum edited this page Oct 9, 2018 · 3 revisions

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

Response:

{
  "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"
    }
  ]
}

Function key resource: admin/functions/{functionname}/keys/{keyname}

PUT

Creates or updates the key at the specified resource

Request:

PUT /admin/functions/{functionname}/keys/{keyname}

{
  "name": "keyname",
  "value" : "keyvalue"
}

Response:

HTTP Status: 200 or 201 if created

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

POST

Creates or updates the key at the specified resource with an auto generated key

Request:

POST /admin/functions/{functionname}/keys/{keyname}

Response:

HTTP Status: 200 or 201 if created

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

DELETE

Deletes the key identified by the URI

Request:

DELETE /admin/functions/{functionname}/keys/{keyname}

Response:

HTTP Status: 204

Host keys collection resource: admin/host/keys

The host keys collection resource exposes the same APIs as the function keys collection resource.

Note: The master key is not returned on a GET request

Host key resource: admin/host/keys/{keyname}

The host key resource exposes the same APIs as the function keys collection resource.

Note: The master key is exposed under the reserved name _master and DELETE is not supported

Learn

Azure Functions Basics

Advanced Concepts

Dotnet Functions

Java Functions

Node.js Functions

Python Functions

Host API's

Bindings

V2 Runtime

Contribute

Functions host

Language workers

Get Help

Other

Clone this wiki locally