Share via

Permission Denied Error in Apps Service

Singh, Jabeez 0 Reputation points
2025-10-10T14:31:32.2+00:00

Issue Summary:

In our App service we are encountering a PermissionDenied error when attempting to invoke the Azure AI Foundry API endpoint POST /api/projects/{projectName}/threads using DefaultAzureCredential. The error message indicates that the principal with ID 5cb7739c-4125-4f7a-9e61-533995efb416 lacks the required data action Microsoft.CognitiveServices/accounts/AIServices/agents/read.

  • Authentication is being handled via DefaultAzureCredential, which successfully resolves to a managed identity.
  • The support team has confirmed that appropriate roles have been assigned to the identity.
  • Despite this, the API call fails due to insufficient permissions.

Please suggest how can we overcome this issue.

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform

0 comments No comments
{count} votes

Answer recommended by moderator
  1. Anshika Varshney 8,925 Reputation points Microsoft External Staff Moderator
    2025-10-10T21:13:42.97+00:00

    Hello Singh, Jabeez,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    The “Permission Denied” error usually happens because App Service runs in a sandbox with restricted file system access.

    Now what you can do:

    • Write files only to allowed paths:
      • Windows: D:\home\site\wwwroot or D:\home\data.
        • Linux: /home.
        • Avoid system directories — they’re read-only.
        • If using mounted storage, ensure your app’s managed identity has the right RBAC roles (e.g., Storage Blob Data Contributor).
    • Use Kudu Console to verify permissions and paths: https://<your-app>.scm.azurewebsites.net/DebugConsole.

    Reference:

    Hope this helps! Thankyou.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.