Adding skill from Azure portal to Copilot studio 401 error

Seena Khan 0 Reputation points MVP
2025-05-15T10:07:16.66+00:00

I have receievd the below error when I imported healthcare agent bot to Copilot studio. Can anyone help me to resolve this?
Error Message: Invoking skill 'healthcare-agent-skill' was not successful. HTTP status code 401. Error Code: SkillNotSuccesfulResponseCode Conversation Id: 124e4f99-6f26-4844-bdb8-1cc2e69a75a0 Time (UTC): 2025-05-15T10:03:15.341Z

Microsoft Copilot Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shah Lalitbhai (Tata Consultancy Services Limited) 0 Reputation points Microsoft External Staff
    2025-05-16T08:11:58.3866667+00:00

    Hello @Seena Khan ,

    ✅ Step-by-Step Solution

    Step 1: Confirm the Skill Endpoint is Secured

    Ensure the skill (healthcare-agent-skill) has a valid App ID and Password configured in the Azure Bot Channels Registration or in the configuration files if running locally.


    Step 2: Match the Caller Bot’s Allowed Callers

    In your skill bot's app settings (e.g., appsettings.json or in Azure under Application Settings), confirm the AllowedCallers configuration includes the App ID of the calling bot (parent bot):

    "AllowedCallers": [ "<PARENT_BOT_APP_ID>" ]

    ✅ If you're using "AllowedCallers": [ "*" ], it means all bots are allowed, which can help for debugging but is insecure in production.


    Step 3: Ensure Proper Credentials in the Parent Bot

    In your parent bot (caller bot) configuration:

    • It must have the skill’s App ID and Password set correctly in the bot's BotFrameworkSkills section (e.g., appsettings.json, BotServices.cs, or via Azure).

    "BotFrameworkSkills": [

    {

    "Id": "healthcare-agent-skill",
    
    "AppId": "<SKILL_BOT_APP_ID>",
    
    "SkillEndpoint": "https://<SKILL_BOT_ENDPOINT>/api/messages"
    

    }

    ]


    Step 4: Confirm OAuth Identity

    If you are using Azure Bot Services, make sure both bots (parent and skill) are:

    • Registered in the same tenant, or
    • Trusted using appropriate AAD permissions (cross-tenant calls require additional configuration).

    Step 5: Verify Tokens and Environment

    If running locally:

    • Use the Bot Framework Emulator and ensure you provide the correct Microsoft App ID and Password.
    • Restart the bot with updated environment variables if they changed.

    Step 6: Check Bot-to-Skill Communication in Code

    Ensure you're using the correct adapter and enabling skill communication. In .NET, for instance, this is handled using SkillHttpClient and SkillConversationIdFactory.


    Step 7: Re-test After Fixing

    After making these changes:

    • Restart both parent and skill bots (if local).
    • Retry the conversation.
    • Watch the logs for updated status (should be 200 OK).

    Thanks, 

    Shah

    ************************************************************************* 

    If the response is helpful, please click "upvote" and upvote it. You can share your feedback via Microsoft Copilot Developer Community Response Feedback link. Click here to escalate.


Your answer

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