17

My python file is in Azure devops repository. I am trying to deploy it to the azure function app and execute the py file. I already building up an service connection "testing" to connect the resource group. My code is following.

steps:

  • task: AzureFunctionApp@1 displayName: 'Azure Function App Deploy: api' inputs: azureSubscription: testing appType: functionAppLinux appName: api package: '$(System.DefaultWorkingDirectory)' runtimeStack: 'DOCKER|microsoft/azure-functions-dotnet-core3.0:3.0' startUpCommand: 'func azure functionapp publish $(functionAppName) --no-bundler'

However, i encounter error ##[error]Error: Failed to sync triggers for function app 'api'. Error: BadRequest - Encountered an error (ServiceUnavailable) from host runtime. (CODE: 400)

3 Answers 3

11

This might help: https://github.com/Azure/azure-functions-host/issues/5722

I had the same issue and removing WEBSITE_RUN_FROM_PACKAGE from siteConfig.appSettings fixed the issue.

Sign up to request clarification or add additional context in comments.

Comments

1

As a follow-up to Balint's answer, I had something similar happen which started causing this same problem. In my case I'm using keyvault secrets in my configuration to load some keys, and this failed until I refreshed my config.

2 Comments

Thanks for this - what do you mean by refresh your config?
@EvangelosAktoudianakis it looks like MS has moved things around a bit in Azure Portal, but now it's listed as "Pull reference values" under "Settings/Environment variables". Sorry for not being explicit.
0

The problem for me was the Storage Account linked to the function app. The Storage Account was in a subnet with restricted access. Set up the function app to a subnet in the same VNet as the Storage and create Network rules to allow traffic.

So, also check your network!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.