azure-dev: [Issue] azuretools.azd: ##[error]EPERM: operation not permitted, symlink '...\azd-install\azd-windows-amd64.exe' -> '...\azd-install\azd.exe'
- [ ] Make sure you’ve installed the latest version using instructions in the wiki <-- Does not apply
Output from azd version
NA… trying to install it
Describe the bug
After installing the azuretools.azd extension, when running setup-azd@0 on Self-Hosted Agent, it results in an error:
##[error]EPERM: operation not permitted, symlink '...\azd-install\azd-windows-amd64.exe' -> '...\azd-install\azd.exe'
To Reproduce
Run an Azure DevOps Pipeline with setup-azd@0 task
Expected behavior No error 😃
Environment Information on your environment: * Language name and version NA * IDE and version : [e.g. Visual Studio 16.3] NA
Additional context Thank you for all your efforts out there. They are appreciated. 🙏
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 20 (10 by maintainers)
@v-xuto @hemarina can you triage this? cc @vhvb1989
OK one less mystery to worry about @hemarina 😅 Thank you for the clarification 🙏
@Mike-E-angelo I used
Network Servicefor reproduction according to https://github.com/Azure/azure-dev/issues/4282#issuecomment-2328207422. It works withsetup-azd@0and resolves permission issue if you useSystem.@Mike-E-angelo , according to this: https://stackoverflow.com/questions/66361808/what-permissions-are-needed-for-the-azure-devops-deployment-group-agent:
You might want to look at this.
Thanks for your feedback @Mike-E-angelo
This is not possible by OS design. Applications can’t auto-elevate its access permissions and more important, they shouldn’t.
What you are facing is beyond Azure DevOps tasks. It is 100% related to how the self-host is configured to dispatch pipelines. Only the self-host owner should be able to set what OS user handles the pipelines and what permissions that user has.
A local system account is used to run your pipeline in the self-host machine. You need to know what that account limits are and set it up.
The account might not only fail for the install azd task, but for any application trying to write files in disk.
The install azd taks is getting an
OS - access errorwhen trying to write a file to this path:You can try to set up the account in the self-host to be able to write new files in that path by running a pipeline with a pwsh task to write and move files. I think that, since the path where the account is running was not created by that account (but with another account), there is no access allowed. Make the
NT AUTHORITY\SYSTEMaccount an owner of theC:/agentpath@rajeshkamal5050, We can reproduce this issue when running an Azure DevOps Pipeline with
setup-azd@0task on Self-Hosted Agent. Besides, when runningsetup-azd@0on thewindows-latestvmImage in the Microsoft-Hosted Agent, this issue no longer reproduces.Hi @rajeshkamal5050 I did look into this and it’s running under
NETWORK SERVICE. I tried giving this folder Full Control to this account specifically and propagating this down to all children but the problem still persists. I am open to any further suggestions on how to address this.