I am deploying Azure Python function App through CI-CD pipeline on azure subscription. But post deployment, I am getting issue within Azure Function portal
Your app is currently in read only mode because you are running from a package file. To make any changes update the content in your zip file and WEBSITE_RUN_FROM_PACKAGE app setting. When I deploy function app through VsCode I dont get the error. I have tried to change application settings to remove WEBSITE_RUN_FROM_PACKAGE issue, but it persists. Is there a shortcoming with Consumtion type app to deploy through CICD portal
parameters:
- name: environment
type: string
default: D
values:
- D
- Q
- P
trigger:
- none
variables:
azureSubscription: 'xxxx'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
appName: 'xxxxxx'
resources:
repositories:
- repository: self
type: git
ref: refs/heads/feature-cdqpipeline_upd
jobs:
- job: Job_1
displayName: Agent job 1
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
fetchDepth: 1
- task: Bash@3
displayName: Build extensions
inputs:
targetType: inline
script: >-
if [ -f extensions.csproj ]
then
dotnet build extensions.csproj --output ./bin
fi
- task: UsePythonVersion@0
displayName: Use Python 3.9
inputs:
versionSpec: 3.9
allowUnstable: true
- task: Bash@3
displayName: Install Application Dependencies
inputs:
targetType: inline
script: >-
python3.9 -m venv worker_venv
source worker_venv/bin/activate
pip3.9 install setuptools
pip3.9 install -r requirements.txt
- task: ArchiveFiles@2
displayName: Archive files
inputs:
rootFolderOrFile: AzFunct
includeRootFolder: false
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
- task: AzureFunctionApp@1 # Add this at the end of your file
inputs:
azureSubscription: '${{variables.azureSubscription}}'
appType: functionAppLinux # default is functionApp
appName: 'xxxxxxxx'
package: $(System.ArtifactsDirectory)/**/*.zip
deploymentMethod: 'zipDeploy'
#Uncomment the next lines to deploy to a deployment slot
#Note that deployment slots is not supported for Linux #deployToSlotOrASE: true
#resourceGroupName: '<Resource Group Name>'
#slotName: '<Slot name>'
...
2
Answers
This is not an error:
this message just says you may update your function app through this step in your build pipeline:
I agree with @Shamrai Aleksander, This warning is the warning and not an error.
For your error message that you shared in the comments:-
Make sure the requests package is present in your requirements.txt before deploying the Function app. also, If its present and the deployment is causing an error, Remove it from requirements.txt and perform the CI/CD pipeline deployment again. I tried adding requests package in my requirements.txt and deployed the Http Trigger Function with the YAML script below it ran successfully.
My requirements.txt:-
In addition to this, Try to use the below YAML script to deploy your Function, In this script all the dependencies from requirements.txt are installed properly:-
Output:-
My Function got deployed with the warning, But still the function with Code + Test and ran successfully, Refer below:-
If the error persists, Check your init.py code and validate if the requests module is imported correctly if you are using a custom code.