Microsoft Teams
Where: Menu → Manage → Integrations → Teams, Slack & calendar → Microsoft Teams

The academy as an app in Teams:
- a tab with each person’s required trainings, and one with their team’s, signed in with Teams;
- notices in the Teams activity feed (optional);
- a knowledge bot: people ask their organisation’s documents in a personal chat with the app (optional; needs the knowledge sources and the AI companion).
The app uses your organisation’s own Entra app registration, the one of your Microsoft sign-in. Nothing is registered at Microsoft on the Academy’s side.
Who does what
Section titled “Who does what”The setup happens in four places. Each needs its own admin rights at Microsoft; often several people do one part each.
| Step | Where | Role needed |
|---|---|---|
| 1 Choose the sign-in and options | the academy | Administrator of your organisation |
| 2 Expose an API (Application ID URI, scope, Teams as clients) | Microsoft Entra admin centre | Application Administrator or Cloud Application Administrator, or an owner of the app registration |
| 3 Graph permission TeamsActivity.Send (only for notices) | Microsoft Entra admin centre | Adding it: as step 2. Granting admin consent: Privileged Role Administrator or Global Administrator (the two roles of step 2 can’t consent to Microsoft Graph application permissions) |
| 4 Azure Bot with the Teams channel (only for the knowledge bot) | Azure portal | An Azure subscription, and the Azure role Contributor or Owner on the resource group. Registering the provider Microsoft.BotService once needs Contributor on the subscription. These are Azure roles, not Entra roles. Pricing tier F0 and the Teams channel are free. |
| 5 Upload the app package and make it available | Teams admin centre | Teams Administrator (or Global Administrator) |
Step by step
Section titled “Step by step”1. In the academy
Section titled “1. In the academy”- Set up the Microsoft sign-in under Manage → Sign-in, with your domains proven, if it isn’t there yet (see “Company sign-in”).
- Under Microsoft sign-in to use, choose it.
- Tick Notices in the Teams activity feed if people should get notices in Teams.
- Tick Knowledge bot if people should ask your documents in a chat with the app.
- Click Save. The section now shows the values for the next steps: the Application ID URI, the scope, the two Teams client ids and, with the knowledge bot, the messaging endpoint. Keep the page open; each value has to be entered exactly as shown.
2. Microsoft Entra: expose an API
Section titled “2. Microsoft Entra: expose an API”In the Microsoft Entra admin centre (entra.microsoft.com):
- Go to Applications → App registrations → All applications and open the app registration of your Microsoft sign-in. Its Application (client) ID must be the one the academy shows in the Application ID URI.
- Open Expose an API. Next to Application ID URI, click Add (or Edit), paste the URI from step 1 of the academy (
api://<your API address>/<client id>) and Save. - Click Add a scope: scope name
access_as_user, Who can consent: Admins and users, fill in the display names and descriptions (for example “Access the academy as the user”), state Enabled, then Add scope. - Under Authorized client applications, click Add a client application twice, once for each Teams client id the academy shows (
1fec8e78-bce4-4aaf-ab1b-5451cc387264for the Teams desktop and mobile apps,5e3ce6c0-2b1f-4285-8d4b-75ee78787346for Teams on the web). Tick the scopeaccess_as_usereach time and click Add application.
3. Microsoft Entra: permission for notices (only with notices)
Section titled “3. Microsoft Entra: permission for notices (only with notices)”- In the same app registration, open API permissions → Add a permission → Microsoft Graph → Application permissions.
- Search for TeamsActivity.Send, tick it and click Add permissions.
- Click Grant admin consent for
and confirm. This needs a Privileged Role Administrator or a Global Administrator. The status of the permission turns to “Granted”.
4. Azure: the bot (only with the knowledge bot)
Section titled “4. Azure: the bot (only with the knowledge bot)”Teams finds the knowledge bot through an Azure Bot that carries the same client id as your app registration. Without it, or with a bot that has a new app id of its own, Teams answers “Invalid bot” (see “When something goes wrong”).
In the Azure portal (portal.azure.com):
- Create a resource, search for Azure Bot, and click Create.
- Fill in:
- Bot handle: a name that is unique worldwide, for example
academy-bot-<your organisation>; - Subscription and Resource group (a new one is fine);
- Pricing tier: change it to Free (F0);
- Type of App: Single Tenant;
- Creation type: Use existing app registration;
- App ID: the client id of your app registration; App tenant ID: your directory (tenant) id.
- Bot handle: a name that is unique worldwide, for example
- Review + create, then Create. If Azure says the provider Microsoft.BotService isn’t registered, someone with Contributor on the subscription registers it (Subscription → Resource providers → Microsoft.BotService → Register).
- Open the new bot → Settings → Configuration. Set Messaging endpoint to the address the academy shows (
https://<your API address>/v1/teams/bot/messages) and Apply. - Open Channels, choose Microsoft Teams, accept the terms and Apply. The channel must show as running.
Teams can take a few minutes to see a new bot.
5. Teams admin centre: upload the app
Section titled “5. Teams admin centre: upload the app”- In the academy, click Download the app package. Download it again after every change in the academy: its version goes up each time (shown as Package version).
- In the Teams admin centre (admin.teams.microsoft.com), go to Teams apps → Manage apps and choose Upload new app (under Actions), then the package. For an update, open the app in the list and upload the new package there.
- Open the app → Users and groups (or Available to) and make it available to everyone, or to the groups that should have it.
- If uploads are refused, custom apps are switched off: under Teams apps → Manage apps → Org-wide app settings, allow custom apps.
6. In the academy again
Section titled “6. In the academy again”- Click Send me a test notice (with notices) and look in your Teams activity feed. It reaches only people who have opened the app once.
- On the sub-tab Where messages go, under How people hear about trainings, choose Microsoft Teams if everyone should hear about trainings there; each person can change it under My account.
Set up with PowerShell
Section titled “Set up with PowerShell”Instead of clicking, steps 2 to 5 can be done with PowerShell. These are single commands to copy, not a script: paste each block into the same PowerShell window, check its output, then go on.
Values. Take them from the sub-tab Microsoft Teams of the academy and from your sign-in under Manage → Sign-in:
$TenantId = "<directory (tenant) id>"$ClientId = "<client id of the Microsoft sign-in's app registration>"$ApiHost = "api.academy.example.com" # your academy's API address, as the Application ID URI shows it$IdUri = "api://$ApiHost/$ClientId"$BotEndpoint = "https://$ApiHost/v1/teams/bot/messages"$SubscriptionId = "<Azure subscription id>"$ResourceGroup = "rg-academy"$BotName = "academy-bot-<short name of your organisation>"$Package = "$HOME\Downloads\<the downloaded package>.zip"$IdUri and $BotEndpoint must look exactly as the academy shows them. $BotName must be unique worldwide (letters, digits, -).
Install the modules once:
Install-Module Microsoft.Graph.Authentication, Microsoft.Graph.Applications -Scope CurrentUserInstall-Module Az.Accounts, Az.Resources -Scope CurrentUserInstall-Module MicrosoftTeams -Scope CurrentUserStep 2: Application ID URI and scope.
Connect-MgGraph -TenantId $TenantId -Scopes "Application.ReadWrite.All","AppRoleAssignment.ReadWrite.All"$app = Get-MgApplication -Filter "appId eq '$ClientId'"$app | Format-List DisplayName, AppId, IdentifierUris, SignInAudienceCheck that this is the app registration of your Microsoft sign-in before going on.
Update-MgApplication -ApplicationId $app.Id -IdentifierUris (@($app.IdentifierUris) + $IdUri | Select-Object -Unique)$app = Get-MgApplication -ApplicationId $app.Id$api = $app.Apiif (-not ($api.Oauth2PermissionScopes | Where-Object Value -eq "access_as_user")) { $api.Oauth2PermissionScopes += [Microsoft.Graph.PowerShell.Models.MicrosoftGraphPermissionScope]@{ Id = [guid]::NewGuid(); Value = "access_as_user"; Type = "User"; IsEnabled = $true AdminConsentDisplayName = "Access the academy as the user"; AdminConsentDescription = "Lets Teams sign the user in to the academy." UserConsentDisplayName = "Access the academy as you"; UserConsentDescription = "Lets Teams sign you in to the academy." } Update-MgApplication -ApplicationId $app.Id -Api $api}Step 2: Teams as authorised clients.
$app = Get-MgApplication -ApplicationId $app.Id$api = $app.Api$scopeId = ($api.Oauth2PermissionScopes | Where-Object Value -eq "access_as_user").Idforeach ($teamsClient in "1fec8e78-bce4-4aaf-ab1b-5451cc387264", "5e3ce6c0-2b1f-4285-8d4b-75ee78787346") { if (-not ($api.PreAuthorizedApplications | Where-Object AppId -eq $teamsClient)) { $api.PreAuthorizedApplications += [Microsoft.Graph.PowerShell.Models.MicrosoftGraphPreAuthorizedApplication]@{ AppId = $teamsClient; DelegatedPermissionIds = @($scopeId) } }}Update-MgApplication -ApplicationId $app.Id -Api $apiCheck:
(Get-MgApplication -ApplicationId $app.Id).Api | Format-List @{n="Scopes";e={$_.Oauth2PermissionScopes.Value}}, @{n="Clients";e={$_.PreAuthorizedApplications.AppId}}Step 3: TeamsActivity.Send (only with notices). Adding it needs the roles of step 2:
$graph = Get-MgServicePrincipal -Filter "appId eq '00000003-0000-0000-c000-000000000000'"$role = $graph.AppRoles | Where-Object Value -eq "TeamsActivity.Send"$app = Get-MgApplication -ApplicationId $app.Id$rra = @($app.RequiredResourceAccess)$g = $rra | Where-Object ResourceAppId -eq $graph.AppIdif (-not $g) { $g = [Microsoft.Graph.PowerShell.Models.MicrosoftGraphRequiredResourceAccess]@{ ResourceAppId = $graph.AppId; ResourceAccess = @() }; $rra += $g }if (-not ($g.ResourceAccess | Where-Object Id -eq $role.Id)) { $g.ResourceAccess += [Microsoft.Graph.PowerShell.Models.MicrosoftGraphResourceAccess]@{ Id = $role.Id; Type = "Role" } }Update-MgApplication -ApplicationId $app.Id -RequiredResourceAccess $rraAdmin consent (Privileged Role Administrator or Global Administrator):
$sp = Get-MgServicePrincipal -Filter "appId eq '$ClientId'"New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $sp.Id -PrincipalId $sp.Id -ResourceId $graph.Id -AppRoleId $role.IdStep 4: the Azure Bot (only with the knowledge bot). First look whether there is a bot already, and which app id it carries:
Connect-AzAccount -Tenant $TenantId -Subscription $SubscriptionIdGet-AzResource -ResourceType "Microsoft.BotService/botServices" -ExpandProperties | Select-Object Name, ResourceGroupName, @{n="AppId";e={$_.Properties.msaAppId}}, @{n="Type";e={$_.Properties.msaAppType}}, @{n="Endpoint";e={$_.Properties.endpoint}}- No bot whose AppId is your client id: create one with the next blocks.
- A bot with another AppId (it was created with “Create new Microsoft App ID”): the academy can’t use it. Delete it or leave it, and create a new one with your client id.
Register-AzResourceProvider -ProviderNamespace Microsoft.BotServiceOnly if the resource group doesn’t exist yet:
New-AzResourceGroup -Name $ResourceGroup -Location westeuropeNew-AzResource -ResourceGroupName $ResourceGroup -ResourceType "Microsoft.BotService/botServices" -ResourceName $BotName -Location global -Kind azurebot -Sku @{ name = "F0" } -Properties @{ displayName = "Academy"; endpoint = $BotEndpoint; msaAppId = $ClientId; msaAppType = "SingleTenant"; msaAppTenantId = $TenantId } -ForceThe Teams channel:
New-AzResource -ResourceGroupName $ResourceGroup -ResourceType "Microsoft.BotService/botServices/channels" -ResourceName "$BotName/MsTeamsChannel" -Location global -Properties @{ channelName = "MsTeamsChannel"; properties = @{ isEnabled = $true } } -ForceCheck:
Get-AzResource -ResourceGroupName $ResourceGroup -ResourceType "Microsoft.BotService/botServices/channels" -ResourceName "$BotName/MsTeamsChannel" -ExpandProperties | Select-Object -ExpandProperty PropertiesA new app package isn’t needed if it was downloaded after the knowledge bot was switched on in the academy: the bot id in it is the client id and doesn’t change.
Step 5: the app package.
Connect-MicrosoftTeams -TenantId $TenantIdIs the app there already?
Get-TeamsApp -DistributionMethod organization -DisplayName "<the app's name in the package>"First upload:
New-TeamsApp -DistributionMethod organization -Path $PackageUpdate, after changes in the academy:
Set-TeamsApp -Identity "<Id from Get-TeamsApp>" -Path $PackageMaking the app available to people isn’t reliable with PowerShell: do it in the Teams admin centre as in step 5 above.
When something goes wrong
Section titled “When something goes wrong”“Invalid bot. Make sure the bot is registered and the Teams channel is enabled.” Teams shows this before a message reaches the academy: it finds no Azure Bot with a Teams channel for the bot id in the package (your client id). The causes, most likely first:
- The Azure Bot was created with a new app id instead of the existing app registration. Check with the
Get-AzResourcecommand of step 4, or in the bot’s Settings → Configuration (Microsoft App ID). - The Azure Bot is there, but the Microsoft Teams channel wasn’t added.
- There is no Azure Bot at all.
- Bot and Teams are in different directories (the bot’s tenant id isn’t the tenant of the Teams users).
Only when this message is gone and the bot still doesn’t answer, the messaging endpoint or the client secret is wrong: compare the endpoint with the one the academy shows.
The tab doesn’t sign in. Compare the Application ID URI in Expose an API character by character with the one the academy shows, and check that the scope access_as_user and both Teams client ids are there (step 2).
No notices arrive. The person has to open the app once. Check that TeamsActivity.Send shows “Granted” under API permissions (step 3), then use Send me a test notice.
The upload is refused. Custom apps are switched off for your organisation (step 5.4), or you lack the Teams Administrator role.