Closed tjrobinson closed 3 years ago
I've worked around this by using the Azure Functions Core Tools instead of the AzureFunctionApp
task:
- task: FuncToolsInstaller@0
displayName: 'Install Azure Functions Core Tools'
- task: AzureCLI@2
displayName: 'func azure functionapp publish'
inputs:
azureSubscription: 'Empactis (801f8ac0-b532-4960-a473-77d2203857b6)'
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
func azure functionapp publish empactisazurefunctionsprintinguat-uks --build remote
workingDirectory: src/Empactis.AzureFunctions.Printing
failOnStandardError: true
Currently only Run from package deploy using url is supported for Linux Function apps running on consumption plan.
External package URL is the only supported deployment method for Azure Functions running on Linux in the Consumption plan, if the user doesn't want a remote build to occur.
remote builds are not supported currently in task.
As Functions Core Tool by default enables remote builds its working for you
@N-Usha can you look into this enhancement request?
hmm, i'm not sure if i have exactly the same issue or just a tightly related one but this line in the debug bothers be:
Value of WEBSITE_RUN_FROM_PACKAGE has been changed to https://empazurefunctionsuat.blob.core.windows.net/azure-pipelines-deploy/package_1605196634175.zip?
i am deploying Python to a Linux FunctionApp and the constant updating of this setting each time with a new *.zip file that has been published to blob storage is really winding me up - mainly as it's not part of my infrastructure deployment (terraform)
when working in VSCode, with the func azure functionapp publish
command, this does not occur..
At this point, the only option i can see is to exclude this config setting from terraform, as the func azure functionapp publish
command is a combination of build and publish which i like even less 😐
Additionally, the -nozip
commands seems to do precisely nothing, and overwrites the file in the scm-releases
container on blob storage with a new zip anyway?? maybe that's because i am on a Linux FunctionApp?
Why is this functionality so different please?
after waaaaaaaaaaaay too much time doing trial and error deployments, i eventually figured out this will work:
- task: AzureRmWebAppDeployment@4
displayName: Deploy to FunctionApp
inputs:
ConnectionType: "AzureRM"
azureSubscription: "Your-Linked-Service-Name"
appType: "webAppLinux"
WebAppName: "Your-Function-App-Name"
package: "$(System.ArtifactsDirectory)/**/*.zip"
This will allow me to deploy a Python project to a FunctionApp running on consumption plan, it uses SCM just like the normal deployment 🎉
there a has to be a better way at *.yaml discovery.. it a total mess, and now Azure DevOps has removed the button that used to allow you to export YAML!
I have the same problem. Using the AzureRmWebAppDeployment task above doesn't work for me for a .NET Core 3.1 function app. I think it fails because it's trying to do a build on deploy, and the SDK doesn't exist on the function app node?
It seems to me that there needs to be a way to persist the URL in the WEBSITE_RUN_FROM_PACKAGE app setting across ARM deployments, so that the existing package stays in place.
Also having the same issue. I am deploying a consumption based linux function app and it fails to perform a swap slot because it is expecting these in the appsettings
According to the documentation: "Only used when deploying to a Premium plan or to a Consumption plan running on Windows. Not supported for Consumptions plans running Linux." https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#website_contentazurefileconnectionstring
So why does it expect these in the appsettings when I've specified the service type I am deploying is functionAppLinux?
This is currently what is in my YML file:
cc @mhoeger
I have the same problem. Using the AzureRmWebAppDeployment task above doesn't work for me for a .NET Core 3.1 function app. I think it fails because it's trying to do a build on deploy, and the SDK doesn't exist on the function app node?
It seems to me that there needs to be a way to persist the URL in the WEBSITE_RUN_FROM_PACKAGE app setting across ARM deployments, so that the existing package stays in place.
What language? C# i assume? I will test..
@m1nkeh Yes, c#, aspnet core 3.1 function app.
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
This is really annoying since our ARM templates screw up the function in consumption everytime (since they remove all application settings which are not specified). Any workaround for this?
@Rutix I've found that publishing with Azure Function Core Tools CLI is 100% reliable compared to this nonsense.
I don't understand how this it's still not possible to publish to a Linux consumption plan function using zipDeploy. We've wasted hours on this until finally finding this issue. The task should at least provide a meaningful error pointing at this being the issue. What needs to be done to get this issue reopened?
This is really annoying since our ARM templates screw up the function in consumption everytime (since they remove all application settings which are not specified). Any workaround for this?
Not within AzDOS, no. Best work around we found was having AzDOS call Azure CLI: https://learn.microsoft.com/en-us/azure/azure-functions/deployment-zip-push#cli .. this was the only way to get it working almost flawlessly.
Same here. Spent couple of days do debug this. And for me this is critical as create bug in production.
The issue from my perspective stems from the fact that we employ IaC and we deploy the Infrastructure via a separate release from the Code applications. Application Settings, mainly connection strings, are managed by IaC.
When ARM template are deployed the RESET the AppSettings since the Microsoft.Web/site/config
resource replace all the settings. So after each Deploy of the Infrastructure, our applications disappear.
Well, since RUN_FROM_PACKAGE=1
is not supported on Linux Consumption, let's use old reliable ZipDeploy
, supposed to be identical to the func publish
the VSCode (the IDE) execute.
Configuring in the YAML deploymentMethod: zipDeploy
silently choose to ignore it and continue with RUN_FROM_PACKAGE=<URL>
. Not a WARN, not an ERROR, not event an INFO log ...
Then, understanding that this is clearly a Microsoft Bug, I found this thread.
Thanks @tjrobinson @m1nkeh for providing a solution
Required Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name:
AzureFunctionApp@1
Environment
empactis
Azure Functions
Azure Functions Build (Printing)
199
31921
ubuntu-16.04
2.175.2
Issue Description
I am using the following YAML build definition:
This runs without errors, but the
AzureFunctionApp
step doesn't deploy the package usingdeploymentMethod: zipDeploy
when the target is a consumption Function App. The relevant section of the logs being:If I use the same YAML definition but point it at a Linux Azure Function App which is hosted by an App Service Plan (i.e. not a consumption plan), the results are different (and what I want to happen for the consumption plan target):
Task logs
log.zip