#Application error on Webapp

1 messages · Page 1 of 1 (latest)

stable sigil
#

Hi, i Just deployed a Django app from Azure Devops Pipeline to an Azure webapp, the Pipeline runs fine, but it shows an error when try access using web browser it show an "Application Error" .
The logs from bash shell don't tell much neither, I don't know what.
The startup command includes also celery command:
python3 manage.py runserver --settings=firma.settings.staging &&
python3 -m celery -A firma worker &

What i need to check to identify what needs to be fixed.

stable sigil
#

The log stream shows this:
Firmas app is running
2023-10-11T04:00:11.128Z ERROR - Container webapp-firma-backend_1_031698da for site webapp-firma-backend has exited, failing site start
2023-10-11T04:00:11.150Z ERROR - Container webapp-firma-backend_1_031698da didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.

stable sigil
#

Still with this issue, after working in the pipeline file and create a new webapp, then deploy to it and got an error that cannot find the virtualenv on /home/site/wwwroot, neither the start.sh file, in fact there's nothing about the project there.
My pipeline is:
`trigger:

  • staging

pool:
name: MyPool

jobs:

  • job: Build_Deploy_Jobs
    timeoutInMinutes: 0

    steps:

    • task: UsePythonVersion@0
      inputs:
      versionSpec: '3.10'
      architecture: 'x64'
      displayName: 'Install Python3'

    • task: DownloadSecureFile@1
      inputs:
      secureFile: '.env'

    • task: CopyFiles@2
      inputs:
      SourceFolder: $(Agent.TempDirectory)
      Contents: '**.env'
      TargetFolder: $(System.DefaultWorkingDirectory)

    Archive Django project and save it as a build artifact

    • task: ArchiveFiles@2
      inputs:
      rootFolderOrFile: '$(Build.SourcesDirectory)'
      includeRootFolder: false
      archiveType: 'zip'
      archiveFile: '$(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip'
      replaceExistingArchive: true
    • publish: $(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip
      displayName: 'Upload package'
      artifact: drop

Deploy to Azure App Service using zip deploy

  • task: AzureWebApp@1
    inputs:
    azureSubscription: 'MyAzureSubscription'
    appType: 'webAppLinux'
    AppName: 'webapp-firma-backend'
    ResourceGroupName: 'my_group_resource'

    packageForLinux: '$(System.DefaultWorkingDirectory)/drop/Application$(Build.BuildId).zip'

    package: '$(Build.ArtifactStagingDirectory)/Application$(Build.BuildId).zip'
    deploymentMethod: 'zipDeploy'
    RuntimeStack: 'PYTHON|3.10'
    StartupCommand: 'sh start.sh'
    displayName: 'Deploy to Azure Web App'`
#

In app configuration I have setted SCM_DO_BUILD_DURING_DEPLOYMENT in true

stable sigil
#

I tried to deploy manually from azure shell, there i got some errors with env vars, i added through Configuration settings in Azure web Console, then had to change the star.sh file, runserver from 127.0.0.1 , to 0.0.0.0.

modest plank
#

Did you get this resolved?

#

This definitely doesn't look like an issue with your deployment on the yaml

#

More code related

#

Are you handling both the code and the yaml deployment?