functions-action: Flex consumption with dotnet fails
Attempting to deploy a dotnet8 app to a flex consumption Function App:
publish-flex:
runs-on: windows-latest
needs: build
steps:
- name: 'Download Build Artifacts'
uses: actions/download-artifact@v4
with:
name: app-build
path: output
- name: 'Publish Azure Flex Functions'
uses: Azure/functions-action@v1.5.2
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_FLEX_NAME }}
package: output
publish-profile: ${{ secrets.PUBLISH_PROFILE }}
sku: flexconsumption
remote-build: true
enable-oryx-build: false
scm-do-build-during-deployment: false
This is the GitHub Actions output:
Successfully parsed SCM credential from publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Warning: Neither AzureWebJobsStorage nor AzureWebJobsStorage__accountName exist in app settings (from Kudu SCM site with publish-profile credential). Please ensure one of them is configured as it is critical for function runtime. For more information, please visit the function app settings reference page: https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#azurewebjobsstorage
Successfully acquired app settings from function app (with SCM credential)!
Will archive output into D:\a\_temp\temp_web_package_65[20](https://github.com/argos-au/argos/actions/runs/10193129493/job/28198133521#step:3:21)085252805692.zip as function app content
Will use Kudu https://<scmsite>/api/publish to deploy since Flex consumption plan is detected.
Will use parameter remote-build: true
Package deployment using One Deploy initiated.
Starting deployment pipeline.
[ValidationStep] starting.
[AppSettingValidation] starting.
[DeploymentStorageValidation] starting.
Validation completed
[SourcePackageUriDownloadStep] starting.
Zip package is present at /tmp/zipdeploy/a32def0f-6667-49a7-8855-9658271bdd3c.zip
[ExtractZipStep] starting.
Cleaning files in /tmp/zipdeploy/extracted
Extracted zip package in /tmp/zipdeploy/extracted
[OryxBuildStep] starting.
Running oryx build command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform dotnet
Error: Couldn't detect a version for the platform 'dotnet' in the repo.
Error: Couldn't detect a version for the platform 'dotnet' in the repo.\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform dotnet
Failed during oryx build due to Error: Couldn't detect a version for the platform 'dotnet' in the repo.\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform dotnet
Deployment failed with Error: Error: Couldn't detect a version for the platform 'dotnet' in the repo.\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform dotnet
Error: Failed to deploy web package to Function App.
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error: When request Azure resource at PublishContent, oneDeploy : Failed to use D:\a\_temp\temp_web_package_6520085[25](https://github.com/argos-au/argos/actions/runs/10193129493/job/28198133521#step:3:26)2805692.zip as OneDeploy content
Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
Error: Deployment Failed!
I’m confused about two things:
- The warning about the
AzureWebJobsStorageapp setting. We never had these on our apps and they always worked. Error: Couldn't detect a version for the platform 'dotnet' in the repo.- Why is it running oryx if it’s set tofalse?
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 23 (2 by maintainers)
Any errors in the function’s entry point seem to lead to this state, and because deployment spins up the function app to get its list of triggers, it all looks like issues with deployment rather than our own code.
Compounding this (because Flex Consumption functions have done away with app logs and log streaming) there seems to be no way to actually diagnose what is causing the problem.
To reproduce:
Deploying this (using Core Tools here, but I get the same end-state using the action):
gives an ‘operation failed successfully’ sort of message:
(note that the SyncTriggerStep never completes)
In the portal, the flex function app now has a single HTTP trigger called ‘WarmUp’. In App Insights, there are no Exceptions, and the exception thrown during startup is not present in the traces. In the deployment logs, the SyncTriggerStep is shown to be failing with Bad Gateway:
This has cost a lot of time - can we please have the log stream back for flex functions (and include the app’s output during deployment)?
Or, if it has to all be in app insights, can there be some guidance on how to find these startup errors during deployment?
Can the deployment log include the actual exception information rather than Bad Gateway?
As it is there is an unobservable gap between deployment logs, and the tracing around a function’s triggered execution.
@nzthiago @davidobrien1985 I’m sorry for not getting back to you sooner, but I could manage to get it to work. I’m not sure which of the below got it working, but these are steps performed
We are looking into the root causes for the issues described in this thread.
Some notes:
remote-build: trueis only required for (1) Flex Consumption apps and (2) those that need a remote buildWEBSITE_RUN_FROM_PACKAGE,SCM_DO_BUILD_DURING_DEPLOYMENT, andENABLE_ORYX_BUILD. If they are present in your app, please remove them.WEBSITE_WEBDEPLOY_USE_SCM = falseshould not do anything. We are looking into whether the addition of the app and the deployed functions showing up is causation or correlation.upload-artifactaction, like @ablyler mentioned, you’ll need to explicitly include hidden files. This was a breaking change on theupload-artifactaction.@john-manktelow This Functions host PR will address the missing startup exceptions and have them flow to App Insights. It should roll out early next year.
If you are downloading and artifact, it could it be related to this issue: https://github.com/Azure/azure-functions-dotnet-worker/issues/1240
In the
actions/upload-artifactstep, theinclude-hidden-files: trueline is the key. Without it the.azurefunctionsdirectory isn’t included in the artifact, which causes the function to not deploy correctly.For dotnet packages, make sure that
WEBSITE_RUN_FROM_PACKAGEdoes not exist in your Azure Environment variables for deployments withOtherwise, you may receive 404