The following forum(s) have migrated to Microsoft Q&A (Preview): Azure App Service - Web Apps, Azure App Service - Web Apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
Azure Web App Service React Routing & deploy problem RRS feed

  • Question

  • Hi

    I create a Web App Service (window , .net core 2.2). I can deploy my react app using Azure DevOps pipeline.

    I have 2 question:

    1. When i try refresh the page e.g /about , it show:

    The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    I try add web.config to site/wwwroot:

    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <rule name="React Routes" stopProcessing="true">
                        <match url=".*" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                            <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="/" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>

     But this not work, still show above show message. How can i fix it? 

    2. i use Azure DevOps pipeline to deploy, when i use FTP to the web app service, i found that there are is one one file (in

    site/wwwroot, but I found the zip file in deployments folder.

    

    Where is the source code?? 

    Thanks

    Wednesday, July 10, 2019 7:00 AM

Answers

  • For Q2: Below explain Azure pipeline deploy is different from FTP deploy.

    https://www.brandonbarnett.io/blog/2019/02/why-isnt-azure-app-service-deploy-copying-files-to-my-web-apps-wwwroot/

    For Q1, As mention above, it is not reference "site/wwwroot", if you use Azure pipeline deploy, the FTP deploy web.config to site/wwwroot may not be work.

    So ,Please add the web.config file during build

    you can try use this https://marketplace.visualstudio.com/items?itemName=eliostruyf.build-task to create web.config file during build process on Azure pipline

    • Marked as answer by Grace Chan Friday, July 12, 2019 5:48 AM
    Friday, July 12, 2019 4:57 AM

All replies

  • Hi Grace Chan,

    Can you please provide further details on the type of 404 error? There are sub-status codes listed in the diagnostic logs for your web app. Check out the web server logs for this detail. Please see this documentation on how to Enable diagnostics logging for apps in Azure App Service.  Also, can you check via kudu to see if the web.config file is there?

    Thanks,

    Grace

    Friday, July 12, 2019 2:26 AM
    Moderator
  • For Q2: Below explain Azure pipeline deploy is different from FTP deploy.

    https://www.brandonbarnett.io/blog/2019/02/why-isnt-azure-app-service-deploy-copying-files-to-my-web-apps-wwwroot/

    For Q1, As mention above, it is not reference "site/wwwroot", if you use Azure pipeline deploy, the FTP deploy web.config to site/wwwroot may not be work.

    So ,Please add the web.config file during build

    you can try use this https://marketplace.visualstudio.com/items?itemName=eliostruyf.build-task to create web.config file during build process on Azure pipline

    • Marked as answer by Grace Chan Friday, July 12, 2019 5:48 AM
    Friday, July 12, 2019 4:57 AM