azureazure-web-app-servicecloudazure-storage-accountappservice

Run from external URL with WEBSITE_RUN_FROM_PACKAGE config in appservice is not working


followed documentation https://learn.microsoft.com/en-us/azure/app-service/deploy-run-package?tryIt=true&source=docs#run-from-external-url-instead

  1. created storage account and container, uploaded zip file
  2. create SAS key with full permission.
  3. added WEBSITE_RUN_FROM_PACKAGE config in env variables of appservice with the values SAS key genereated for the blob (zip) file

the application displays enter image description here tried restarting still the same.


Solution

  • I deployed a sample .NET app to Azure Web App using the run a package from an external URL method without any issues.

    Make sure that ZIP file is structured correctly. It should contain the content that your app needs index.html, web.config, bin depending on app type.

    For an ASP. NET application, the web.config file is required. I added the file to root directory of the project and then zipped the following files.

    enter image description here

    web.config:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <location  path="."  inheritInChildApplications="false">
    <system.webServer>
    <handlers>
    <add  name="aspNetCore"  path="*"  verb="*"  modules="AspNetCoreModuleV2"  resourceType="Unspecified"  />
    </handlers>
    <aspNetCore  processPath="dotnet"  arguments=".\WebApplication6.dll"  stdoutLogEnabled="false"  stdoutLogFile="\\?\%home%\LogFiles\stdout"  hostingModel="inprocess"  />
    </system.webServer>
    </location>
    </configuration>
    

    I Added the Read and Add permissions to SAS token. enter image description here

    I set the WEBSITE_RUN_FROM_PACKAGE variable in the Environment Variables using the command below.

    az webapp config appsettings set --name <app-name> --resource-group <resource-group-name> --settings WEBSITE_RUN_FROM_PACKAGE="<BLOBSASURL>"
    

    After Restart the Web App I got Below Output.

    Azure Output:

    enter image description here