Add .webappignore and .funcignore Support for Service Packaging#4258
Add .webappignore and .funcignore Support for Service Packaging#4258jongio wants to merge 23 commits into
.webappignore and .funcignore Support for Service Packaging#4258Conversation
|
This seems helpful, per discussions on the other PR! My main design question would be why a separate file versus an --ignore in the azure.yaml. Is it easier to define globs that way? Does YAML have annoying syntax restrictions? |
One of the reasons was for making this new ignore-file recognizable beyond azd; so you could use it when using web-app-deploy action (https://github.com/Azure/webapps-deploy) or your own tools. @jongio was going to check with App Service if there was something already for it and if not, it might be worth it to have it beyond azd; similar to .dockerignore, .npmignore, etc. Then azd would just honor this file like any other tool would. |
Yes, I'm in talks with them on this. |
|
Ah, cool, that design makes sense then! |
|
Comment from @Petermarcu
@ellismg - You first suggested .zipdeployignore, we landed on .zipignore because it's not necessarily part of the deploy action, instead it is part of packaging. We want the file name to be generic enough to be used by other app service related tooling. In the same vein as .funcignore, .dockerignore, should we name this .webappignore? |
|
Is this only going to be respected for app service services? |
Yes, most of the other services already have .*ignore files, .funcignore, .dockerignore |
|
Related: #4215 |
@ellismg - I've confirmed with the web app and functions teams that they would prefer |
.zipignore Support for Service Packaging.webappignore and .funcignore Support for Service Packaging
|
@wbreza @vhvb1989 @ellismg - Could you have a look at the updated code and PR description with all the changes? I'm in discussion with the appservice team and the approach with .webappignore and .funcignore are aligned with them. @pamelafox - Once we get a build could you verify this works as expected in your projects with and without .webappignore files? (You'll obviously need to create the .webappignore file in the project this impacts) @v-xuto - Can you please run manual regression / smoke tests on all the azdev ToDo templates and ensure that everything passes? Thanks! |
Do you also want to run the azdev ToDo templates through the validation pipeline with this change? cc @anfibiacreativa |
Got it. Testing. |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
|
Hi @jongio. Thank you for your interest in helping to improve the Azure Developer CLI experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
|
Hi @jongio. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing "/reopen" if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the "no-recent-activity" label; otherwise, this is likely to be closed again with the next cleanup pass. |
Fixes: #1039 #4215
Description:
This PR introduces support for
.webappignoreand.funcignorefiles to the service packaging process within the Azure Developer CLI (azd). These files allow users to specify files and directories that should be excluded from the deployment package for App Service and Function Apps, providing fine-grained control at the service level.Key Updates:
.webappignoreand.funcignoreFile Support:.webappignorefor App Services and.funcignorefor Azure Functions within individual service directories..webappignoreor.funcignorefile exists in a service directory, the packaging process will follow its rules, allowing granular control over which files are included or excluded in the service's zip archive.Updated Exclusion Logic:
__pycache__,.venv, andnode_modulesunless a.webappignoreor.funcignorefile is present, which can override these default exclusions..webappignorefile is present in an App Service, directories such asnode_modulesor__pycache__can be included or excluded as specified..funcignorecan similarly be used to specify inclusion/exclusion rules..webappignoreor.funcignorefile is present, default exclusions apply for Python (__pycache__,.venv) and Node.js (node_modules).Test Coverage:
.webappignoreand.funcignorefiles.__pycache__,.venv, andnode_modulesbased on the presence or absence of the ignore files..webappignoreand.funcignorebehavior is correctly respected.logs/log.txtcan be excluded based on the ignore file configuration.Sample Project Structure:
.webappignorefiles explicitly include or excludenode_modulesor__pycache__based on real-world usage patterns.Documentation:
.webappignoreand.funcignorefiles with examples for both Python and Node.js projects.Testing:
All test cases have been successfully executed, covering a broad range of scenarios to ensure expected packaging behavior. The tests ensure that both
.webappignoreand.funcignorefiles are respected and that default exclusions are correctly applied when no ignore file is present.Additional Notes:
.webappignoreor.funcignorefiles into their services.How to Review:
.webappignoreand.funcignorefiles influence the exclusion logic.