Deploying to Azure App Services causes timeout (Error Code 504)

Franck Desbrosses 51 Reputation points
2021-07-13T13:57:38.903+00:00

Hi,

I'm deploying an app on a linux container in App Service, and I keep getting "Error: The gateway did not receive a response from 'Microsoft.Web' within the specified time period. (CODE: 504)" when updating settings (even with the Azure App Service Settings task).
I also get an error via the portal when I try to manually update the settings, it saves but I get an error (with no detail however).

What can I do ?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

Accepted answer
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2021-07-14T15:57:26.967+00:00

    @Franck Desbrosses , @Anonymous

    Apologies you're experiencing this issue.

    Kindly change/add the application settings value to WEBSITE_ENABLE_SYNC_UPDATE_SITE = false and then check.

    I have seen similar error using regional VNet. If you’re using a regional VNet and there is another Web App in the same App Service Plan which is integrated with a subnet. Try using a different one.

    See this doc: https://learn.microsoft.com/azure/app-service/web-sites-integrate-with-vnet#regional-vnet-integration
    “You can have only one regional VNet Integration per App Service plan. Multiple apps in the same App Service plan can use the same VNet."

    2 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. sadomovalex 3,636 Reputation points
    2021-07-13T14:53:44.707+00:00

    how exactly you update app settings? We use Az module for that and didn't have such issues:

    $app = Get-AzWebApp -Name $appServiceName -ResourceGroupName $resourceGroupName  
      
    $appSettingsCurrent = $app.SiteConfig.AppSettings  
    $appSettingsNew = @{}  
    foreach ($kvp in $appSettingsCurrent) {  
    	$appSettingsNew[$kvp.Name] = $kvp.Value  
    }  
      
    $appSettingsNew["foo"] = "bar"  
      
    Set-AzWebApp -Name $appServiceName -ResourceGroupName $resourceGroupName -AppSettings $appSettingsNew  
    
    
      
    

  2. Satish A 6 Reputation points
    2022-02-22T20:52:59.533+00:00

    Hi, I am running the following command to deploy app service

    I am using following az cli version
    azure-cli 2.26.1 *

    az webapp deploy --timeout 900000 --clean true $(deploy_trace_level) \ --resource-group $(azureResourceGroup) \ --name $(azureAppName) $(slot) \ --type zip --src-path \ $(System.DefaultWorkingDirectory)/$(app_archive) 2> /dev/null
    I did add WEBSITE_ENABLE_SYNC_UPDATE_SITE = false

    but after 4min51 seconds my command times out.

    attaching the debug log

    `
    DEBUG: cli.azure.cli.core.util: Traceback (most recent call last):
    File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
    File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 657, in execute
    raise ex
    File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 720, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
    File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 691, in _run_job
    result = cmd_copy(params)
    File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 328, in call
    return self.handler(*args, **kwargs)
    File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
    File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 4037, in perform_onedeploy
    return _perform_onedeploy_internal(params)
    File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 4202, in _perform_onedeploy_internal
    response = _make_onedeploy_request(params)
    File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 4191, in _make_onedeploy_request
    .format(response.status_code, response.text))
    knack.util.CLIError: An error occured during deployment. Status Code: 500, Details: <html><head><title>500 - The request timed out.</title></head><body> <font color ="#aa0000"> <h2>500 - The request timed out.</h2></font> The web server failed to respond within the specified time.</body></html>

    am I missing anything else?

    `

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.