Deploy SPFx solution to MS Teams

Deploy SPFx webpart in MS Teams as a Tab.

First create webpart solution template

choose

Do you allow tenant admin as yes

no-javascript framework


install teams js as adding as dependency to our solution.

npm install @microsoft/teams-js --save

Under src - webparts folder In manifest.json file, you can find supportedHosts:["SharePointWebPart"] by default.

you need to add "TeamsTab"

"supportedHosts": ["SharePointWebPart","TeamsTab"],

now go to webpart.ts main file.

we have to import microsoftteam from microsoft teams-js.

import * as microsoftTeams from '@microsoft/teams-js';


Follow step from this article:

https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-web-part-as-ms-teams-tab

Comments