Skip to content

Migrate Azure Functions features into the Azure extension - #367

Open
Brandon Waterloo (bwateratmsft) wants to merge 140 commits into
mainfrom
bwateratmsft-functions-migration
Open

Brandon Waterloo (bwateratmsft) wants to merge 140 commits into
mainfrom
bwateratmsft-functions-migration

Conversation

@bwateratmsft

@bwateratmsft Brandon Waterloo (bwateratmsft) commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

🤖

Summary

Rebuild the approved Azure Functions extension features using the monorepo's shared clients, provider trees, managed commands, settings framework, and azd provisioning/deployment patterns. This is a feature migration, not a source-extension code port. The inventory and signed triage account for all 271 feature IDs: 67 kept (23 migrate, 25 adapt, 19 reuse), 140 dropped, and 64 deferred. See docs/migrations/azurefunctions/ for the inventory, triage, plan, and parity report, and docs/products/functions.md for the product contract.

  • Remote: Function App and function trees, start/stop/restart, remote Execute, Copy Function URL, enable/disable, identity reveal, and Application Insights log terminals. A failed log poll leaves its reason readable in the terminal until a key is pressed.
  • Local: project and function listing from the running host, settings edits, and owned-host F5 debugging for Node.js, Python, Java, PowerShell, .NET isolated, and native Go.
  • Create and deploy: provisioning goes through azd and the pinned AVM Function App pattern. Deploy Project as Function App reuses the create wizard's deploy job from a Functions project node, an Explorer folder, or the Command Palette.
  • Core Tools: F5 requires Azure Functions CLI v5 preview.3 or later, using func run with owned build/output options and v5 .NET worker PID discovery. The Functions runtime scope remains v4. Python debugging requires the selected virtual environment and passes its root as VIRTUAL_ENV.
  • Dropped on purpose: deleting an individual deployed function (deployed functions come from the project and its infrastructure), the source extension's task, authoring, and portal-URI surfaces, and deployment from a Function App node.

Shared infrastructure

Shared work was extracted into separate PRs and is in the base: #369 (triage and planning), #370 and #371 (utils and clients), #376 (generic reveal/refresh, the reusable log terminal, Web App lifecycle, azd service targeting, multi-type resource selection), #380, #381, and #396 (pseudoterminal key-press state, process-tree grace period, ARM-keyword canonicalization for reveal, and REST error codes). This branch has main merged through #402.

Follow-ups

