Azure WebApp, SQL and Github

Using the documentation here and here, I was able to setup a Container WebApp in Azure with SQL.

I tried configuring Git integration by setting up a free github account, creating a private repository and a Personal Access Token like the documentation states.
I have tried it with a username and password too but I keep getting the same error every which way:

repository path '/home/Repository' is not owned by current user (Computer: 3fe57e07a9c5)

The config is stored correctly in the Azure SQL Database.

Where am I going wrong?

Product: PowerShell Universal
Version: 5.4.3

I’ve never actually seen this issue on Linux. It’s a git issue where the repository git directory was created with one user and then another user is attempting to use the directory in PSU.

An issue should probably be raised for this since I have seen this before. Adding some sort of tool to provide the configuration necessary would be good. I don’t think PSU should do it automatically since it would break the security put in place in git.

If you could raise an issue that would be great.
Using git from the WebApp is something we want to use.
We are licensed.

Thanks.

1 Like

Hey Adam!

Is there any work around for this or an ETA of a fix?

Currently trying to get a POC setup on a 2 week trial license :smiley:

Thanks!

@adam
My Azure Webapp is now on PSU docker version 5.6.11-azure
I understand the Repository owner should now be fixed, however I still get the owner error.

LibGit2Sharp.LibGit2SharpException: repository path '/home/Repository' is not owned by current user at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 154 at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 172 at LibGit2Sharp.Core.Proxy.git_repository_open(String path) in /_/LibGit2Sharp/Core/Proxy.cs:line 2560 at LibGit2Sharp.Repository..ctor(String path, RepositoryOptions options, RepositoryRequiredParameter requiredParameter) in /_/LibGit2Sharp/Repository.cs:line 159 at LibGit2Sharp.Repository..ctor(String path) in /_/LibGit2Sharp/Repository.cs:line 70 at PowerShellUniversal.Git.GitService.FetchAsync() in D:\a\powershell-universal\powershell-universal\src\PowerShellUniversal.Git\GitService.cs:line 868 at Universal.Server.Pages.Settings.Git.ChangeBranchSelect.FetchAsync() in D:\a\powershell-universal\powershell-universal\src\Universal.Server\Pages\Settings\Git\ChangeBranchSelect.razor:line 35

I can see the .gitconfig file in the /home directory.

it contains:

[safe]
directory = *
directory = *
directory = *
directory = *
directory = *

There is also /home/repository/.git folder, automatically created after adding the git config so that seems good.

My goal is to store and sync with Azure Devops.

I have a fixed Enviromental Variable: NodeName , so it keeps a consistant computer name.

In addition the Logging has about 20 of these Errors every day:

[12/9/2025 4:09:46 PM] [Error] [ModuleDiscovery-PowerShell 7] Error (PowerShell 7) - Status(StatusCode="Unknown", Detail="Exception was thrown by handler.", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1765289386.847593774","description":"Error received from peer ipv4:127.0.0.1:43353","file":"/var/local/git/grpc/src/core/lib/surface/call.cc","file_line":953,"grpc_message":"Exception was thrown by handler.","grpc_status":2}") 

Hope you can help.

Did you ever get this sorted? I’m having the same issue with the same setup as you.

I couldn’t find an entry to see if an issue was raised for this.
I just had a quick look and have commented on these git issues:

Added the following to start.sh to resolve:

#!/usr/bin/env bash

set -euo pipefail

# If git exists, mark repo as safe (avoids “dubious ownership” style errors)

if command -v git >/dev/null 2>&1; then

git config --system --add safe.directory * || true

fi

exec ./Universal/Universal.Server