Azure deployment fails with: 'fatal: detected dubious ownership in repository at'

Ford 15 Reputation points
2023-09-12T00:21:11.3766667+00:00

I'm working with a ASP.NET application and I deploy using Azure and Git. It's set to trigger deployment when the Master branch gets pushed to.

I've successfully done this in the past but it's failing now. I can successfully push my code to GitHub where it appears each time, but it fails to deploy on Azure.

From the Deployment Center, I see that the commit id is prefaced with "temp" like "temp-XXXXXX". It also leaves an error message in the log details that says:

"fatal: detected dubious ownership in repository at _______ is owned by: ________ 
but the current owner is _______. 

git config --global --add safe.directory '%(prefix)///____________________'\n\r\nC:\Program Files\Git\cmd\git.exe 
remote add -t master origin "******@github.com:_____"

(The blanked out info is full IP addresses with subdirectories and repository names, I didn't think it mattered because this seems like a generic issue)

I tried adding the parent directory to safe.directory using the exact command that they provided, but received an error of "no such file or directory: %(prefix)///_________________.

I've seen a similar question here: [https://learn.microsoft.com/en-us/answers/questions/1356814/deploy-and-build-from-source-code-on-bitbucket-(gi](https://learn.microsoft.com/en-us/answers/questions/1356814/deploy-and-build-from-source-code-on-bitbucket-(gi)

But I am reluctant to do git config --global --add safe.directory '*' because it is a shared repository.

Thank you

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,935 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2023-09-18T18:58:34.84+00:00

    @Ford ,

    Following-up with an update. ( tracked here)

    The fix has been rolled out by our product engineering team. Kindly check and let us know if you are still seeing this issue.

    Thanks for your patience.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.