Skip to content

Upgrade Azure Functions adapter to v2 and Node 26 - #105

Merged
robandpdx merged 3 commits into
mainfrom
upgrade-azure-adapter-v2-node26
Dec 4, 2026
Merged

robandpdx merged 3 commits into
mainfrom
upgrade-azure-adapter-v2-node26

Conversation

@robandpdx

Copy link
Copy Markdown
Collaborator

Summary

  • Upgrade the Azure Functions adapter to v2 and migrate to ESM and the Azure Functions v4 programming model, preserving the webhook route.
  • Update dependencies, workflows, and local configuration for Node.js 26.
  • Test signed webhook handling and document the Linux-only Azure Node 26 preview.

Testing

  • npm test (Node 26.13.1)
  • Azure Functions Core Tools: signed webhook returned HTTP 200 on Node 26.

robandpdx and others added 3 commits December 3, 2026 15:21
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
## Summary

Enable the existing Sales Service Delivery Contributor groups to deploy POCs and demos that use managed identities and Key Vault, without granting unrestricted role-assignment administration.

- Add conditional **Role Based Access Control Administrator** assignments for `azure-sales-service-delivery-contributor-always-on` and `azure-sales-service-delivery-contributor-jit` in `github-nonprod-sales-services-delivery`.
- Restrict **both creation/update and deletion** of role assignments to these role definitions and `ServicePrincipal` targets:
  - **Storage Blob Data Owner** — `b7e6dc6d-f1e8-4753-8033-0f276bb0955b`
  - **Key Vault Secrets User** — `4633458b-17de-408a-b874-0445c86b69e6`
- Add role-specific, **condition-required** audit exceptions for these two groups. Do not modify the global allowlist or exempt other privileged roles.
- Add regression tests using the actual configuration: accept conditioned grants, reject missing/blank conditions, and continue rejecting other privileged roles.
- Document scope, purpose, and remaining risk. Existing Contributor assignments, group membership/JIT mechanics, and the automation service principal remain unchanged.

## Business justification

Sales Service Delivery builds customer-facing POCs and demos that should demonstrate the security practices we recommend. The motivating Azure Functions deployment uses managed identity for host/deployment storage and Key Vault references for its GitHub App credentials. Its ARM template must assign the two roles above to the newly provisioned workload identity. Existing Contributor permissions cannot create those assignments, so deployment and default what-if authorization checks fail with `Microsoft.Authorization/roleAssignments/write` errors.

This reusable delegation avoids repeated manual administrator intervention for each POC while preserving identity-based storage access and centralized secret management. It avoids falling back to storage account keys or storing application secrets directly in Function App settings. Per the requester, this subscription contains POCs/demos, not production workloads or customer data.

## Scope and security review — IAM / Cloud Security approval required

This intentionally covers **the entire Sales Service Delivery non-production subscription and all resource groups**, not only the original requester's resource group. No other subscription or management group is changed.

This PR proposes narrowly role-scoped audit-policy exceptions and therefore requires a human IAM / Cloud Security decision under the repository's PR-approval runbook. The exceptions require a nonblank condition; reviewers must also verify the condition itself, since the existing audit validator checks presence rather than ABAC semantics.

The conditions do not authorize assigning Owner, User Access Administrator, RBAC Administrator, or either permitted data role to users/groups. **Remaining risk:** `ServicePrincipal` includes application service principals as well as managed identities, including principals controlled by group members. Members can therefore delegate the two permitted data roles to such principals anywhere in this subscription, and remove matching existing assignments. Restricting to preapproved identity IDs would require a separate identity-provisioning/approval step for new workloads. Subscription scope and inclusion of the existing always-on group are explicit approval decisions; resource-group-scoped and/or JIT-only delegation are narrower alternatives if required by IAM.

No Azure apply/deploy was performed; this is a request for review and the normal controlled deployment path.

## Validation

- Focused audit RSpec suite: **17 examples, 0 failures; 100% line coverage of the loaded validator**.
- Ruby lint on both changed Ruby files: passed.
- Existing role-assignment scope check: passed.
- Existing duplicate-role-assignment check: passed, with 11 pre-existing redundant-duplicate warnings elsewhere.
- Parsed both new YAML assignments and verified condition version, identical conditions, no ERB, and **878 / 8192 characters per condition**.
- `git diff --cached --check`: passed.

Local validation used installed Ruby **3.4.5** and available test/lint gems, not the repository-pinned Ruby **3.4.9** / complete locked bundle. Missing coverage gems were installed in isolated session storage. The existing Python ABAC-length checker could not run because PyYAML downloads timed out; the new parsed conditions were measured directly with Ruby using the checker's strip-and-length semantics. CI should validate the pinned environment and full repository checks.

## References

- [Constrained role-assignment delegation](https://learn.microsoft.com/azure/role-based-access-control/delegate-role-assignments-overview)
- [Role and principal-type condition examples](https://learn.microsoft.com/azure/role-based-access-control/delegate-role-assignments-examples)
- [Azure Functions identity-based connections](https://learn.microsoft.com/azure/azure-functions/functions-reference#configure-an-identity-based-connection)
- [App Service / Functions Key Vault references](https://learn.microsoft.com/azure/app-service/app-service-key-vault-references)
- [Repository PR-approval runbook](https://github.com/github/azure-config/blob/main/docs/runbooks/pr-approval.md)
@robandpdx
robandpdx merged commit fec8e26 into main Dec 4, 2026
5 checks passed
@robandpdx
robandpdx deleted the upgrade-azure-adapter-v2-node26 branch December 4, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant