Configure SharePoint Online home site app in Microsoft Teams step by step

Configure SharePoint Online home site app in Microsoft Teams step by step

No comments

 9,229 total views,  4 views today

In this article, we will learn about how to configure the SharePoint Home Site App inside the Microsoft Teams step by step.

What you will learn from this article?

  • How to configure the SharePoint Online home site app in Microsoft Teams step by step?
  • Where to download the Viva Connections for desktop PowerShell script?
  • How to create a Viva Connections app package using PowerShell?
  • How to upload the Viva Connections desktop package in the Teams Admin Center?
  • How to manage and pin the app by default for your users?
  • How to add Viva Connections desktop in Microsoft Teams?

Prerequisites:

  • The site must be a modern communication site
  • The site must be converted into a home site – if it is not done yet – please refer to the previous article – How to set up home site in SharePoint Online using PowerShell?
  • Global administrator account
  • Latest SharePoint online management Shell – PowerShell (uninstall the previously installed SharePoint online management Shel, install the latest one), get the latest SharePoint Online PowerShell module from here – Download SharePoint Online Management Shell from Microsoft Official.
  • Privacy policy URL – if your company maintains a separate privacy policy, please keep this ready, otherwise leave go ahead with the default configuration or setup.
  • Terms of use – if your company maintains a separate Terms of use policy, please keep this ready, otherwise leave go ahead with the default configuration or setup.
  • Company website – Your company’s public-facing website URL
  • Icons – Two PNG image icons (192X192 and 32X32 pixels) for two display the app in the Microsoft Teams.

Notes:

From the above-listed prerequisites, the below four are needed for the Viva Connections desktop in Microsoft Teams

  • Privacy policy URL
  • Terms of use
  • Company website
  • Icons

A step-by-step guide to setting up Viva Connections desktop in Microsoft Teams

We assumed that we have fulfilled the prerequisites mentioned above and now we are ready for the configuration.

In order to have the SharePoint Online Home Site app in Microsoft Teams, the very first prerequisite is – it has to be a home site, and the Home Site App was launched by Microsoft last week of March 2021. So at the beginning when it was launched as a home site app – the configuration was very simple.

Home site app Setup process - SharePoint Online and Microsoft Teams
Homesite app Setup process – SharePoint Online and Microsoft Teams – Image Source

Note:

  • As per the above screenshot, if we go to the site settings page from the gear icon under the Teams section (Home site -> Site Settings -> Create Home site app), we could see the link “Create Home site app”. By clicking this link the home site app was configurable inside the Microsoft Teams, however, this approach is not available now – we need to configure the home site app in Microsoft Teams using the Viva connections – “The Viva Connections for the desktop experience, formerly known as the Home site app (SharePoint Home site app is now known as the Viva Connections).” So, no more home site app, it has become now “Viva Connections for Microsoft Teams desktop”

In the coming section, we will discuss the”Viva Connections for Microsoft Teams desktop” and how we can add the home site app in Microsoft Teams using the Viva connection.

There are basically four steps to configure the Sharepoint Online home site app in Microsoft Teams using the Viva connections those are as below:

  • Download the Viva Connections for desktop PowerShell script
  • Create a Viva Connections app package in PowerShell
  • Upload the Viva Connections desktop package in the Teams Admin Center
  • Manage and pin the app by default for your users

Download the Viva Connections for desktop PowerShell script

The very first step to download the PowerShell script from this link – Download the Viva Connections for desktop PowerShell script

The PowerShell script is attached here:


Write-Host "Welcome to Viva Connections desktop! This script will generate a Teams app package that will allow you to pin your SharePoint intranet in Teams."
Write-Host "Please ensure you have SharePoint admin privileges in your tenant before running this script."
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -MinimumVersion 16.0.20324.12000 -Force

# Get SharePoint Portal link from user
[uri]$configUrl = Read-Host -Prompt 'Enter the link of the SharePoint portal that you want to pin in Teams. Please ensure that it is a modern Communication site. We recommend that you use a Home Site'
[string]$domain = $configUrl.Host
$hostElement = $domain.Split(".")[0]

