0
votes

I deploy my application using azure pipeline.
First build using dotnet build, then publish, then Deploy

- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)\DQMIntegration\'
    ArtifactName: 'DQMIntegration'
    publishLocation: 'Container'

- task: AzureRmWebAppDeployment@4
  inputs:
    ConnectionType: 'AzureRM'
    azureSubscription: 'DQM-NonProd'
    appType: 'webApp'
    WebAppName: 'stg-DQMIntegration'
    deployToSlotOrASE: true
    ResourceGroupName: 'ESSP-N-1-QTYF-RG-2'
    SlotName: 'production'
    packageForLinux: '$(Build.ArtifactStagingDirectory)/DQMIntegration/'

The deployment sets WEBSITE_RUN_FROM_PACKAGE=1 in the Azure app service. However, the application does not run.

Application shows Running in Azure console in both cases.

I have no specific requirement to run from package or otherwise, but I can't understand why the application does not run form package or why the pipeline sets it so. In the kudu console I see that the zip file has been uploaded in data/SitePackages and there is a packagename.txt file with the name of the latest uploaded zip. My app service is in an ASE. it is a c sharp API.

Any ideas?

1
Hi @Tauqir, if the solution did some help, do you mind accepting it as the answer for others to refer? – Doris Lv

1 Answers

0
votes

Actually, Run From Package is different with ZIP Depoly.

What you are doing is ZIP Deploy, you don't need to add WEBSITE_RUN_FROM_PACKAGE in app settings. This environment variable would make the file under wwwroot Read-Only, and WEBSITE_RUN_FROM_PACKAGE="1" lets you run your app from a package local to your app, so set it's value to be '1' only when you want to run your application from local package.

If you wan run from a remote package, you can do this: WEBSITE_RUN_FROM_PACKAGE=url

Because the WEBSITE_RUN_FROM_PACKAGE app setting is set, this command doesn't extract the package content to the D:\home\site\wwwroot directory of your app. Instead, it uploads the ZIP file as-is to D:\home\data\SitePackages, and creates a packagename.txt in the same directory, that contains the name of the ZIP package to load at runtime. If you upload your ZIP package in a different way (such as FTP), you need to create the D:\home\data\SitePackages directory and the packagename.txt file manually.

Yes, it should run if the file in kudu is correct. Since you are not using run from package, the WEBSITE_RUN_FROM_PACKAGE="1" cannot find the file it need, it is the reason of the issue.