Azure-docs: Significance of __app__

Created on 12 Mar 2020  Â·  7Comments  Â·  Source: MicrosoftDocs/azure-docs

I think it would be good to expand on the explanation of what "__app__" represents? I've gotten questions like =>

  • What if it's a different name like __myapp__?
  • Does func start look for that name specifically?
  • Is it configurable? Can the name change?
  • Does that layout work with the VS Code launch settings?

Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 azure-functionsvc cxp product-question triaged

All 7 comments

Hi @cecilphillip Thanks for reaching out. We will review and update as appropriate.

@cecilphillip It is main project folder (__app__) which can contain the following files:
local.settings.json:
requirements.txt:
host.json:
.funcignore:
.gitignore:

When deploying your project to a function app in Azure, the entire contents of the main project (__app__) folder should be included in the package, but not the folder itself.

Also You can import modules in your function code using both explicit relative and absolute references. Based on the folder structure shown above, the following imports work from within the function file __app__\my_first_function__init__.py:

@DixitArora-MSFT yes, I understand those files go into the folder. In Python, double underscores usually have some significant usage within an application. If __app__ is an arbitrary name in the suggested folder structure, then we should call that out in the documentation.

@cecilphillip I believe this is mentioned in the public doc. Below is the image which discuss about this. Do let me know if I understand the point correctly. At this point I don't think there is a doc change required.

image

So for now I will proceed with closure of this and If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

@DixitArora-MSFT I don't understand this __app__ folder at all and I'm having issues with importing modules. If this is the recommended approach, why does the Azure Core Tools doesn't generate this folder?
This needs clarification and improvement.

@eparizzi the docs on this aren't very comprehensive and I agree the tooling should assist in leading developers to the right structure.

What errors are you seeing exactly?
@anirudhgarg

Hi @cecilphillip,

We recently updated the documentation on Python folder structure which no longer requires __app__ namespace. Please try it out https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python#folder-structure.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jharbieh picture jharbieh  Â·  3Comments

JamesDLD picture JamesDLD  Â·  3Comments

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

DeepPuddles picture DeepPuddles  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments