Open flytzen opened 1 year ago
We experience the same error here
Another way to use the work around when using the GUI, is to use the 'Azure App Service Deploy' task and select the App Service type to be Function App on Linux / Function App on Windows. Note that the system clearly tells you that this is not recommended on at least two occasions; when making the App Service type selection and when running the task on the agent, it will give the following message:
Nonetheless the Function App is deployed successfully.
We are running into the same problem. Any updates on this?
We are also facing same problem. I tried deploying through @jj-halfspace 's step but no luck
We ran into same situation! thanks @jj-halfspace
May I know when this will be fixed? We encounter same issue now @FinVamp1 thanks
We are experiencing the same. Please note: switching back to version@1 works fine, and just left same message in logs but with the WARNING statement.
Is this going to be fixed?
Just wanted to add that I was having the same problem when trying to deploy to a function app I set into a private vNet.
I have it with a private link and vnet integration, but configured to allow certain IP's through. I have it set to deny all and I added the Tags AzureDevOps and AzureCloud on the allow list in the tools site (because I'm using the shared build agents and not hosting my own).
This worked for deploying a regular app service, and should work for the Function deploy, but does not. I also have my storage account on the same vnet in a different subnet with access granted and the Function Deploy errors because it claims it cannot connect to the storage account.
Switching to an App service deploy did deploy my code as @jj-halfspace recommended.
Come on Microsoft! We need cloud hosted VNET integrated agents already like GitHub does.
Is there any update on this issue? Experiencing it too, and I would like to know if a fix can be expected, or if a workaround is needed.
Hello, it's on the backlog for the task and we need to figure out what the right thing is to do. No ETA at present.
What is the recommended workaround as this does not seem to be on a high priority? Seems like switching back to version 1 or using the app services deployment is working.
We utilized the deployment slots to get around this. Since the issue is that you cannot directly deploy to a slot that is inside the vnet, we added some a script to our pipeline that spins up a new deployment slot outside of the vnet, deploy the new code to it, swap the new deployment slot with the old one, then delete the old one.
This might not work for every use case, but it solved the problem for us.
Workaround using AzureRmWebAppDeployment@4 (as outlined by the original poster) also worked for me. Nevertheless I'd appreciate if this is fixed - or a statement is provided why MS decided to block deployments from MSHAs for private endpoint enabled functions. I think a warning instead of an error here would be enough. But I might miss some implications.
Source code reference: https://github.com/microsoft/azure-pipelines-tasks/blob/b6464a4cd567e9c8121337f338a2b54d0999a35d/Tasks/AzureFunctionAppV2/operations/AzureAppServiceUtilityExt.ts#L215
Task name
AzureFunctionApp@2
Task version
2.221.105
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
ubuntu-latest
Task log
Relevant log output
Aditional info
TL;DR;
AzureFunctionApp@2
fails with "Function app has private endpoint(s). But you are not running this pipeline from a self-hosted agent that has access to the Functions App. Relevant documentation: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&tabs=browser#install " even when "AzureCloud" is allowed access to SCM site.Note that Pipelines are able to talk to the Function app as folders and logs are created by Pipelines in the /site/deployments folder.
Using
AzureRmWebAppDeployment@4
works correctly.Details
Create an Azure Function with the following security restrictions (Bicep syntax)
Then add a Private EndPoint
When you try to deploy like this from an Azure Pipeline:
You get the following result:
Importantly, Pipelines does manage to create a deployments folder on the Function App server and create a log file, with the content "Deployment failed."
Using the following instead - which is not recommended - successfully deploys the app: