web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Your app package faile...
Copilot Studio
Suggested Answer

Your app package failed the validation

(1) ShareShare
ReportReport
Posted on by 95
I created an agent in Copilot Studio named AgentX. I shared agentX to "userA@ptXYZ.com", "userB_ptABC.com#EXT#@ptXYZ.com", "userC_ptDEF.onmicrosoft.com#EXT#@ptXYZ.com". I published agentX to Teams Channel. User A B C was able to find Agent X from Teams from Apps -> Categories -> Built with Power Platform. User C successfully accessed agentX. Then I did not want user C to access agentX, so I removed user C permission from copilot studio and I also uninstalled AgentX from user C using this code
$users = @(
"userA@ptXYZ.com",
"userB_ptABC.com#EXT#@ptXYZ.com",
"userC_ptDEF.onmicrosoft.com#EXT#@ptXYZ.com"
)
$ApplicationClientId     = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$ApplicationClientSecret = "<Application_Client_Secret>"
$TenantId                = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$SecureClientSecret      = ConvertTo-SecureString -String $ApplicationClientSecret -AsPlainText -Force
$ClientSecretCredential  = New-Object System.Management.Automation.PSCredential(
    $ApplicationClientId,
    $SecureClientSecret
)
Install-Module Microsoft.Graph.Teams -Scope CurrentUser
Import-Module Microsoft.Graph.Teams
Connect-MgGraph -TenantId $TenantId -ClientSecretCredential $ClientSecretCredential
$result = foreach ($user in $users) {
    $apps = Get-MgUserTeamworkInstalledApp `
        -UserId $user `
        -ExpandProperty "teamsApp,teamsAppDefinition"
    $targetApps = $apps | Where-Object {
        $_.TeamsAppDefinition.DisplayName -eq "Copilot Studio Agent Name"
    }
    if ($targetApps) {
        foreach ($app in $targetApps) {
            [PSCustomObject]@{
                User            = $user
                AppName         = $app.TeamsAppDefinition.DisplayName
                InstallationId  = $app.Id
                ExternalId      = $app.TeamsApp.ExternalId
            }
        }
    }
    else {
        [PSCustomObject]@{
            User            = $user
            AppName         = "NOT FOUND"
            InstallationId  = "-"
            ExternalId      = "-"
        }
    }
}
$result | Format-Table -AutoSize
Remove-MgUserTeamworkInstalledApp `
  -UserId "userC_ptDEF.onmicrosoft.com#EXT#@ptXYZ.com" `
  -UserScopeTeamsAppInstallationId "<installation-id>"
Then, I wanted user C to be able to access agentX again, so I gave user C permission again and republish AgentX in Teams Channel. User C could find AgentX from Teams from Apps -> Categories -> Built with Power Platform, but when user C wanted to ADD agentX, there was an error as seen in picture 1. This is not about license that user C has because previously user C was able to access agentX (agentX was able to return good response). How to resolve this issue?
I have the same question (0)
  • Suggested answer
    Valantis Profile Picture
    4,803 on at
     
    When you force removed the app for User C via PowerShell and then republished, Teams retained a cached record of the old app package for User C. When User C tries to add the agent again, Teams validates the new package against the old cached one and they do not match, causing the validation error.
     
    try this fix :
     
    1. In Copilot Studio go to Channels, open the Teams and Microsoft 365 Copilot channel and disconnect it completely.
    2. Republish the agent.
    3. Re-add the Teams channel and republish again to generate a fresh app package.
    4. Share the new installation link with User.
     
    If this does not work, can you confirm whether the validation error happens only for User C or also for User A and User B when they try to add the agent? That will help identify if the issue is specific to User C or a broader manifest problem.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

  • CU15090955-0 Profile Picture
    95 on at
    I tried to disconnect agent from Teams -> Re-publish Agent -> Re-add Teams Channel -> Re-publish Agent -> Relogin but it did not work
  • Suggested answer
    Valantis Profile Picture
    4,803 on at

    Just to clarify what you mean by gave permission. Did you share the agent using the Share button in Copilot Studio and also add the user to the environment? And when you removed access, did you unshare and then share again?
    Also worth knowing that sharing changes can take a little while to reflect in Teams apps, so it might just need some time before the user sees the updated access.
     
     
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

     
  • CU15090955-0 Profile Picture
    95 on at
     
    Did you share the agent using the Share button in Copilot Studio and also add the user to the environment? Yes
    And when you removed access, did you unshare and then share again? Yes
  • Valantis Profile Picture
    4,803 on at

    Hi @CU15090955-0,

    Just wanted to check in and see if everything is working now. If you still need any help, feel free to let me know.

    Also, if the issue is resolved, it would be great if you could mark the answer as solved so others with the same question can find it easily.

     

    Thanks and have a great day!

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 704

#2
Vish WR Profile Picture

Vish WR 249

#3
Haque Profile Picture

Haque 244

Last 30 days Overall leaderboard