Adding groups to AppCenter apps

Max Yermakhanov
ObjectSharp (a Centrilogic Company)
1 min readApr 1, 2020

A while back I’ve written a blog post on how to pre-create AppCenter apps in your Azure Pipeline, and then I got to re-use it for another client. But this time, I needed to ensure that AppCenter app security is set when app is pre-created. So, I have extended the script by adding the lines below to the section after the app gets created:

echo "adding team to $appName app as viewers"curl -X POST "https://api.appcenter.ms/v0.1/orgs/ORG_NAME/teams/TEAM_NAME/apps" -H "accept: application/json" -H "X-API-Token: $appcenterToken" -H "Content-Type: application/json" -d "{ \"name\": \"$appName\"}"echo "setting team permissions to Developers for $appName app"curl -X PATCH "https://api.appcenter.ms/v0.1/orgs/ORG_NAME/teams/TEAM_NAME/apps/$appName" -H "accept: application/json" -H "X-API-Token: $appcenterToken" -H "Content-Type: application/json" -d "{ \"permissions\": [ \"developer\" ]}"

In this script, we first add a team defined in AppCenter settings as viewers (role that will allow them to view and download all data but cannot make changes) for our app using POST command. And, then we modify group permissions and assigned the team the developer role so that they can manage app services (e.g. create builds, run tests). That’s all.

Hope it was helpful.

#DevOpsGuy

--

--