Skip to content

respect-funcignore not working for flex-consumption python deploy #266

@senamarlon

Description

@senamarlon

After debugging in relation to issue #256, I seem to have localized a bug that causes failure in my deployments

The core of my issue seems to be that respect-functignore does not work anymore, see below my .yml code block

`
env:
#AZURE_FUNCTIONAPP_NAME:
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.'
PYTHON_VERSION: '3.11'

`

- name: 'Run the Azure Functions action'
  uses: Azure/functions-action@v1
  id: deploy-to-function-app
  with:
    app-name: ${{ needs.build_infrastructure_bicep.outputs.azureFunctionName  }}
    package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}' 
    remote-build: true
    respect-funcignore: true

`

see my func ignore file content:
.venv/* .vscode/* infra/* .github/*

I have also attempted a funcignore without the * in case the name scheme follwos the gitignore standard rather than regular funignore.

Here is how i discovered the issue:

Symptom : as stated in #256, I would have issues deploying my code base using the GH Action. However, when deploying the function project with VSCode, I had no issue and the deployment successed. One of the core issues is that the action shows as successful but the actual AZ function does not work.

Discrepency observed : I observed that when i load from VSCode and examine the release-package in my associated storage account, the contents were significantly leaner. I had none of the .venv, infra/biceps folders and etc related to my project. I only had the things related to the actual az function. Inside of the proejcts generated funcignore, I had a payload that is exactly like what I put above. Meanwhile in a release-package by the action, I still had all of the other files. These files seem to cause a deployment fail.

Even if a funcignore in the root of my repo with the exact same payload as what i described above, I was never able to get those folders excluded. At most, the contents were excluded but the folders remain, which seems to cause problems.

Intermediate fix :
I moved all of my code to a /srcfunction folder in my repo. I left all of the other folders such as infra where they were. I also changed the AZURE_FUNCTIONAPP_PACKAGE_PATH to './srcfunction'

Since the folder is stripped of all the other conflicting elements, it is now working fine. However, the better behavior for us is for the funcignore to just work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions