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)///____________________'nrnC:Program FilesGitcmdgit.exe
remote add -t master origin "[email protected]:_____"
(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)///_________________.
According to my local file system, I’m already the owner of the directory.
I tried following some of the steps outlined in the answers to this question, but I am reluctant to do git config --global --add safe.directory '*'
because it is a shared repository.
Could this issue be caused by Azure itself? Do I need to grant Azure permissions somehow?
Thanks
2
Answers
I recommend using the steps below:-
Make sure you run this command to add the repository in the safe list like below:-
And then try pushing your code again by adding correct git remote url like below:-
And in order to resolve the error Check this SO thread answer by Stinn and halt9k
Then I tried deploying a sample
.NET application
in Azure Web app with.NET 6.0 framework
and it got deployed successfully like below:-My github action workflow:-
To provide an update, there was a bug identified. The fix has been rolled out by our product engineering team.
(tracked on Microsoft Q&A here)