-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add .webappignore
and .funcignore
Support for Service Packaging
#4258
base: main
Are you sure you want to change the base?
Conversation
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few comments
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
|
Fixes: #1039 #4215
Description:
This PR introduces support for
.webappignore
and.funcignore
files 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:
.webappignore
and.funcignore
File Support:.webappignore
for App Services and.funcignore
for Azure Functions within individual service directories..webappignore
or.funcignore
file 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_modules
unless a.webappignore
or.funcignore
file is present, which can override these default exclusions..webappignore
file is present in an App Service, directories such asnode_modules
or__pycache__
can be included or excluded as specified..funcignore
can similarly be used to specify inclusion/exclusion rules..webappignore
or.funcignore
file is present, default exclusions apply for Python (__pycache__
,.venv
) and Node.js (node_modules
).Test Coverage:
.webappignore
and.funcignore
files.__pycache__
,.venv
, andnode_modules
based on the presence or absence of the ignore files..webappignore
and.funcignore
behavior is correctly respected.logs/log.txt
can be excluded based on the ignore file configuration.Sample Project Structure:
.webappignore
files explicitly include or excludenode_modules
or__pycache__
based on real-world usage patterns.Documentation:
.webappignore
and.funcignore
files 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
.webappignore
and.funcignore
files are respected and that default exclusions are correctly applied when no ignore file is present.Additional Notes:
.webappignore
or.funcignore
files into their services.How to Review:
.webappignore
and.funcignore
files influence the exclusion logic.