Skip to content

Multiple issues with the Azure AI Foundry Agent Service connector #318

@joniii98

Description

@joniii98

Describe the bug

Every call to the first-party Azure AI Foundry Agent Service connector (azureagentservice) from a Power Apps Code App fails with an OBO token decryption error (HTTP 401):

Right after running npx power-apps add-data-source, the generated service and model files contain syntax errors and the project no longer compiles (see attached screenshots). Two distinct symptoms: hyphenated parameter names are emitted as raw TypeScript identifiers, and multi-line schema descriptions lose the // prefix on continuation lines.

I was able to patch the generated files manually with the help of an AI assistant so the project compiles, and proceeded to actually call the connector.

2. Every call to the connector then fails with an OBO token decryption error.
With the manually fixed generated files in place, every call into the connector fails inside the Power Platform connector runtime, before the request reaches Azure Foundry, with HTTP 401:

Failed to get onbehalfof access token:
connectionId=azureagentservice,
message=IDX10609: Decryption failed. No Keys tried:
token: '[PII of type 'Microsoft.IdentityModel.Logging.SecurityArtifact' is hidden]'

The same connector with the same connection and the same user works in Power Automate, and the same agent is reachable via the @azure/ai-projects SDK from a non-Power-Apps web app.

Steps to Reproduce

Prereq: an agent deployed + published in Azure Foundry, and a Power Platform connection for the Azure AI Foundry Agent Service connector with auth type "Microsoft Entra ID User Login" pointing at the Foundry project endpoint.

  1. Add the Azure AI Foundry Agent Service connector via the CLI: npx power-apps add-data-source and select it from the connector picker.
  2. Run tsc --noEmit → parser errors in AzureAIFoundryAgentServiceService.ts and AzureAIFoundryAgentServiceModel.ts (problem 1).
  3. Manually fix the generated files
  4. Call any connector operation, e.g. InvokeAgent
  5. Run the app → HTTP 401 with the IDX10609 error above (problem 2).

Expected behavior

  • npx power-apps add-data-source produces TypeScript that compiles cleanly.
  • The generated service operations succeed when invoked from the Code App with a valid user-delegated connection.

Actual behavior

  • Generated files do not compile until manually patched.
  • After the manual patch, every call fails with IDX10609: Decryption failed during the OBO token exchange. The request never reaches the Agent in Foundry.

Screenshots or Error Messages

Image Image
{
  "success": false,
  "error": {
    "message": "Failed to get onbehalfof access token: connectionId=azureagentservice, message=IDX10609: Decryption failed. No Keys tried: token: '[PII of type 'Microsoft.IdentityModel.Logging.SecurityArtifact' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.",
    "status": 401,
    "requestId": "5e03a7af-6dea-4174-b5aa-17414384d2e8"
  }
}

Environment information

  • Framework / build tool: React 18 + Vite 4.5, TypeScript
  • SDK: @microsoft/power-apps ^1.1.1
  • PAC CLI: v2.6.4 .NET
  • Connector: Azure AI Foundry Agent Service (azureagentservice)
  • Connection auth type: Microsoft Entra ID User Login
  • OS / browser: macOS 26.4, Edge 147

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions