Jan 18 2022 11:01 PM
I have a MS Teams App that contains tab for opening SharePoint Add-ins (Provider-hosted) pages.
When using MS Teams Desktop and web, the session always changes when Postback and failed to get SharePoint Context.
httpContext.Session.SessionID: jlsla5ggvdr2dbcpxivqxa5t
After clicking the button for Postback
httpContext.Session.SessionID: nau5tyvs1rjbqrqvvqtx2cll
This only happens in using MS Teams Desktop and Web for some users.
Will there be a way stop refreshing the Http Context Session when Postback?
Jan 19 2022 05:47 AM
Jan 19 2022 06:09 AM
We have a Provider-hosted SharePoint Add-in with several pages.
We put them on a MS Teams App as a tab by using App Studio.
The pages works well at first on MS Teams Desktop but recently users report that the issue persist while using Teams Desktop.
After adding some debugging logs to the add-in, we found that the page session is null after postback and result in the application failed to get the SharePoint Context only when using MS Teams web and Desktop.
To replicate,
create a provider-hosted add-in and install to a SharePoint site
create a blank page with a button that will trigger postback in the add-in.
create the Teams app using App Studio and add the page as Tab.
Test and install the app
Open the tab and click the button using MS Teams web
Jan 20 2022 01:16 AM
Feb 07 2022 06:19 AM
Feb 07 2022 06:25 AM
Feb 07 2022 06:28 AM - edited Feb 07 2022 06:32 AM
@Yannie - Could you please share the reference docs or sample code that you are following (Including Provider-hosted SharePoint Add-in with several pages), so that we can investigate more on it.
Feb 07 2022 06:43 AM
Feb 08 2022 03:58 AM
Feb 08 2022 06:14 AM
Feb 08 2022 10:17 PM
Feb 08 2022 10:31 PM
Feb 14 2022 03:58 AM
@Yannie - Could you please let us know what URL you have given here in this step? We tried with sharepoint site URLs but it gave us "Error occurred in deployment step 'Install SharePoint Add-in': Sideloading of apps is not enabled on this site. testSPAddIn 0" while running the code from Visual studio.
Feb 14 2022 04:10 AM
Feb 16 2022 11:39 AM
@Yannie - I tried creating a developer site as you suggested and created a project again. I am getting Microsoft.SharePoint.Client.ServerUnauthorizedAccessException after running the project. I apologize for asking many times. Is it possible for you to share developer site url and demo tenant details so that it would be easier for us to check this issue.
Feb 17 2022 09:26 AM
@Yannie - We were able to repro this but we see that, this issue is happening in browser as well. This does not seem like an issue on Microsoft Teams side. Could you please confirm it?
Feb 17 2022 05:45 PM
@Meghana-MSFT, please note that the issue ONLY happens in Teams 🙂 Mine looks fine in browser.
Feb 23 2022 05:31 AM
Mar 25 2022 02:25 AM
@Meghana-MSFT Please let me know if there are any updates, thank you