I want to automate channel set up for Microsoft Teams integration. We have dozens of channels owned by different teams. Only Account Admins (or above) can view and set-up the integration (authorize) and set up channels.
I wish there was a way for non-admins to at least view the Microsoft Teams integration configuration in the UI.
We obviously do not want to give every team account admin permissions, and we do not want our 1-2 account admins to have to manually set up channel integrations for dozens of channels. Current documentation only specifies how to set up the bot, authorization and service -> channel mappings manually through the UI.
My plan was to have a source code repo where people put in their service - channel mappings and an automated pipeline running on behalf of account admin would set that up for each team. That way we don’t give out full admin permissions, but teams can self-serve. In this model I hit the following problems:
PagerDuty app has to be added to the Team manually before @PagerDuty authorize can be used. This can be done by any team member.
@PagerDuty authorize needs to be used, then link followed and set-up by account admin. This link is only valid for 5 minutes. How to generate this link in a pipeline?
Then service -> channel mappings can be added using the same API that UI uses:
This API is not documented and may change in the future, but it’s the only way I found of making these changes automatically.
This API only accepts Bearer tokens for authentication and not PagerDuty tokens. How can we automatically generate Bearer tokens in a pipeline?