0

I am getting an issue with my web app hosted on linux app service plan which is a static next js site and is running perfectly fine in Azure storage with cdn & window based web app (with extra files like web.config & server.js)

I would like to run this in Azure web app (Linux app service plan) but the refresh is not working except for the home page. This works perfectly in my local as well. I have below settings in my web app

enter image description here

Suppose my website homepage URL is xyz.azurewebsites.net and when I navigate to the help page (xyz.azurewebsites.net/professionals) it works fine. But, if I refresh the page or try to go to the URL directly it gives me the below error

enter image description here

here is run logs in local

enter image description here

I am deploying it through the bitbucket pipeline as below

image: node:10.15.3

pipelines:
   default: 
      - step:
        name: Install dependencies
        caches:
          - node
        script:             
          - npm install
    - step:
        name: build
        caches:
          - node
        script:
           - npm run build                             
           - apt update && apt install zip            
           - zip -r out-$BITBUCKET_BUILD_NUMBER.zip . 
        artifacts:
          - out-*.zip                                

    - step:
        name: "Deploy to Azure Web App - Dev"
        deployment: Staging
        script:
          - echo "only for specific brnach"
          - pipe: microsoft/azure-web-apps-deploy:1.0.0
            variables:
                AZURE_APP_ID: $AZURE_APP_ID
                AZURE_PASSWORD: $AZURE_PASSWORD
                AZURE_TENANT_ID: $AZURE_TENANT_ID
                AZURE_RESOURCE_GROUP: $AZURE_RESOURCE_GROUP
                AZURE_APP_NAME: $APP_NAME
                ZIP_FILE: "out-$BITBUCKET_BUILD_NUMBER.zip"

1 Answer 1

0

Could you try adding this in settings => Configuration?

enter image description here

7
  • I have added though same issue
    – Arun Rana
    Apr 17, 2021 at 14:50
  • Are you using a different port? Could you show run logs when you are running locally?
    – TechGuru
    Apr 17, 2021 at 17:29
  • Are you using 3000 in WEBSITE_PORT configuration setting?
    – TechGuru
    Apr 19, 2021 at 12:10
  • correct setting name was WEBSITES_PORT. I did set value 3000 and removed the startup command now it has 2 problems redirecting & refresh so startup command is mandatory which tell application to redirect route to index.html
    – Arun Rana
    Apr 21, 2021 at 8:53
  • How are you publishing your application on Azure web app? In my case, I created a docker image and pushed it to the azure container registry.
    – TechGuru
    Apr 21, 2021 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.