Hi @Ayleen Durasno ,
Thanks for the offline Conversation and your patience throughout. Glad the issue is resolved.
I am summarizing the discussion and posting as answer.
Issue:
Upon investigating further, the issue occurred when the Azure DevOps pipeline was deploying the Function App using Run From Package. Although the pipeline deployment completed successfully, the function files were not being properly unpacked into wwwroot, causing the functions to not appear in the Azure Portal and resulting in 404 errors when invoking the endpoints.
Solution:
After switching to zipDeploy deployment method explicitly and disabling WEBSITE_RUN_FROM_PACKAGE, the functions were correctly extracted into wwwroot, became visible in the Azure Portal, and the endpoints started responding as expected.
Steps followed:
- Specified the deployment method as
zipDeployand enabled remote build
Specified the deploymentMethod as 'zipDeploy' rather than run from package made the functions found as this replicates the manual deployment process and files gets unloaded in wwwroot.
Added below config in the pipeline:
deploymentMethod: zipDeploy
enableRemoteBuild: true
- Configured application settings via the pipeline like below
appSettings: '-AzureWebJobsStorage @Microsoft.KeyVault(VaultName=valleyKeyvault;SecretName=AzureWebJobsStorage)'
Example:
steps:
- task: AzureFunctionApp@1
displayName: 'Azure functions app deploy'
inputs:
azureSubscription: 'subscription'
appType: 'functionAppLinux'
appName: 'app'
package: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
appSettings: '-WEBSITE_RUN_FROM_PACKAGE 0'
Hope it helps!
Please do not forget to click "Accept the answer” and Yes, this can be beneficial to other community members.
If you have any other questions, let me know in the "comments" and I would be happy to help you.