Deferred work is tracked in issues: slots (#357), local-development/emulator options (#358), Durable/DTS (#359), container-hosted Functions (#360), MCP (#361), CLI v5 scaffolding (#364), gallery and resource-backed bindings (#365), native Go provisioning pending AVM support (#366), language prerequisites including the Python virtual environment (#391), a debug-toolbar Execute button (#392), removing the workload workaround once upstream is fixed (#393), showing function output after Execute (#395), "limited" workspace-trust support (#397), and notifying partner extensions (#353). User-assigned identity management remains deferred; this PR includes identity reveal only. Go code deployment belongs to azd, not an extension-owned pipeline.

Testing

Run on Node 24 against this branch with main merged:

Command Result
pnpm run lint Passed
pnpm run build Passed
pnpm run test Passed: utils 687 passing, azutils 480 passing, extension 1,519 passing

Coverage includes v5 host command arguments, fragmented .NET NDJSON startup events, protected host options, Python virtual-environment propagation through the real launch path, log-query scope fallback, and reveal for a resource that is not loaded yet. The Windows PowerShell installer check is registered as long-running (it needs ENABLE_LONG_RUNNING_TESTS=1 and runs in real PowerShell against a loopback stub); it passed when run that way.

Live verification is recorded in the manual checklist, which the reviewer has fully checked (50 of 50), covering all six runtimes on Windows, Go with process cleanup on macOS, remote commands against disposable Flex and Consumption apps, creation and deployment, and log streaming. The parity report keeps code inspection, automated tests, and live verification as separate levels. Not run: the other five runtimes on macOS/Linux, and Linux itself.

Checklist

  • I followed the repository conventions in docs/ and CONTRIBUTING.md
  • pnpm run lint, pnpm run build, and pnpm run test pass
  • New and changed behavior is covered by tests (fast and deterministic, or registered as long-running)
  • The change follows the VS Code UX guidelines and the repository's UX conventions
  • User-facing strings are localized
  • No activation-time regressions; expensive work is deferred or lazy-loaded
  • Bundle size is unchanged, or the increase is justified below
  • Docs (docs/, READMEs, CHANGELOG.md) are updated where relevant
  • No secrets, PII, or raw telemetry data are included

Bundle size / performance

Measured with a clean build and pnpm run package on this branch against main (38ddb7c9):

main this PR Change
VSIX 386.1 KB (395,365 bytes) 410.4 KB (420,293 bytes) +24.3 KB (+6.3%)
extension.bundle.js 769.1 KB 848.6 KB +79.5 KB (+10.3%)

The increase is the Functions feature set itself: local host ownership, debugging, remote and local function commands, log streaming, and tree providers. No new runtime dependencies were added beyond what the extension already bundles. The VSIX size guardrail in test/extension.test.ts compares against a fixed baseline, which main sets to its own measured size. This PR sets it to 420,293 bytes, the measured size of this branch after merging main's dependency updates. Without the bump the guardrail would still pass (+6.3% is inside its 10% tolerance) but would emit its drift warning on every run. Function metadata is parsed lazily when a Functions command or debug session runs. The only activation additions are two type-scoped debug events (onDebugResolve:azure-functions and onDebugDynamicConfigurations:azure-functions), so there is no startup CLI, auth, or workspace-scan work.

Major contribution (new service, resource type, or substantial feature)

  • This is a major contribution. I agree to own this code long-term, and I understand it may be removed if its issues go unaddressed.
  • I have added or updated a CODEOWNERS entry for the code I'm contributing.

UI changes

New Azure Resources nodes and commands for Function Apps and functions, a Functions project node in the Workspace view, and the azure-functions debug type. No screenshots are attached.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Add project selection, runtime preparation, owned host lifecycle, language attach configurations, and optional project initialization. Preserve JSONC edits and wire debugger contributions, commands, tests, and product documentation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Copilot AI balanced review requested due to automatic review settings October 12, 2026 18:23

This comment was marked as resolved.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Extract the utils layer from the Functions migration and document the reusable process contract.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 04a67a6a-cad7-413e-8153-d99ff09a5c57
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Registers vscode-azure/functions/deploy as CreateFunctionApp with the deploy
job, as on main, and adds menu entries for a Functions project node in the
workspace view and for Explorer folders. The shared ShowEndpointUrlStep
reports the deployed endpoint. CreateFunctionApp resolves a workspace project
node key to its folder and rejects deployment in an untrusted workspace.

FUNC-047, FUNC-202, FUNC-255 and FUNC-256 return to Adapt; FUNC-046 and
FUNC-247 stay Drop. Triage, plan, parity report and product docs are updated.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
A fuzzy union over the workspace and classic tables makes Azure Monitor report
a partial error for whichever tables are absent, which the log stream treats as
a failure. Pick AppTraces/AppRequests for a workspace-based component and
traces/requests otherwise.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
…a in parallel

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
…table schema

A rejected log query (HTTP 400) now reports the service's error codes, never its
message, and the first query is retried once against the other schema's tables.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
assertRestSuccess includes identifier-shaped error codes from the nested error chain (never messages); LogsQueryClient drops its special 400 branch and log stream progress options are built once.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Deployed functions come from the project and its infrastructure, and code-defined functions have no folder to delete. Removes the command, menu, WebAppClient.deleteFunction, and the read-only/code-defined detection (one fewer ARM call per app expansion). Docs also carry the log-stream error-code note.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Without a capabilities.untrustedWorkspaces declaration VS Code disables the extension in Restricted Mode, so the code-level trust gates never ran. None of the contributed settings control code execution, so no restrictedConfigurations are listed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
TreeView.reveal asks for the target's tree item before it fetches the parent's children, and matches the loaded child by handle (built from the item id). GenericAzureViewProvider.getTreeItem now returns an id-only item for an unloaded key instead of throwing, and AzureNodeId.forRelatedResource canonicalizes the ARM keywords (App Service returns resourcegroups in identity ids) so the derived id equals the listed child's id.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Restructure PARITY-REPORT.md into inspected code, automated behavioral evidence, and live verification with scenario IDs mapped to feature IDs, refresh the build gates after merging main, record the macOS Go pass, link P6-06 to #353, add the drift-log entry, and document the worker-argument string contract on quoteWorkerArgument.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Ending a pseudoterminal disposes it with its text, so a failed Functions log poll used to lose its error. BufferedPseudoterminal.endOnKeyPress writes the failure and a prompt, then ends the terminal with a zero exit code on the next key. The Functions stream also reports the reason in the output channel and an error notification, and Container Apps uses the same state when its stream breaks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
All 50 checklist items are checked: mark LV-7 and LV-8b passed, close P6-02, and refresh the build gates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
A component's own query scope resolves only the classic tables (traces, requests), while its Log Analytics workspace resolves AppTraces and AppRequests. The log stream now queries the workspace first and falls back to the component scope with the classic tables when the workspace refuses the query (400, 403, 404), so a workspace-based component no longer wastes a request on every start.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Remove the untrustedWorkspaces capability and every workspace-trust check: the workspace index gate, the project selector and deploy checks, the isWorkspaceTrusted manifest terms, the MockVsCode trust emitter, their tests, and the docs that described them. Without an untrustedWorkspaces declaration VS Code disables the extension in Restricted Mode, so no feature checks trust itself.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
The owned-host tests that waited on real 100 ms and 200 ms poll delays now advance fake timers. The FuncInstaller tests that only checked for -Prerelease/-Force strings are removed, and the four real-PowerShell cases become one long-running Windows test that runs only with ENABLE_LONG_RUNNING_TESTS=1.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Update the reviewed head, test counts, and the long-running installer note.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Resolve the VSIX size baseline against main's updated dependencies: main's build measures 395,365 bytes and this branch measures 420,293 bytes (+6.3%), so the baseline is 420,293.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be0e045e-f053-4ee4-83b4-74ac9a1e1301
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.

Installing func fails on Windows Functions workspace: show individual functions under a project

2 participants