Search code examples
javascriptazureazure-web-app-serviceweb-config

How to display a page in Azure Apps Service?


I am trying the sample code below.
https://learn.microsoft.com/ja-jp/azure/storage/blobs/storage-upload-process-images?tabs=javascript%2Cazure-powershell

I was able to move locally.
(Start URL: http: // localhost: 3000)
We are deploying the code to Azure Apps Service as a Zip file.
However, even if I access the site URL, it cannot be operated.
(Start URL: https: // {azure apps service} .azurewebsites.net)

I'm wondering if I should set Web.Config, but I don't know what to write.
If you know what to set in WebConfig with the above code, I would appreciate it if you could tell me.
Also, if there is a solution other than this, I would appreciate it if you could tell me that as well.


Solution

    • I have followed the document which you have provided and it is working fine for me.
    • I am able to upload images and check them in storage account. enter image description here enter image description here

    "You do not have permission to view this directory or page."

    • The root reason can be there is no default page in your Azure website.

    • when you deploy the zip file via the azurewebsites.net/ZipDeployUI, make sure that you see the files being unzipped on the /wwwroot level.

    • If the files show up under /wwwroot/your-app-folder/ you may get this permission issue.

    • You could directly view the page with url.

    https://{siteanme}.azurewebsites.net/views/yourpage.html
    

    Add the default document in the project root folder and set it as default page in appsetting on the Azure portal and save the setting.

    The default document is the web page that is displayed at the root URL for a website.

    enter image description here

    • Navigate to KUDU url: https://<your app name>.scm.azurewebsites.net/DebugConsole and go to site\wwwroot to check if the files are contained within a directory.

    • If you find any files missing , re-deploy the app.

      OR

    • Just for checking Temporarily, drag the local files directly to the d:home\site\wwwroot directory and try again.

    • For debugging purposes you can turn on the Azure detailed messaging.

    • Login to Azure > App Services > Your Web App > App Service logs , then turn on Detailed Error Messages or turn on all of the logging options.

    • Add the below in your Web Config file,

    • add <customErrors mode="Off" /> BEFORE system.web closing tag, </system.web>. Similarly, add <httpErrors errorMode="Detailed"></httpErrors> BEFORE </system.webServer>.Upload the Web Config to Azure.

    This will show the error messages in detail , from there you can figure out the exact issue.

    Please refere SO thread for more details.