microsoft / microsoft/GitHub-Copilot-for-Azure
Skill Updates: Azure Functions TypeScript Deployment Issues
@wbreza is already working on this.
Since Feb 5, 2026.
- Dominant language
- Python
- Stars
- 250
- Forks
- 204
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 67
Description
Background
During deployment of a TypeScript Azure Function with Event Hub trigger, several issues were encountered that could have been prevented with better skill guidance. This document captures the learnings and proposed updates.
Repro
-
make sure you have github copilot cli and azure plugin
-
mkdir skills-event-hubs
-
code .
<create Function -> TypeScript (Node.js) -> Event Hub listener>
copilot
/plugin uninstall azure
/plugin install microsoft/github-copilot-for-azure:plugin
- "deploy this function to Azure"
Issues Encountered
Issue 1: Policy Violation - Event Hub Local Auth
Error:
RequestDisallowedByPolicy: Resource 'evhns-xxx' was disallowed by policy.
Reasons: 'Local authentication methods are not allowed.'
Root Cause: Generated Bicep for Event Hub namespace did not include disableLocalAuth: true.
Resolution: Added the property to Bicep.
Issue 2: Did Not Use Existing Template
What Happened: Agent wrote Bicep from scratch instead of using azd init -t <template>.
Root Cause: The decision tree in functions-templates.md pointed to a generic samples page URL rather than specific azd init commands. The agent did not follow through to find the actual template.
Existing Templates Found:
Azure-Samples/functions-quickstart-dotnet-azd-eventhubAzure-Samples/functions-quickstart-python-azd-eventhub
Issue 3: TypeScript Remote Build Failure
Error:
sh: 1: tsc: Permission denied
Actual Root Cause: The .funcignore file had incorrect entries that:
- Excluded
*.tsfiles - preventing Oryx from seeing TypeScript source - Excluded
tsconfig.json- preventing Oryx from compiling - Did NOT exclude
node_modules/- uploading local binaries with wrong permissions
Correct .funcignore (enables remote build):
*.js.map
.git*
.vscode
__azurite_db*__.json
__blobstorage__
__queuestorage__
local.settings.json
test
node_modules/ # REQUIRED - excludes local binaries
Reference: https://github.com/Azure-Samples/remote-mcp-functions-typescript/pull/35
Issue 4: Application Insights Not Receiving Traces
Symptom: No traces appearing in Application Insights after deployment.
Root Cause: When DisableLocalAuth: true is set on Application Insights (required by enterprise policy), identity-based authentication requires:
- App Setting:
APPLICATIONINSIGHTS_AUTHENTICATION_STRINGwith valueClientId=<managed-identity-client-id>;Authorization=AAD - RBAC Role:
Monitoring Metrics Publisherrole assigned to the managed identity on the Application Insights resource
Proposed Skill File Updates
File 1: azure-prepare/references/recipes/azd/functions-templates.md
Update 1A: Event Hubs Template Section (lines 55-57)
Replace with:
8. Does it use Event Hubs for streaming?
Indicators: EventHubTrigger, @app.event_hub, event_hub_output, streaming
└─► YES → Use Event Hubs Template:
| Runtime | Template Command |
|---------|-----------------|
| .NET | `azd init -t Azure-Samples/functions-quickstart-dotnet-azd-eventhub` |
| Python | `azd init -t Azure-Samples/functions-quickstart-python-azd-eventhub` |
| TypeScript/JS | No template yet. Use .NET or Python template infra, adapt azure.yaml for Node.js |
Update 1B: Add New Section - TypeScript .funcignore Configuration
Add guidance on correct .funcignore for TypeScript with remote build:
- Exclude
node_modules/ - Do NOT exclude
*.tsortsconfig.json
Update 1C: Add New Section - Enterprise Policy Compliance
Add default disableLocalAuth: true for Event Hubs, Storage, App Insights, Service Bus.
Update 1D: Add New Section - Application Insights Identity-Based Authentication
Add required app settings and RBAC role for identity-based App Insights auth.
File 2: azure-prepare/SKILL.md
Update 2A: Add Rule 7 - Template-First Requirement
7. **ALWAYS use `azd init -t <template>`** when a matching template exists in the decision tree.
File 3: azure-prepare/references/recipes/azd/azure-yaml.md
Update 3A: Add TypeScript and .funcignore Guidance
Document two valid approaches (remote build vs local build) and common errors.
Summary of Changes
| File | Change Type | Description |
|---|---|---|
functions-templates.md |
Update | Event Hubs section - add specific azd init commands |
functions-templates.md |
Add Section | TypeScript .funcignore configuration |
functions-templates.md |
Add Section | Enterprise policy compliance defaults |
functions-templates.md |
Add Section | Application Insights identity-based authentication |
SKILL.md |
Add Rule | Template-first enforcement (Rule 7) |
azure-yaml.md |
Add Section | TypeScript deployment approaches |
References
- Official TypeScript template: https://github.com/Azure-Samples/functions-quickstart-typescript-azd
- Event Hubs .NET template: https://github.com/Azure-Samples/functions-quickstart-dotnet-azd-eventhub
- Event Hubs Python template: https://github.com/Azure-Samples/functions-quickstart-python-azd-eventhub
- Flex Consumption samples: https://github.com/Azure-Samples/azure-functions-flex-consumption-samples
- TypeScript .funcignore fix PR: https://github.com/Azure-Samples/remote-mcp-functions-typescript/pull/35
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.