Azure Functions 4

Last reviewed Sep 5, 2026

Export as PDF

Prompt Details

Prompt Composition

1prompt
  1. 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 authLevel explicitly: anonymous requires no Functions key, function accepts a function/host key, and admin requires the _master key.
  • Test authorization after deployment; Core Tools disables key authorization locally unless --enableAuth is used, while local containers enforce authLevel.
  • Prefer platform authentication or an API gateway for users and validate tokens again at sensitive boundaries.
  • Treat function, host, system, and _master keys as shared credentials; _master grants 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