-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{AzureContainerApp} fixes Azure/azure-cli-extensions#5743 PermissionError for temp file #5749
Conversation
fixes Azure#5743 PermissionError for temp file We get the below error When executing az containerapp up without Dockerfile on Windows OS, PermissionError occurs at the ACR task creation step. It seems that temporary files cannot be accessed. This issue can be reproduced on Windows Sandbox also. And it was succeeded to deploy this app from WSL(Ubuntu 22.04) by executing the same command. ``` File "C:\Users\WDAGUtilityAccount\.azure\cliextensions\containerapp\azext_containerapp\_up_utils.py", line 407, in run_acr_build self.build_container_from_source(image_name, source) File "C:\Users\WDAGUtilityAccount\.azure\cliextensions\containerapp\azext_containerapp\_up_utils.py", line 375, in build_container_from_source acr_task_create(self.cmd, task_client, task_name, registry_name, context_path="/dev/null", file=task_file.name) File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/acr/task.py", line 137, in acr_task_create File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/acr/task.py", line 292, in create_task_step File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/acr/_utils.py", line 266, in get_yaml_template PermissionError: [Errno 13] Permission denied: 'C:\\Users\\WDAGUT~1\\AppData\\Local\\Temp\\tmpaa2d2k9z' ```
AzureContainerApp |
It seems that there is no code for removing the temp file after creating an ACR task. Isn't it needed? |
@horihiro Thanks for the suggestion. I have committed the suggestion now. It is currently under review. |
@navba-MSFT |
@Juliehzl Thanks for reviewing this. Your suggestion has been incorporated and the tests are passed. Could you please review and approve once you get a chance ? Thanks in advance. |
fixes #5743 PermissionError for temp file
We get the below error When executing az containerapp up without Dockerfile on Windows OS, PermissionError occurs at the ACR task creation step. It seems that temporary files cannot be accessed. This issue can be reproduced on Windows Sandbox also. And it was succeeded to deploy this app from WSL(Ubuntu 22.04) by executing the same command.
Since the behavior of NamedTemporaryFile depends on OS. Hence this is failing on windows and works on WSL Ubuntu.
This PR fixes this issue.
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.json
automatically.The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify
src/index.json
.