Skip to main content

Deploy Microsoft Teams app from Azure DevOps

Author: Garry Trinder

Installs or updates a Microsoft Teams app from an Azure DevOps pipeline. Deploys the app if it hasn't been deployed yet or updates the existing package if it's been previously deployed.

m365 login -t password -u $(username) -p $(password)

$apps = m365 teams app list -o json | ConvertFrom-Json
$app = $apps | Where-Object { $_.externalId -eq $env:APPID}
if ($app -eq $null) {
# install app
m365 teams app publish -p $(System.DefaultWorkingDirectory)/teams-app-CI/package/
} else {
# update app
m365 teams app update -i $ -p $(System.DefaultWorkingDirectory)/teams-app-CI/package/