How To Setup Power Apps Co-Authoring – Azure Dev Ops Version

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:
• IntroductionWhat Is Git And How Does It Provide Version Control?Enable Collaboration With Git Version ControlConnect Power Apps to A Git RepositoryChoosing A Git Repository HostSign Up For A Free Azure Dev Ops AccountCreate A New Repository In Azure Dev OpsInput Azure Dev Ops Repository Information In Power AppsCreate A Personal Access TokenSign In To The Azure DevOps RepositoryFinish Git Version Control SetupSharing Power Apps With Another Developer As A Co-OwnerLogin To A Power Apps App At The Same Time As Another DeveloperCommit Changes And Check For UpdatesView Power Apps Source Code In An Azure Dev Ops RepositoryAdditional 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.

FieldValue
Git repository URLhttps://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
Branchmain
Directory Nameapp



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.





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.

Matthew Devaney

Subscribe
Notify of
guest
21 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Karan Khosla
Karan Khosla
8 months ago

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.

Jin
Jin
8 months ago

Great Post Matt, Thanks for sharing

Reiner Knudsen
8 months ago

Your “dev.azure.com” link has the GitHub-link behind it. (paragraph Sign Up For A Free Azure DevOps Account)

Last edited 8 months ago by Reiner Knudsen
Waheed Ahmed
Waheed Ahmed
7 months ago

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 Ahmed
Waheed Ahmed
7 months ago

Thank you Matthew. Its amazing article and I picked up alot from it.

Steve Tyler
Steve Tyler
5 months ago

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.

Screenshot 2022-04-06 165741.png
Darren Neese
5 months ago

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!

Oana
Oana
2 months ago

Also happened to me and it seems to be a bigger issue, others have also encountered it. Hope it will be fixed soon enough!

Bogdan
Bogdan
5 months ago

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
Bogdan
5 months ago

Hi Matthew,

Yes I did use the personal access token. The token has full access to Azure DevOps as well.

Michael
Michael
5 months ago
Reply to  Bogdan

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
Michael
4 months ago

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.

Stephane Tardif
Stephane Tardif
4 months ago

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,