-
Notifications
You must be signed in to change notification settings - Fork 259
Closed
Description
Repro:
- azd init -t todo-python-mongo
- azd provision
- azd deploy
- VSCode-> Run Task -> Start API (wait until the api is lauched)
- azd deploy:
Root Cause:
When the api is launched locally, a new folder is created inside the /api folder called api_env. This folder contains a virtual python environment where the application dependencies are installed and where the application is launched from.
Inside this folder, there are some folders which are symLinks to python binaries, like lib64:
When azd deploy runs, a zip file is created including all the content from /api folder, and the create zip implementation from azd does not support symLinks (it doesn't see it as a folder, but as a file, and failed to zip it).
As a workaround, before running azd deploy, we can delete the api_env.
Fix proposals:
- Make
azdto support excluding known folders while doingdeploy. Thepythonimplementation, for example, should tellazdto ignore theapi_envfolder when doingdeploy. With this approach, we could also skip adding the__pycache__folders to the zip (those folders are created when running the app locally as well). - Use a temporal folder when running the app locally. For example
/temp/azdlocalrun/api_env. - Use
azure.yamlor an extra file (likeapp.deploy.ignore) to define files/folder which should not be zipped and deployed to Azure. This strategy would allow customers to have control over the deployment files without depending onazd - Combine option 1 and 3, where
azdwould have a hardcoded list ofignore pathsand users can also extend the list with configuration files.

