AppCenter and Azure DevOps

Cost-effective Azure Devops and AppCenter integration

Yoshevski
5 min readJul 9, 2020

Most of the times we want to provide option to the client to be able to download and test the application before we submit it to the stores *it refers to mobile applications
Sometimes the initial development before an actual release version can take longer to be done, but that shouldn’t stop us from sending artifacts to the customers to test the applications while development.

At the moment both GooglePlay and AppStore are offering their individual services for testing, and when you work with Hybrid development it seems that it takes too much effort to publish version for testing purposes.
Having that in mind AppCenter (https://appcenter.ms) comes as a good solution for the process.

Here you can manage both platforms (or even more than two) from a same panel, and grant different access to different groups or users, while also you can get application usage analytics and crash reports. This platform also comes in handy if you use Azure DevOps since it has great integration and using pipelines makes the process even easier to deploy application for testing.

There are different ways how to integrate this two platforms, but in this article you will have the opportunity to see the cost-effective one, since it won’t increase the expenses on Azure for your account.
This means builds of the application will be made locally and only delivery will be automated.

So here is what you need to do:

Setup AppCenter

Create new app in appcenter
Go to app center and create a new application, where you will have to choose the platform and technology used, while also provide application name

Create new app

*name of the application can be anything

Then on the new screen, you will get instructions of how to apply the “appcenter-sdk” to your application, in order to get analytics and logs for your application.

Add AppCenter SDK to App

With this, you have completed the first step of the AppCenter setup, now go to settings screen and from there select Add API tokens.

This will open a new screen for you, where you can create new API token which will be used to integrate with Azure DevOps.

Click on New Token and fill the form by providing a name for the token (usually something that will serve you as hint, were this token will be used), and select access that you want to provide with this token.

Generate token

In our case “Full Access” will need to be used, so the Azure DevOps will have all necessary permissions to AppCenter.

Click on “Add new API token” at the bottom of the panel, and you will get a new popup with a key that you have to copy it and store it on a safe location.

With this you have completed all necessary steps for AppCenter. So now you can move to the Azure DevOps panel.

Setup Azure DevOps

Once you login to Azure DevOps and you open your project there, go to Settings and select Service connections, here you will have to create new connection between Azure DevOps and AppCenter with the token you have created previously.

Click on “New service connection” and in the sidebar look for “Visual Studio App Center”

VSAC

Select the package and click on next, and then provide the AppCenter token in the form that will appear.

Provide necessary details like Service Connection Name, and Security, and when you are ready click on save.

Pipelines config

Then go to Pipelines, and select the git repository where your code is located.

On the next screen select your application from the list and move to next screen to select configuration, where you will have to choose “Starter Pipeline” which will create new YAML file with minimum setup in it.

In the final step you will get a new editor with contents of the YAML file, where you can setup what process needs to be executed. Since we will do only distribution of artifacts (and build of them will be made locally on PC to avoid spending resources on Azure)

When in editor, click on “Show Assistant”, from where you will have to select what kind of task / script you will run.

Show Assistant

From the assistant select “App Center distribute”

Select Task

where you will have to specify data related to the AppCenter in order job to run properly.

App Center config

In the configuration form for AppCenter fill following thing:
1. App Center service connection — select the connection that you had made before in the settings area.

2. App Slug should be combination of your AppCenter username and app name where from the url of the app:
https://appcenter.ms/users/{username}/apps/{appname}
you should get {username}/{appname} as appSlug.

3. Then provide the location of the APK/IPA file, where you should provide relative path to the file from root of your git repo directory.

4. Under Symbols select the proper platform and click on Save

You should have similar YAML result as this:

Save the YAML file, and you are ready for your push and auto deploy to app center.
*Make sure you push the APK file in the branch that is selected under trigger: in YAML file, to trigger the job and distribution.

If all goes well in AppCenter you will see your files, and all testers in the default group will get update for new available version for test.

Thanks for reading, and follow me if you like the story while also check all other new and old stories https://medium.com/@yoshevski

--

--

Yoshevski
Yoshevski

Written by Yoshevski

Long time in the IT field as fullstack developer.

Responses (1)