...and as usual, the culprit was a missing configuration key. Really? Why does it result a BadRequest?
Azure Function 4 deployment fails with "Encountered an error (BadGateway) from host runtime."
A few days ago, I started getting the infamous "BadGateway" errors when I attempted to deploy a new version of my Azure Function. Yes, it is the dreaded "Syncing Triggers" issue...(debug log below)
This was working before, I made numerous successful deployments in the past. Yes, I tried removing the WEBSITE_RUN_FROM_PACKAGE setting, to no avail. I tried deploying from VS Code, from PowerShell, I re-deployed the Azure resources, nothing helped.
It's an Azure Function 4, running on Linux, linuxFxVersion is set to "DOTNET-ISOLATED|8.0".
Does anyone have an idea what am I doing wrong? Any help is appreciated!
Syncing Triggers...
cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: 12a05a9f-d2ab-427e-83af-16f41d5c5c61
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/<redacted>/syncfunctiontriggers?api-version=2022-03-01'
cli.azure.cli.core.sdk.policies: Request method: 'POST'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies: 'Accept': 'application/json'
cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': 'c1a4481c-fb49-11ee-9555-faf2c864b201'
cli.azure.cli.core.sdk.policies: 'CommandName': 'functionapp deployment source config-zip'
cli.azure.cli.core.sdk.policies: 'ParameterSetName': '-g -n --src --debug'
cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.53.0 (HOMEBREW) azsdk-python-azure-mgmt-web/7.0.0 Python/3.10.13 (macOS-14.4.1-arm64-arm-64bit)'
cli.azure.cli.core.sdk.policies: 'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "POST /subscriptions/<redacted>/syncfunctiontriggers?api-version=2022-03-01 HTTP/1.1" 400 322
cli.azure.cli.core.sdk.policies: Response status: 400
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies: 'Content-Length': '322'
cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies: 'Expires': '-1'
cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies: 'Server': 'Microsoft-IIS/10.0'
cli.azure.cli.core.sdk.policies: 'X-AspNet-Version': '4.0.30319'
cli.azure.cli.core.sdk.policies: 'X-Powered-By': 'ASP.NET'
cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-writes': '1199'
cli.azure.cli.core.sdk.policies: 'x-ms-request-id': 'fda8479b-ea63-4ba6-b5a5-c8fcc8e3b392'
cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': 'fda8479b-ea63-4ba6-b5a5-c8fcc8e3b392'
cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'UKSOUTH:20240415T170144Z:fda8479b-ea63-4ba6-b5a5-c8fcc8e3b392'
cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies: 'Date': 'Mon, 15 Apr 2024 17:01:43 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"Code":"BadRequest","Message":"Encountered an error (BadGateway) from host runtime.","Target":null,"Details":[{"Message":"Encountered an error (BadGateway) from host runtime."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","Message":"Encountered an error (BadGateway) from host runtime."}}],"Innererror":null}