How To Setup Power Apps Co-Authoring – Azure Dev Ops Version
Author’s note: Two weeks ago I published a tutorial on how to setup Power Apps Co-Authoring with Github. Many readers of this blog use Azure Dev Ops for source control instead of Github and requested another version of the same tutorial. This is the exact same tutorial but for Azure Dev Ops. Enjoy!
Multiple Power Apps developers can now work together on the same canvas app and see each other’s changes! This is an exciting new feature Power Apps developers have wanted for a long time. We can open the same app as another developer without seeing a locked for editing message and we no longer need to create multiple copies of an app during development. In this article I provide step-by-step instructions for setting co-authoring for canvas apps and explain the new concepts you’ll need to know including: git, Azure Dev Ops, version control and repositories.
Table Of Contents:
โข Introduction
โข What Is Git And How Does It Provide Version Control?
โข Enable Collaboration With Git Version Control
โข Connect Power Apps to A Git Repository
โข Choosing A Git Repository Host
โข Sign Up For A Free Azure Dev Ops Account
โข Create A New Repository In Azure Dev Ops
โข Input Azure Dev Ops Repository Information In Power Apps
โข Create A Personal Access Token
โข Sign In To The Azure DevOps Repository
โข Finish Git Version Control Setup
โข Sharing Power Apps With Another Developer As A Co-Owner
โข Login To A Power Apps App At The Same Time As Another Developer
โข Commit Changes And Check For Updates
โข View Power Apps Source Code In An Azure Dev Ops Repository
โข Additional Considerations For Power Apps Co-Authoring
Introduction
With Power Apps multiple developers can work on an app at the same time to speed up the development process. Here’s what collaboration between two developers looks like in Power Apps.
Both developers in the example below have the same app open. The 1st developer on the left side adds a titlebar to the screen and some text. Then the 1st developer presses the sync button to save and commit the changes. The 2nd developer on the right-side wants to see the changes made by the 1st developer. So the 2nd developer also presses the sync button and the titlebar & text appear.
What Is Git And How Does It Provide Version Control?
For multiple developers to collaborate in Power Apps the experimental Git Version Control setting must be turned on. Git is a tool software developers use for version control – a way to track who made what changes to an app and when. It also allows developers who are working on their own instance of the app the ability to merge their code with one another. If an issue arises with the app’s code, the developers can use Git to compare the changes between each app version and revert to a previous one.
Enable Collaboration With Git Version Control
If more than one developer tries to open the same app the message “Power Apps is locked for editing. Contact the user or wait for them to close the app” will appear.
When Git version control is enabled multiple developers can work on the same app and the locked for editing message will no longer appear. How is this made possible? Power Apps opens a separate instance of the app in Studio Mode for each developer. Each time a developer saves their work it gets committed (i.e. saved) to a shared Git repository (a folder). Saving merges the new code with existing code in the repository contributed by other developers. Then the freshly merged code is downloaded into Power Apps Studio for the developer to continue working on.
Go to the Settings menu in Power Apps then browse to the Upcoming Features section. Look for the Show the Git version control setting in experimental features and turn it on.
Connect Power Apps to A Git Repository
Once the show the Git version control setting is switched we must connect Power Apps to a Git repository. Navigate to the Git Version Control section of the settings menu and select Connect.
A form appears asking for the Git repository URL, branch and directory name. To fill-in these fields, first we will need to create a Git repository. This is something done outside of Power Apps.
Choosing A Git Repository Host
Git is a generic tool and there are many online services that can host a git repository. Which host should you choose for Power Apps? I recommend these two services offered by Microsoft and each one has a free tier:
- Github – the most popular open-source community in the world
- Azure DevOps – a collaboration tool for developers which also includes git repositories
For this tutorial, we will use Azure DevOps because this is Hitachi Solutions preferred option.
Important: If you choose an alternate service please note that Power Apps co-authoring does not support on-premise repositories at this time.
Sign Up For A Free Azure DevOps Account
Go to dev.azure.com and login to your account. If you don’t have an Azure Dev Ops account you can sign up for free. We only require the free-tier to setup a git repository for multiple developers to collaborate in Power Apps.
Create A New Repository In Azure Dev Ops
Next we create a new repository to hold our Power Apps app. Create a new project in Azure Dev Ops. Then select Repos from the left-navigation menu.
Initialize the repository’s main branch with a README.md file.
The Azure Dev Ops repository is now created. We can get the location of the repository from the URL in the address bar of our web browser.
Input Auzre Dev Ops Repository Information In Power Apps
Switch back to Power Apps and fill-in the Connect a Git repository form with these values. Click apply when done.
Field | Value |
Git repository URL | https://dev.azure.com/organization_name/project_name/_git/repo_name Example: https://dev.azure.com/md0453/Power%20Apps%20Co-Authoring/_git/ Power%20Apps%20Co-Authoring |
Branch | main |
Directory Name | app |
The Git repository URL is a web address we can type into to our web browser to view the repository. App is the name of the folder where our Power Apps source code will be stored. Power Apps does not allow the source code to be stored in the repository’s root folder.
Main is the name of the default development branch. In traditional software development branches (i.e. copies) of the app are made to work on specific features and then are merged back into the main branch once the feature is complete. Power Apps only operates on the main branch.
Important: we must choose a directory name that does not currently exist in the repository and allow Power Apps to create it. If the directory name already exists Power Apps will fail to connect.
Create A Personal Access Token
A special type of password called a personal access token is required for Power Apps to sign into the Azure Dev Ops repository. One developer will make the personal access token and share it with the rest of the development team. We must go back into Azure Dev Ops to create one.
Important: a personal account token is not your Azure Dev Ops account password.
Open Azure Dev Ops and click on the avatar in the top-right corner. Select Personal access tokens.
Create a new token.
Name the personal access token, choose an expiration and check the full checkbox to give Power Apps full control over the source code and then click Create.
Sign In To The Azure Dev Ops Repository
Azure Dev Ops will open to the Success screen after clicking Create token. Copy the personal access token to the clipboard.
Important: make sure you save the personal access token for future use. We can only see the token once. It will be needed each time any developer opens the app to make an edit.
Then go back to Power Apps and sign-in with your Azure Dev Ops username and your personal access token for the password.
Finish Git Version Control Setup
Almost done. One more prompt appears asking if we want to create a new branch in the repository. Select Yes.
We have now setup Git Version control setup in Power Apps.
Sharing Power Apps With Another Developer As A Co-Owner
With git version control now setup multiple developers can now work on the same Power Apps app. But we still have to share the app and the Azure Dev Ops repository with those developers. Go-to make.powerapps.com, browse to the app we connected to Azure Dev Ops , click on the three dots and select Share.
Search for the other developers you want to give access to app and click the checkbox to make them co-owners. Select Share when done.
Login To A Power Apps App At The Same Time As Another Developer
Multiple developers can now work on a single Power Apps at once. Let’s test the feature to ensure it is working. Ask the developer you shared the app with to open it in Power Apps Studio while we are logged-in.
The 2nd developer will be prompted to sign into the Azure Dev Ops repository with a username and password.
- Username – this is the developer’s Azure Dev Ops account username, not their Power Apps user name. The developer will need to sign-up for an account if they don’t already have one.
- Password – this is the personal access token we previously created, not the developer’s Azure Dev Ops account password.
Once completed Power Apps will open normally.
Commit Changes And Check For Updates
Both developers are now working inside the same app. How can they view each other’s progress? Power Apps does not have a live-editing feature like Word, Excel or PowerPoint Online. Developers must save and sync their changes manually. This serves a purpose – we do not want to push unfinished code onto the other developers screen and cause errors.
When have completed a feature we want to push it the the git repository so the other developer can update their instance of the app. To do this press the sync button on the top menu of Power Apps Studio. Doing this commits our changes to the repo, merges them with the existing code and updates our app to show any changes done by other developers.
Important: If two developers work on the same property of a control the last edit made wins. The older change gets replaced by the newer change. We need to plan in advance who is working on which features/sections of the app to ensure we don’t overwrite each others work.
Here’s what the save & sync looks like for two developers working on the same app.
View Power Apps Source Code In An Azure Dev Ops Repository
After Power Apps Studio syncs the app to repository we can go view the source code in Azure Dev Ops. Go the folder multiple-developer-canvas-app/app/Src and select the yaml file for the screen we edited in Power Apps. All code for the screen, its controls and their properties is found here.
We can do some very useful things with the Power Apps source code in Azure Dev Ops:
- Quickly conduct a code review – it is easier to review all of the code for a screen in Azure Dev Ops than to browse each individual control and their properties in Power Apps
- Edit the raw code – if we press the period key (.) while looking at the screen in Azure Dev Ops it will open the yaml file in an online Visual Studio Code editor. Once any updates are made we can press the sync button in Power Apps Studio to see the changes
- Rename Variables/Collections – Visual Studio code has the ability to find and replace text across all files and folders. This makes it easy to rename variables and collections for the entire app. Press the key combination CTRL + SHIFT + F to use the Find and Replace In Files feature.
- For more ideas on what we can do with Power Apps in the Visual Studio Code editor check out this article.
Additional Considerations For Power Apps Co-Authoring
There are few more things you should know about Power Apps co-authoring before using it:
- This is an experimental feature and it should be treated as such. Do not use it in a production app until you are sure it works. It is not the final product and more features/changes will be made before co-authoring is made generally available.
- New Power Apps must be setup for collaboration individually. There is no way to enable a global setting for all apps to allow multiple developers working at the same time.
- An app connected to git cannot be disconnected from it currently. The only option is to remove the git repository.
- There no setting is available to restrict a personal token’s access to a single repository. Once a personal access token is granted it gives access to all repositories under the same account. Each developer must use the same personal access token.
Did You Enjoy This Article? ๐บ
Subscribe to get new Power Apps articles sent to your inbox each week for FREE
Questions?
If you have any questions about How To Setup Power Apps Co-Authoring – Azure Dev Ops Version please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.
Great post Matthew Devaney thanks for sharing this!! Is there a way to add commit messages ( comments made to a commit ) ? Reverting to a previous commit is easier if there is a comment associated to it.
Karan,
Yes, you can add a commit message by going to File –> Save, then type your commit comment and press save. It will appear in the version history.
Great Post Matt, Thanks for sharing
Your “dev.azure.com” link has the GitHub-link behind it. (paragraph Sign Up For A Free Azure DevOps Account)
Reiner,
Thanks for the note. I have fixed the link.
as part of build pipeline I first install power tools, export solution, unpack solution, using command line push the managed solution to Azure Repo, finally publish the artifacts
after that I manually kick-off Release pipeline which deploys the artifacts to production environment. I want to trigger build pipeline as soon as developer publish the power app is that possible?
Waheed,
I don’t know of any way to automatically trigger a pipeline build upon a user publishing a Power Apps app. I’ve done many pipeline builds but I’m not aware of a technique.
Thank you Matthew. Its amazing article and I picked up alot from it.
Thanks for the post Matthew and I’ve been struggling with this for a while. I’ve set the access rights of the PAT and it all connects ok to my repo, but when I try to edit the app, it asks to login again and then gives an error below. Do you have any ideas, or is this one for MS support? Thanks again.
Steve,
I am sorry, but I have not encountered this error before ๐
I set this up today in one of my environments where I needed to work as a team on a canvas app. We both got in and were making changes, saving, and syncing. Then boom, I get locked out. Wondering if this is just us for now, or if this is a weird bug they have yet to iron out (I guess it still is an “experimental” feature, right). But, it would be nice to know if others are experiencing it.
Thanks, Matt!
Darren,
Let’s see if any others respond to this post with a similar issue.
Also happened to me and it seems to be a bigger issue, others have also encountered it. Hope it will be fixed soon enough!
Hi Matthew, thank you for the very thorough and well-written post. However, when I follow the steps, I keep getting the message “Invalid username or password. Please try again.”
I configured the personal access token to have full access and used it as a password, while for the username I am using my full email. Any idea why this might be happening?
Thanks again!
Bogdan,
Did you use the personal access token in the password field? I got this message because I tried to supply my username and password. What is really wanted was my username and the personal access token in the password field.
Hi Matthew,
Yes I did use the personal access token. The token has full access to Azure DevOps as well.
I also have experienced the same issue as Bogdan where I’ve used my personal access token in password field and keep getting invaild username and password. I wish there’s more guidance on how to troubleshoot this.
Michael,
I remember having this frustration as well. Did you remember to setup the personal access token as full access?
hi Matthew,
Yes, the token has full permissions to the repository. I even created one right now just to make sure and it gave me the same error.
Hi Matthew,
I set up a GIT through Azure DevOps and shared with a colleague per the instructions indicated above. It worked the first day, but since then one user is locked when the other is in the application. Could it be that I created the repository but my colleague is the actual owner of the PowerApp app?
Thanks,
Steph,
No, I think it’s just not working properly because the feature is still experimental. I suggest you log the issue here so the Power Apps team to can see it: https://powerusers.microsoft.com/t5/Power-Apps-Experimental-Features/bd-p/PA_ExperimentalFeatures
Matt do you know when this is coming to the Government Tenant?
Matthew,
Nope. Sorry. I don’t have the timelines for releases handy. Something only Microsoft knows ๐
Matt, great article, as always.
Just as a FYI, there is now a disconnect button on the ‘Git version control’ setting which allows you to disconnect your app from the repo.
Also, it seems that you can now use branches other than the main branch.
Guillaume,
There’s a disconnect button now? That’s excellent news. Thank you for sharing ๐
Hi Matthew, Very helpfull article thank you for sharing.
I have a query, If 3 developers are working on the same app and is it possible to release only features worked by 2 devs and hold 3rd dev’s for next. Please let me know how this can be achieved.
Renu,
Not really. Unfortunately, co-authoring is not all that sophisticated. I wish we could develop on separate feature branches and push pull from a repo like normal code.
Thanks for the detailed post on PA+ GIT setup. The only bummer I realized today is that once GIT versioning is enabled, PA apparently stops saving version comments to the PA – Version notes and only submits them to GIT when I click Commit button in the PA studio!
So I have all stuff nicely exported to GIT (source and version notes), but I lose the version notes which can help me to know which version to restore in PA, should the need for it arise. The only way to pair the commits back to PA app versions is the timestamp, which is far from ideal. I know I could perhaps try re-importing the app package from GIT back to PA, but again, far from ideal, integrated versioning.
EDIT: I ended up using the PA version number in the version comment to preserve the PA version <> GIT commit relationship
EDIT 2: to my previous comment:
finally i got the whole idea and see that the integration works fine: I can forget about PA versions completely, as the app gets restored to GIT version upon GIT update/app reload in studio, so all I need to restore to previous version is to revert the commit on GIT side.
Great explanation. I have a question, is it possible to work with multiple branches of a repository in power apps? So that each developer has their independent branch and can do operations such as later merging into a main branch?
Jorge,
Not it is not possible to do with a single canvas app.
Thanks for the post, Matt. In my case, I have integrated my Power Apps with Azure DevOps git and it is successful. When I Pack it in pipeline to import solution to UAT, it raised “Cannot find required file Customizations.xml” error.
Do you have any solution why customizations.xml is missing. Thanks.
Hi Matthew, is there any way to incorporate Pull Request functionality ? I tried doing that by setting review policy on the “main” branch and creating connections to new branches in Power Apps but ran into a whole world of trouble.
Martin,
Suggest you download the Power Platform ALM Accelerator. Thereโs a good example of how to do it in there.