# Validating siteUrl
try{
write-Host "Validating...."
Connect-SPOService -Url https://$hostElement-admin.sharepoint.com
$result = Get-SPOIsCommSite -SiteUrl $configUrl

if ($result.Value) {
write-Host "Current user has permission. Proceeding with app creation"
}
else {
Write-host "The app cannot be created. Please ensure the site link provided is a modern SharePoint Communication site and you have admin privileges to SharePoint in your tenant."
Throw
}
} catch {
Write-host "The app cannot be created. Please ensure the site link provided is a modern SharePoint Communication site and you have admin privileges to SharePoint in your tenant."
Throw
}

## Search Info
$searchSiteVariable = '';
$searchUrlPath = $domain;

if ($configUrl.LocalPath -match '/teams' -or $configUrl.LocalPath -match '/sites') {
$searchSiteVariable = '/siteall';
if ($configUrl.LocalPath -match '^\/[^\/]+\/[^\/]+') { $searchUrlPath = $domain + $Matches[0]; }
}
$searchUrl = "https://$searchUrlPath/_layouts/15/search.aspx$searchSiteVariable" + 'q={searchQuery}'

# Get the Name of the App
$appname = Read-Host -Prompt 'Please enter the name of your app, as you want it to appear in Teams'
while([string]::IsNullOrEmpty($appname)){
Write-Output "App Name cannot be empty."
$appname = Read-Host -Prompt 'Please enter the name of your app, as you want it to appear in Teams'
}

# Get the Short description
$shortDescription = Read-Host -Prompt 'Please enter short description for the app (less than 80 characters)'
while ($shortDescription.length -gt 80) {
Write-Output "short description entered is greater than 80 characters,"
$shortDescription = Read-Host -Prompt 'Please enter short description for the app (less than 80 characters)'
}

# Get the Long description
$longDescription = Read-Host -Prompt 'Please enter long description for the app (less than 4000 characters)'
while ($longDescription.length -gt 4000) {
Write-Output "long description entered is greater than 4000 characters,"
$longDescription = Read-Host -Prompt 'Please enter long description for the app (less than 4000 characters)'
}

# Get the Privacy Policy link
$PrivacyPolicyUrl = Read-Host -Prompt 'Provide a privacy policy link for the app. Press Enter if you want to use default privacy policy from Microsoft'
if([string]::IsNullOrEmpty($PrivacyPolicyUrl)){
Write-Output "Link not provided, adding Microsoft privacy link"
$PrivacyPolicyUrl = 'https://privacy.microsoft.com/en-us/privacystatement'
}

# Get the Terms and Usage Policy Link
$TermsOfUseUrl = Read-Host -Prompt 'Provide a Terms of Use link for the app. Press Enter if you want to use default Terms of Use from Microsoft'
if([string]::IsNullOrEmpty($TermsOfUseUrl)){
Write-Output "Link not provided, adding Microsoft Terms Of Use link"
$TermsOfUseUrl = 'https://go.microsoft.com/fwlink/?linkid=2039674'
}

# Get the Company Name
$companyName = Read-Host -Prompt "Provide your organization's name" #add
if([string]::IsNullOrEmpty($companyName)){
Write-Output "Organization's name not provided, adding name as Microsoft Corp"
$companyName = 'Microsoft Corp'
}

# Get the Company Website
$companyWebsite = Read-Host -Prompt "Provide your organization's public website link"
if([string]::IsNullOrEmpty($companyWebsite)){
Write-Output "Organization's public website link not provided, adding Microsoft's URL"
$companyWebsite = 'https://go.microsoft.com/fwlink/?linkid=868076'
}

#Adding query param with app=portal
if ($ConfigUrl -contains '`?') {
[uri]$finalconfigUrl = $configUrl.ToString() + '&app=portals'
}
else {
[uri]$finalconfigUrl = $configUrl.ToString() + '?app=portals'
}
#Write-Host "Company Portal: '$finalConfigUrl'"

# Generate random GUID
$guid = [System.Guid]::NewGuid()
$DesktopPath = [Environment]::GetFolderPath("Desktop")

