Skip to content
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

[Issue] Deployed zip does not obey .funcignore #1039

Open
1 task done
pamelafox opened this issue Oct 31, 2022 · 2 comments · May be fixed by #4258
Open
1 task done

[Issue] Deployed zip does not obey .funcignore #1039

pamelafox opened this issue Oct 31, 2022 · 2 comments · May be fixed by #4258

Comments

@pamelafox
Copy link
Member

Output from azd version

azd version 0.3.0-beta.4-pr.1945868 (commit 3aadf6d)

Output from az version

{
  "azure-cli": "2.40.0",
  "azure-cli-core": "2.40.0",
  "azure-cli-telemetry": "1.0.8",
  "extensions": {
    "containerapp": "0.3.11",
    "containerapp-compose": "0.2.2"
  }
}

Describe the bug

I'm fairly certain that azd is zipping up everything in the folder and not ignoring files/folders in funcignore which I would expect to be ignored.

I suspect that because 1) zipping my little function folder takes a lot longer than I'd expect and 2) I see no evidence of funcignore parsing in codebase, and I see this TODO here about ignoring files:

// TODO: should probably avoid picking up files that weren't meant to be published (ie, local .env files, etc..)

To Reproduce

  1. git clone https://github.com/pamelafox/regression-model-azure-demo at 6d8c7e76981186663f888a1f7cd55308b2ce0f3f
  2. Run azd up
  3. Browse "App Files" in Azure Portal, still see .DS_Store

Expected behavior

I expect it to not zip up files/folders specified in .funcignore

Environment

Mac OS X Ventura

Additional context

I can reorganize my project structure to avoid such a large deploy, but I think it'd be good to support .funcignore for consistency with other ways to deploy function apps.

@ashikns
Copy link
Contributor

ashikns commented Apr 6, 2024

+1 to this issue. I've had to restructure a project to avoid the frontend node_modules folder getting published. Another problem is that local.settings.json also gets published, which can contain sensitive info like connection strings.

Is there any workaround to this issue?

@weikanglim weikanglim self-assigned this Aug 9, 2024
@jongio
Copy link
Member

jongio commented Sep 23, 2024

@pamelafox and @ashikns - I have a PR out that should resolve this issue. Can you please try that PR and confirm is resolves this?

#4258

You will need to add a .funcignore file to the root of the service folder you want azd to honor.

/src/service1/.funcignore.

Thanks
Jon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants