Azure Functions 4
Last reviewed Sep 5, 2026
Prompt Details
Prompt Composition
1prompt
- Azure Functions 4108 lines · 2.5K tokens
CWE Coverage
- 20
- 22
- 94
- 117
- 209
- 250
- 287
- 295
- 311
- 319
- 362
- 502
- 532
- 598
- 674
- 732
- 770
- 772
- 799
- 807
- 862
- 918
- 922
- 942
- 1395
Prompt Preview
Use these rules for Azure Functions runtime 4. Apply the relevant language and framework security guidance alongside these rules. Treat each trigger, managed identity, binding, warm instance, and downstream resource as a distinct trust boundary.
Workload identity
- Use managed identity for Azure resources and avoid embedded client secrets, certificates, and storage keys.
- Assign a dedicated identity to each trust boundary with only required data-plane and management-plane roles; use separate function apps for functions requiring different privileges.
- Separate deployment, runtime, administration, and emergency identities.
- Scope role assignments to exact resources, subscriptions, resource groups, and operations.
- Prevent request data from selecting tenant IDs, client IDs, credential chains, subscriptions, or resource endpoints.
Function and host authorization
- Set HTTP
authLevelexplicitly:anonymousrequires no Functions key,functionaccepts a function/host key, andadminrequires the_masterkey. - Test authorization after deployment; Core Tools disables key authorization locally unless
--enableAuthis used, while local containers enforceauthLevel. - Prefer platform authentication or an API gateway for users and validate tokens again at sensitive boundaries.
- Treat function, host, system, and
_masterkeys as shared credentials;_mastergrants administrative runtime API access and must never be an application authentication token. - Rotate or delete access keys explicitly when revoking access; deleting and recreating a function can