# Get the color and outline icon paths from user
Function Get-FileName($windowTitle)
{
Add-Type -AssemblyName System.Windows.Forms
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$OpenFileDialog.Title = $windowTitle
$OpenFileDialog.InitialDirectory = $DesktopPath
$OpenFileDialog.filter = "All files (*.*)| *.*"
# Out-Null supresses the "OK" after selecting the file.
$OpenFileDialog.ShowDialog() | Out-Null
return $OpenFileDialog.FileName
}
Write-Host "Please upload colored-icon[192x192]px"
$color = Get-FileName("Please upload colored-icon[192x192]px")
$color_filename = Split-Path $color -leaf
Write-Host "Please upload outline-icon[32x32]px"
$outline = Get-FileName("Please upload outline-icon[32x32]px")
$outline_filename = Split-Path $outline -leaf
Write-Host "Selected icons paths, color icon path: '$color' Outline-icon path: '$outline'"

#https://developer.microsoft.com/en-us/json-schemas/teams/v1.8/MicrosoftTeams.schema.json
#https://raw.githubusercontent.com/OfficeDev/microsoft-teams-app-schema/preview/DevPreview/MicrosoftTeams.schema.json
# Json object
$json = @"
{
"`$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.9/MicrosoftTeams.schema.json",
"manifestVersion": "1.9",
"version": "1.0",
"id": "$guid",
"packageName": "com.microsoft.teams.$appname",
"developer": {
"name": "$companyName",
"websiteUrl": "$companyWebsite",
"privacyUrl": "$PrivacyPolicyUrl",
"termsOfUseUrl": "$TermsOfUseUrl"
},
"icons": {
"color": "$color_filename",
"outline": "$outline_filename"
},
"name": {
"short": "$appName",
"full": "$appName"
},
"description": {
"short": "$shortDescription",
"full": "$longDescription"
},
"accentColor": "#40497E",
"isFullScreen": true,
"staticTabs": [
{
"entityId": "sharepointportal_$guid",
"name": "Portals-$appName",
"contentUrl": "https://$domain/_layouts/15/teamslogon.aspx?spfx=true&dest=$finalconfigUrl",
"websiteUrl": "$configUrl",
"searchUrl": "https://$searchUrlPath/_layouts/15/search.aspx?q={searchQuery}",
"scopes": ["personal"],
"supportedPlatform" : ["desktop"]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"$domain",
"*.login.microsoftonline.com",
"*.sharepoint.com",
"*.sharepoint-df.com",
"spoppe-a.akamaihd.net",
"spoprod-a.akamaihd.net",
"resourceseng.blob.core.windows.net",
"msft.spoppe.com"
],
"webApplicationInfo": {
"id": "00000003-0000-0ff1-ce00-000000000000",
"resource": "https://$domain"
}
}
"@

$tempPath = [System.IO.Path]::GetTempPath()
$manifestPath = $tempPath + '\manifest.json'

#Writing content to manifest file in temp location
Set-Content -Path $manifestPath $json

# Creating zip file
Compress-Archive -DestinationPath $DesktopPath\$appName.zip -Force -LiteralPath $manifestPath,$color,$outline -CompressionLevel Optimal
Write-Host "Your Viva Connections desktop app has been successfully created! Please find the app manifest in location '$DesktopPath', filename '$appName'.zip."
Write-Host "Please upload this app in Teams Admin Center to proceed."

Script Source

Create a Viva Connections app package in PowerShell

While you start running the above script, pass the below parameters as below:

   Provide the following details when requested:
  • Name: The name of your Viva Connections desktop package, as it should appear in the Teams app bar – basically this would your app name which will appear in the Teams.
  • App short description (80 characters): A short description for your app, which will appear in the Teams app catalog – here goes the short description about your app.
  • App long description (4000 characters): A long description for your app, which will appear in the Teams app catalog – here goes the long description about your app.
  • Privacy policy: The privacy policy for custom Teams apps in your organization (needs to start with https://). If you do not have a separate privacy policy, press Enter and the script will use the default SharePoint privacy policy from Microsoft, if you have a separate privacy policy, please get it from the prerequisites section.
  • Terms of use: The terms of use for custom Teams apps in your organization (needs to start with https://). If you do not have separate terms of use, press Enter and the script will use the default SharePoint terms of use from Microsoft. if you have separate terms of use policy, please get it from the prerequisites section.
  • Company name: Your organization name will be visible on the app page in the Teams app catalog in the “Created By” section. For example Global SharePoint Diary.
  • Company website: Your company’s public website (needs to start with https://) that will be linked to your company’s app name on the app page in the Teams app catalog in the “Created By” section. For example https://globalsharepoint2020.sharepoint.com
  • Icons: You are required to provide two PNG icons, which will be used to represent your Viva Connections desktop app in Teams; a 192X192 pixel colored icon for the Teams app catalog and a 32X32 pixel monochrome icon for the Teams app bar, get these icons from the prerequisites section and upload it wherever it asks during running the script, this will be the last parameter to pass on in the script.

Note:

  • For certain parameters, if you don’t have the details about it – press the enter button to continue the setup with the default configuration.

Upload the Viva Connections desktop package in the Teams Admin Center

After successful execution of the script, we should have the .zip file downloaded in the user desktop location, like below:

Viva Connections desktop package (.zip file) in the Teams Admin Center
Viva Connections desktop package (.zip file) in the Teams Admin Center

Now, open the Microsoft Teams admin center URL – https://admin.teams.microsoft.com/policies/manage-apps

And follow the below navigation to upload the app package file (.zip file) which we have generated using the PowerShell script.

Team Admin Center URL -> Teams App (from the left navigation) -> Manage Apps -> Click on the “+ Upload” button -> Click on the “Select a file” button to upload the package file which you have generated using the PowerShell script.

Upload the Viva Connections desktop package (.zip file) in the Teams Admin Center
Upload the Viva Connections desktop package (.zip file) in the Teams Admin Center

Manage apps

When you are managing apps for your organization, you are controlling what apps are available to users in your organization’s app store. You can then use app permission and app setup policies to configure what apps will be available for specific users.

Once we upload the app package file (.zip file) we can see the app in the manage apps dashboard:

Manage Custom Apps in Microsoft Teams admin center
Manage Custom Apps in Microsoft Teams admin center

Note:

  • Once you upload the app package file (.zip file), make sure the publishing status of the app displays as “Published”.

Now add this app to the Teams left side panel menu, for this we need to follow the below steps:

  • Open your Microsoft Teams web or desktop version.
  • Click on the “Apps” link from the left side menu.
  • Click on the app that you have uploaded, here in this demo it is – “SPHomeSiteInTeams” app.
Add SharePoint Home Site in Microsoft Teams Menu
Add SharePoint Home Site in Microsoft Teams Menu

Now, on the next screen click on the “Open” button.

Open custom app from Microsoft Teams Admin Center
Open custom app from Microsoft Teams Admin Center

Finally, we could see that the SharePoint Online home site has been added as an app in Microsoft Teams. That’s it – we are done. 🙂

SharePoint Online home site added as an app in Microsoft Teams
SharePoint Online home site added as an app in Microsoft Teams

Note:

As of today, the home site app does not support the mobile version of Microsoft Teams, it supports only the desktop or web version of Microsoft Teams.

Summary: What we had here?

Thus, in this article, we have learned the below with respect to configuring the SharePoint Online home site app in Microsoft Teams:

  • How to configure the SharePoint Online home site app in Microsoft Teams step by step?
  • Where to download the Viva Connections for desktop PowerShell script?
  • How to create a Viva Connections app package using PowerShell?
  • How to upload the Viva Connections desktop package in the Teams Admin Center?
  • How to manage and pin the app by default for your users?
  • How to dd Viva Connections desktop in Microsoft Teams?

See Also:

You may also like the below articles:

Buy the premium version of SharePoint Online & Office 365 administration eBook from here:


Buy SharePoint Online & Office 365 Administration eBook