OfficeDev / microsoft-teams-apps-company-communicator

Company Communicator app template
MIT License
329 stars 403 forks source link

Unable to resolve service for type 'Microsoft.Teams.Apps.CompanyCommunicator.Common.Services.MicrosoftGraph.IUserService #1598

Open moonncat opened 3 days ago

moonncat commented 3 days ago

We found some errors in API since the end of 2023: the /api/userD throws error mentioning "Unable to resolve service for type 'Microsoft.Teams.Apps.CompanyCommunicator.Common.Services.MicrosoftGraph.IUserService' which attempting to activate 'Microsoft.Teams.Apps.CompanyCommunicator.Controller.UserDataController'." so the user list can't be up to date.

peddivyshnavi commented 3 days ago

Hi @moonncat

Go to resource group where CC app is deployed --> Go to Application insight type resource --> share the screenshot and stack trace for Top 3 response codes.

image

and also please share the status of all functions also.

moonncat commented 2 days ago

Thanks for your swift response. your support is appreciated.

1,it is a old deployment which happened in June/2022. 2, the application insights shows below error: at Microsoft.Identity.Client.AcquireTokenSilentParameterBuilder.Validate(... Microsoft.Identity.Client.AbstractAcquireTokenSilentParameterBuilder`1.ValidateAndCalculateApiId (... at Microsoft.Identity.Web.TokenAcquisition (...

It seems got error in building the IUserService implementation.

3, all the response code in GET UserData/GetAllUserData are 500.

4, sorry for the security restrictions, I can't share the screenshot. but i have checked the deployment center, it is not yet setup. I think it is because we used a package to deploy instead of source code.

5, all functions are running normally.

6, the build of the dotnet version is v3.1 Graph version is 3.22 Microsoft.Identify.Web is 0.1.3-preview Micosoft.Aspnetcore is 3.1

peddivyshnavi commented 2 days ago

Hi @moonncat Could you please check whether app registrations got expired

moonncat commented 2 days ago

hi @peddivyshnavi , I have renewed all the secrets in all environment variables: 1, AppSecretUser / AppSecretAuthor etc in app service. 2, we did the similar update in Azure Function as well. 3, Secret in AKV also got updated.

please kindly advice is there anything missed out? thanks.

peddivyshnavi commented 2 days ago

Hi @moonncat We suspect secrets got configured incorrectly Please cross verify once again w.r.t secrets renewal with the below steps.