You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/function-keys-how-to.md
+23-23Lines changed: 23 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,10 @@ Azure Functions lets you use secret keys to make it more difficult to access you
14
14
15
15
While access keys provide some mitigation against unwanted access, you should consider other options to secure HTTP endpoints in production. For example, it's not a good practice to distribute shared secrets in a public app. If your function is being called from a public client, you should consider implementing these or other security mechanisms:
16
16
17
-
+[Enable App Service Authentication/Authorization](security-concepts.md#enable-app-service-authenticationauthorization)
18
-
+[Use Azure API Management (APIM) to authenticate requests](security-concepts.md#use-azure-api-management-apim-to-authenticate-requests)
19
-
+[Deploy your function app to a virtual network](security-concepts.md#deploy-your-function-app-to-a-virtual-network)
20
-
+[Deploy your function app in isolation](security-concepts.md#deploy-your-function-app-in-isolation)
17
+
-[Enable App Service Authentication/Authorization](security-concepts.md#enable-app-service-authenticationauthorization)
18
+
-[Use Azure API Management (APIM) to authenticate requests](security-concepts.md#use-azure-api-management-apim-to-authenticate-requests)
19
+
-[Deploy your function app to a virtual network](security-concepts.md#deploy-your-function-app-to-a-virtual-network)
20
+
-[Deploy your function app in isolation](security-concepts.md#deploy-your-function-app-in-isolation)
21
21
22
22
Access keys provide the basis for HTTP authorization in HTTP triggered functions. For more information, see [Authorization level](./functions-bindings-http-webhook-trigger.md#http-auth).
23
23
@@ -30,7 +30,7 @@ The scope of an access key and the actions it supports depend on the type of acc
30
30
|**Function**|`default` or user defined |`function`| Allows access only to a specific function endpoint. |
31
31
|**Host**|`default` or user defined |`function`| Allows access to all function endpoints in a function app. |
32
32
|**Master**|`_master`|`admin`| Special host key that also provides administrative access to the runtime REST APIs in a function app. Because the master key grants elevated permissions in your function app, you shouldn't share this key with third parties or distribute it in native client applications. |
33
-
|**System**| Depends on the extension | n/a | Specific extensions might require a system-managed key to access webhook endpoints. System keys are designed for extension-specific function endpoints that get called by internal components. For example, the [Event Grid trigger](functions-bindings-event-grid-trigger.md) requires that the subscription use a system key when calling the trigger endpoint. Durable Functions also uses system keys to call [Durable Task extension APIs](durable/durable-functions-http-api.md). <br/>System keys can only be created by specific extensions, and you can't explicitly set their values. Like other keys, you can generate a new value for the key from the portal or by using the key APIs. |
33
+
|**System**| Depends on the extension | n/a | Specific extensions might require a system-managed key to access webhook endpoints. System keys are designed for extension-specific function endpoints that get called by internal components. For example, the [Event Grid trigger](functions-bindings-event-grid-trigger.md) requires that the subscription use a system key when calling the trigger endpoint. Durable Functions also uses system keys to call [Durable Task extension APIs](durable/durable-functions-http-api.md). <br/>Only specific extenstions can create system keys. You can't explicitly set their values. Like other keys, you can generate a new value for the key from the portal or by using the key APIs. |
34
34
35
35
Each key is named for reference, and there's a default key (named `default`) at the function and host level. Function keys take precedence over host keys. When two keys are defined with the same name, the function key is always used.
36
36
@@ -50,7 +50,7 @@ The following table compares the uses for various kinds of access keys:
50
50
51
51
In Functions, access keys are randomly generated 32-byte arrays that are encoded as URL-safe base-64 strings. While you can generate your own access keys and use them with Functions, we strongly recommend that you instead allow Functions to generate all of your access keys for you.
52
52
53
-
Functions-generated access keys include special signature and checksum values that indicate the type of access key and that it was generated by Azure Functions. Having these extra components in the key itself makes it much easier to determine the source of these kinds of secrets located during security scanning and other automated processes.
53
+
Functions-generated access keys include special signature and checksum values that indicate the type of access key and that Azure Functions generated it. Having these extra components in the key itself makes it much easier to determine the source of these kinds of secrets located during security scanning and other automated processes.
54
54
55
55
To allow Functions to generate your keys for you, don't supply the key `value` to any of the APIs that you can use to generate keys.
56
56
@@ -65,7 +65,7 @@ Keys are stored as part of your function app in Azure and are encrypted at rest.
65
65
| File system |`files`| Keys are persisted on the local file system, which is the default in Functions v1.x. File system storage isn't recommended. |
66
66
| Kubernetes Secrets |`kubernetes`| The resource set in [AzureWebJobsKubernetesSecretName](functions-app-settings.md#azurewebjobskubernetessecretname) is used to store keys. Supported only when your function app is deployed to Kubernetes. The [Azure Functions Core Tools](functions-run-local.md) generates the values automatically when you use it to deploy your app to a Kubernetes cluster. [Immutable secrets](https://kubernetes.io/docs/concepts/configuration/secret/#secret-immutable) aren't supported |
67
67
68
-
When using Key Vault for key storage, the app settings you need depend on the managed identity type, either system-assigned or user-assigned.
68
+
When you use Key Vault for key storage, the app settings you need depend on the managed identity type, either system-assigned or user-assigned.
@@ -78,18 +78,18 @@ When using Key Vault for key storage, the app settings you need depend on the ma
78
78
79
79
## Use access keys
80
80
81
-
HTTP triggered functions can generally be called by using a URL in the format: `https://<APP_NAME>.azurewebsites.net/api/<FUNCTION_NAME>`. When the authorization level of a given function is set a value other than `anonymous`, you must also provide an access key in your request. The access key can either be provided in the URL using the `?code=` query string or in the request header (`x-functions-key`). For more information, see [Access key authorization](functions-bindings-http-webhook-trigger.md#api-key-authorization).
81
+
HTTP triggered functions can generally be called by using a URL in the format: `https://<APP_NAME>.azurewebsites.net/api/<FUNCTION_NAME>`. When the authorization level of a given function is set as a value other than `anonymous`, you must also provide an access key in your request. The access key can either be provided in the URL using the `?code=` query string or in the request header (`x-functions-key`). For more information, see [Access key authorization](functions-bindings-http-webhook-trigger.md#api-key-authorization).
82
82
83
83
To access the runtime REST APIs (under `/admin/`), you must provide the master key (`_master`) in the `x-functions-key` request header. You can [remove the admin endpoints](./security-concepts.md#disable-administrative-endpoints) using the `functionsRuntimeAdminIsolationEnabled` site property.
84
84
85
85
## Get your function access keys
86
86
87
87
You can get function and host keys programmatically by using these Azure Resource Manager APIs:
88
88
89
-
+[List Function Keys](/rest/api/appservice/webapps/listfunctionkeys)
0 commit comments