fix(recipes): Add entry point guidance for Node.js and C# - Issue #852#995
Open
paulyuk wants to merge 11 commits intomicrosoft:mainfrom
Open
fix(recipes): Add entry point guidance for Node.js and C# - Issue #852#995paulyuk wants to merge 11 commits intomicrosoft:mainfrom
paulyuk wants to merge 11 commits intomicrosoft:mainfrom
Conversation
…rosoft#852 Node.js v4 programming model requires src/index.js with app.setup() call. Without it, functions deploy but return 404 on all endpoints. C# .NET isolated worker should NOT replace Program.cs from base template. Base template uses ConfigureFunctionsWebApplication() which is required. Changes: - Add common/nodejs-entry-point.md documentation - Add common/dotnet-entry-point.md documentation - Update all 16 JS/TS recipes with entry point warning - Update 3 C# recipes to remove outdated Program.cs sections - Add Node.js entry point grader to eval.yaml - Add missing TypeScript fixture file - Update composition.md with critical warnings for both languages Fixes microsoft#852 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Addresses Azure Functions “deploys but returns 404” failures (Issue #852) by documenting and reinforcing required entry-point patterns for Node.js v4 (app.setup() in src/index.*) and .NET isolated worker (keep base template Program.cs using ConfigureFunctionsWebApplication()), and by extending eval coverage to catch regressions.
Changes:
- Add shared “entry point” guidance docs for Node.js and .NET recipes and link them from recipes/composition guidance.
- Update multiple JS/TS recipes with explicit warnings to preserve
src/index.(js|ts)and (for TS) to runnpm run build. - Extend
azure-prepareeval suite with a new grader and add a missing TS fixture entry point file.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/azure-prepare/eval/fixtures/typescript-http/src/index.ts | Adds TS fixture entry point calling app.setup() |
| tests/azure-prepare/eval/eval.yaml | Adds a new grader intended to detect missing Node.js entry-point guidance |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/timer/source/typescript.md | Adds warning to keep src/index.ts + TS build note |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/timer/source/javascript.md | Adds warning to keep src/index.js |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/timer/source/dotnet.md | Removes outdated Program.cs snippet; adds “don’t modify Program.cs” warning |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/source/typescript.md | Adds common-pattern link to Node.js entry-point doc |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/source/javascript.md | Adds common-pattern link to Node.js entry-point doc |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/source/typescript.md | Adds warning to keep src/index.ts + TS build note + common-pattern link |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/source/javascript.md | Adds warning to keep src/index.js + common-pattern link |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/servicebus/source/dotnet.md | Removes outdated Program.cs snippet; adds “don’t modify Program.cs” warning |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/mcp/source/typescript.md | Adds warning to keep src/index.ts + TS build note |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/mcp/source/javascript.md | Adds warning to keep src/index.js |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/source/typescript.md | Adds common-pattern link to Node.js entry-point doc |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/eventhubs/source/javascript.md | Adds common-pattern link to Node.js entry-point doc |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/durable/source/typescript.md | Adds warning to keep src/index.ts + TS build note |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/durable/source/javascript.md | Adds warning to keep src/index.js |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/durable/source/dotnet.md | Removes outdated Program.cs snippet; adds “don’t modify Program.cs” warning |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/cosmosdb/source/typescript.md | Adds common-pattern link to Node.js entry-point doc |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/cosmosdb/source/javascript.md | Adds common-pattern link to Node.js entry-point doc |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/composition.md | Adds “critical” warnings for Node.js and .NET entry points in composition step |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/common/nodejs-entry-point.md | New shared Node.js entry-point documentation |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/common/dotnet-entry-point.md | New shared .NET entry-point documentation |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/source/typescript.md | Adds common-pattern link to Node.js entry-point doc |
| plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/source/javascript.md | Adds common-pattern link to Node.js entry-point doc |
...s/azure-prepare/references/services/functions/templates/recipes/common/nodejs-entry-point.md
Show resolved
Hide resolved
.../skills/azure-prepare/references/services/functions/templates/recipes/timer/source/dotnet.md
Outdated
Show resolved
Hide resolved
...ls/azure-prepare/references/services/functions/templates/recipes/servicebus/source/dotnet.md
Outdated
Show resolved
Hide resolved
...kills/azure-prepare/references/services/functions/templates/recipes/durable/source/dotnet.md
Outdated
Show resolved
Hide resolved
Strengthen warning on Consumption Plan (Y1) section in bicep.md to match the terraform.md warning pattern. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…warnings PROBLEM: - composition.md referenced Terraform templates that don't exist (-tf variants) - When user requests Terraform, agent would synthesize from scratch - Y1 legacy examples could be mistakenly used for new deployments FIX: - Remove non-existent Terraform template references - Add explicit guidance to use Bicep templates and convert - Add ⛔ DO NOT USE warnings on Y1/Dynamic SKU examples - Make FC1 (Flex Consumption) the only option for new deployments Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
plugin/skills/azure-prepare/references/services/functions/templates/recipes/composition.md
Outdated
Show resolved
Hide resolved
plugin/skills/azure-prepare/references/services/functions/templates/recipes/composition.md
Outdated
Show resolved
Hide resolved
- dotnet has official Terraform template: functions-quickstart-dotnet-azd-tf - Other languages: reference flex-consumption-samples TF as fallback - Removed inefficient 'convert Bicep to TF' approach Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Terraform IaC is identical across languages - only runtime name and version differ. Use functions-quickstart-dotnet-azd-tf for ALL languages and modify the runtime variables. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace hardcoded version numbers with guidance to query official docs: https://learn.microsoft.com/en-us/azure/azure-functions/supported-languages Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
...s/azure-prepare/references/services/functions/templates/recipes/common/nodejs-entry-point.md
Outdated
Show resolved
Hide resolved
Fixes: 1. nodejs-entry-point.md: Fixed package.json main field - use single entry point, not glob patterns. Runtime auto-discovers functions/*.js 2. eval.yaml: Made nodejs_entry_point grader informational with skip_if_no_match so it doesn't fail C#/Python tasks 3. timer/dotnet.md: Changed 'Replace contents' to 'Add trigger file' 4. servicebus/dotnet.md: Changed 'Replace contents' to 'Add trigger file' 5. durable/dotnet.md: Changed 'Replace contents' to 'Add trigger file' All changes resolve contradictions between 'do not modify Program.cs' and 'replace contents' instructions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
saikoumudi
previously approved these changes
Feb 21, 2026
Key learnings from URL shortener E2E test with Terraform + Node.js: - package.json MUST be at project ROOT, not inside src/ - azure.yaml must use 'project: .' not 'project: ./src/' - Source code is IDENTICAL for Bicep and Terraform (only infra/ differs) - Both glob pattern and simple entry point work for function discovery - Added explicit project structure diagrams and azure.yaml examples - Enhanced Common Mistakes table with project structure errors Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
E2E testing revealed that 'main: src/index.js' does NOT work.
The glob pattern 'src/{index.js,functions/*.js}' is REQUIRED for
the Azure Functions runtime to discover functions in src/functions/.
Changes:
- Remove 'simple entry point' option that doesn't work
- Add ⛔ CRITICAL warnings about glob requirement
- Update Common Mistakes table with microsoft#1 cause of 404
- Add glob requirement to composition.md Step 5
- Update TypeScript pattern to use glob too
This was the root cause of both E2E test failures.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
E2E testing revealed repeated failures due to: 1. 403 Forbidden - RBAC not propagated (Azure AD takes 30-60s) 2. 404 Container Not Found - deployment container not created 3. Tag Not Found - Azure resource tags take time to be queryable Added solutions: - time_sleep resource pattern for RBAC delays - Explicit deployment container creation - Warning callout with common failure modes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
plugin/skills/azure-prepare/references/services/functions/templates/recipes/composition.md
Show resolved
Hide resolved
plugin/skills/azure-prepare/references/services/functions/templates/recipes/composition.md
Show resolved
Hide resolved
1. README.md: Update Terraform templates to match composition.md - All non-.NET languages use functions-quickstart-dotnet-azd-tf - Add note explaining runtime configuration approach 2. composition.md: Clarify azurerm vs azapi resource usage - azurerm_linux_function_app for Standard/Premium plans - azapi_resource REQUIRED for Flex Consumption (FC1) - Added complete FC1 example with functionAppConfig Resolves PR comments: - r2835661181: Terraform template inconsistency - r2835661188: azurerm vs azapi resource type Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Azure Functions deployed with our recipes return 404 on all endpoints (Issue #852).
Root Cause Analysis
Node.js v4 programming model requires
src/index.js(orsrc/index.ts) withapp.setup()call. Without it, functions deploy but the runtime never discovers the registered endpoints.C# .NET isolated worker recipes were replacing the base template's
Program.cs(which usesConfigureFunctionsWebApplication()) with an outdated version usingConfigureFunctionsWorkerDefaults().Changes
Node.js (16 files)
common/nodejs-entry-point.mddocumenting required entry pointC# (3 files)
common/dotnet-entry-point.mddocumenting correct patternsProgram.cssections from timer, servicebus, durable recipesComposition Algorithm
Tests/Evals
src/index.ts)Summary
Fixes #852