Skip to content

MethodAccessException in ApplicationInsightsRequestScope.SetTriggerProperties when running workflows locally (Bundle 1.138.54 + Core Tools 4.9.0) #1522

@jbwulrk

Description

@jbwulrk

Describe the Bug

When running Azure Logic Apps Standard workflows locally using VS Code, all workflow
triggers fail with a MethodAccessException. The error occurs in
ApplicationInsightsRequestScope.SetTriggerProperties when it tries to call
Microsoft.IdentityModel.Tokens.CollectionUtilities.IsNullOrEmpty, which is an internal
method and not accessible.

This affects ALL workflows in the project - none can be triggered locally.

Error Message

System.MethodAccessException: Attempt by method
'Microsoft.Azure.Workflows.WebJobs.Extensions.Logging.ApplicationInsightsRequestScope
.SetTriggerProperties(System.String, Boolean, System.Collections.Generic.Dictionary2 <System.String,System.Object>)' to access method 'Microsoft.IdentityModel.Tokens.CollectionUtilities.IsNullOrEmpty <System.Collections.Generic.KeyValuePair2<System.String,System.Object>>
(System.Collections.Generic.IEnumerable1<System.Collections.Generic.KeyValuePair2
<System.String,System.Object>>)' failed.

Workflow Status

All workflows report: status='Failed', statusCode='WorkflowRunTimedOut'
immediately (within ~700ms), followed by the MethodAccessException.

Environment

  • OS: Windows 11
  • VS Code: 1.114.0
  • Azure Logic Apps Standard Extension: 5.230.15
  • Azure Functions Core Tools: 4.9.0
  • Extension Bundle: Microsoft.Azure.Functions.ExtensionBundle.Workflows 1.138.54
  • Microsoft.IdentityModel.Tokens.dll version in bundle: 6.35.0.41201

Additional Context

  • Upgrading to bundle 1.160.21 resolves the MethodAccessException but introduces a
    different bug: "System.PlatformNotSupportedException: Performance Counters are not
    supported on this platform" which also blocks all workflow execution.
  • Replacing Microsoft.IdentityModel.Tokens.dll with version 6.34.0 does not resolve
    the issue, as the call originates from compiled code in the workflow extension.
  • Disabling Application Insights via local.settings.json
    (APPINSIGHTS_INSTRUMENTATIONKEY="") does not prevent the error.
  • The issue appears to be a version mismatch between the compiled workflow extension
    DLL and the shipped Microsoft.IdentityModel.Tokens.dll in the bundle.

Steps to Reproduce

  1. Create or open a Logic Apps Standard project in VS Code
  2. Ensure extension bundle version resolves to 1.138.54
  3. Start Azurite and run func host start
  4. Trigger any workflow via HTTP
  5. Observe MethodAccessException in logs and InternalServerError/WorkflowRunTimedOut

Expected Behavior

Workflows should execute successfully when triggered locally.

Plan Type

Standard

Steps to Reproduce the Bug or Issue

  1. Open a Logic Apps Standard project in VS Code (extension v5.230.15)
  2. Ensure host.json has: "version": "[1.*, 2.0.0)" (resolves to bundle 1.138.54)
  3. Start Azurite (azurite --silent)
  4. Run func host start (Core Tools 4.9.0)
  5. Trigger any workflow via HTTP request
  6. Observe MethodAccessException in terminal logs
  7. Workflow fails with WorkflowRunTimedOut (~700ms) and returns InternalServerError

Workflow JSON

Screenshots or Videos

No response

Additional context

Tested two bundle versions with identical results:

Bundle 1.138.54:

  • MethodAccessException in ApplicationInsightsRequestScope.SetTriggerProperties
    calling internal method Microsoft.IdentityModel.Tokens.CollectionUtilities.IsNullOrEmpty
  • Microsoft.IdentityModel.Tokens.dll version in bundle: 6.35.0.41201
  • Replacing DLL with v6.34.0 does not help (call is from compiled extension code)
  • Disabling AppInsights via local.settings.json does not prevent the error

Bundle 1.160.21:

  • Resolves MethodAccessException but introduces:
    "System.PlatformNotSupportedException: Performance Counters are not supported on this platform"
  • This also blocks all workflow execution locally

Environment:

  • Windows 11, 12 cores
  • VS Code 1.114.0
  • Azure Logic Apps Standard Extension: 5.230.15
  • Azure Functions Core Tools: 4.9.0 (also tested with 4.5.0 - same issue)
  • Node runtime, Azurite for local storage

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions