Git repo that puts together a Teams (recording) Bot with real-time audio access, Azure Cognitive Services and a Teams Tab app to demonstrate end to end functionality that:
- Captures the audio from a Team's call (by adding the "Recording bot" as a user)
- Transcribes the audio to the default language (english, but you can change that via code ;) )
- Translates the transcription to one or more languages (again you can change these)
- Shows the results on a Teams Tab App (React / TypeScript), it can be added as a personal scope or to a meeting with Side Panel functionallity.
- The bot does not actually record the call, but the code for that is just commented out from the original forked project (see below).
This is currently broken, as cert-manager --version v0.15.1 is not support for AKS version > 1.21. There is no time estimation when this will be addressed :( In case anyone would like to assist, please create a pull request :)
- An Azure subcription, where you can create (or have access) to a Service Principal with the Owner Role.
- A Teams Tenant with Admin rights
- A custom domain, where you can create an A Record
- The scope of this repo is by using GitHub Actions to automate the entire process of running the sample.
- In theory, by:
- Registering a calling bot (Step 1) and creating an Azure Service principal (Step 2)
- Forking/cloning the repo
- Creating a file named
03_IaC\00_AzureCLI\MyDeploymentValues.txt
with your config values - and following auto-created issues on your repo.
- you should be set.
- Estimated time to complete ~1.5-2hours (mostly due to building the Bot's docker image and spawning the hosting infrastructure)
- First start by: registering a calling bot
- From this you will need BOT_ID, BOT_SECRET and BOT_NAME. The first two will need to be kept as repo secrets
- Create a Secret on your GitHub repo named BOT_ID holding the value of BOT_ID
- Create a Secret on your GitHub repo named BOT_SECRET holding the value of BOT_SECRET
- Create an Azure Service Principal
- Run this:
az ad sp create-for-rbac -n "RecBotGitHubActions" --role Owner --sdk-auth
(you can use any name you like instead of RecBotGitHubActions) - Get the result and create a GitHub repo Secret named AZURE_CREDENTIALS. For more details see here
- Your GitHub repo secrets should look like this:
- Run this:
- Rename (or create a new) the file
03_IaC\00_AzureCLI\MyDeploymentValues_template.txt
to03_IaC\00_AzureCLI\MyDeploymentValues.txt
and set your desired valuesbotSubDomain
is the subdomain that your bot will "listen" to, for example myrecbot.mydomain.myextentionbotName
is the value from step 1 BOT_NAME, use the sameprojectPrefix
is a prefix, for naming conventions. This will create an Azure resource group named: _rg. Use something yours...azureLocation
the Azure region to deploy thingsacrName
the name of the Azure Container Registry to be created. This needs to be unique as its a FQDN
- Go to
00_RecordingBot\deploy\cluster-issuer.yaml
edit the file and replaceYOUR_EMAIL
with your email. Use your company (or domain) email, as I am not sure if this will work with common providers (for example gmail.com, outlook.com etc etc) - Once you make changes to
MyDeploymentValues.txt
andcluster-issuer.yaml
, pushing to remote repo will trigger the Initial Setup First Step workflow. This will create:- A Public IP. This is of paramount importance, as you will need to create an A record for your custom domain, mapping this IP to your botSubDomain.
- An Azure Container Registry. This will hold the Docker image (windows) of your Bot.
- Once the above is completed, you should see two Issues being created. At this point you will need to do below two very important actions:
- Create an A record mapping the newly created IP to your bot's subdomain. To do this, you will need to visit your domain's registrant web site, and make the related DNS configurations. This should be quite straight forward. Once you complete it, try to ping your bot's subdomain to make sure that the Azure IP is resolved.
- Visit your Azure Container Registry and get a copy of the user name and the key of your Admin Account this is supposed to be enabled by the Initial Setup workflow.
- Create a GitHub secret named REGISTRY_USERNAME holding the value of your ACR Admin Account user name
- Create a GitHub secret named REGISTRY_PASSWORD holding the value of your ACR Admin Account key.
- Run manually the Initial_Setup_Second_Step workflow.
- This will build the Bot's code and create the first version of your Docker image in your ACR. This can be quite time consuming...expect 20mins+.
- Next it will trigger the 02_Initial_Setup_All_Infra workflow, which will create an AKS cluster with a Windows Pool
- Will move the IP created on the first step to MC_ resource group (automatically created by AKS creation). This is needed so this IP can be assigned to AKS's load balancer. (Probably there is an easier way to solve this, when using a SP dedicated for the creation of the components - TODO for now...)
- It will also deploy all needed things for the Middleware part (Azure Functions, Congitive Services, Cosmos db etc etc)
- It is pretty much automating the steps described here
- After it's finished (total 45mins+) make sure you run the validations to see if everything is ok...In case it is not, please review the logs in order to determine possible issues.
- If everything is ok (well congrats 👏 🤝) you should be able to add a bot to a Teams call. Add this point, you should already have registered your bot to your Teams tenant (grant admin consent on step 1).
- So, create a teams meeting, get the Join Url, and make the below POST Call
POST https://botSubDomain/joinCall Content-Type: application/json { "JoinURL": "https://teams.microsoft.com/l/meetup-join/...", }
- For more details on this see here
- Teams Tab App
- Front End CI CD GitHub Action will deploy a Teams Tab App to an Azure Storage Static site on your newly created resource group
- Also, it creates the Team's app package that you can deploy on Teams. The app package will be hosted on https://staticsite.z16.web.core.windows.net/cognitivebot.zip
- You can download the app package and install it on your Teams client using Team's App Studio
- Putting it all together
- Once you have your bot added as a user to your Teams call
- Your Teams tab app installed
- You should see the last 5 calls (active or finished), select the first that is hopefully your last active call.
The Recording bot is a fork of this public repo: https://github.com/microsoftgraph/microsoft-graph-comms-samples/tree/master/Samples/V1.0Samples/AksSamples/teams-recording-bot which follows the MIT license. This part is located here
MiddleWare and Front end are original work in the context of a prove of concept. Extra effort has been put in order to enable Application Insights to all of the componets and achieve end-to-end tracing.
- AKS cluster (with windows pool) to run the recording bot
- Azure Functions (C#) as middleware between the bot and the front end (Teams Tab app)
- Cosmos db as persistance layer
- Adding Teams meeting tab with side panel functionallity.
- First version of Infrastructure as code is there. There are a few things to improve:
- Docker build takes a long time. Probably by using the Azure Container Instance for building the image will save some time, as the windows file layers can be persisted there - where this is not possible on the hosted GitHub agent. Working on Infrastructure as code, in order to deploy everything automatically see here
This is a work in progress, its just a proof of concept, not meant for production purpuses. Time permitted, more detailed documentation to follow.