7

I've spent the past 2 days trying to figure out how to deploy my web app using Azure DevOps but nothing shows up. I used FileZila to see if the files generated by the build is uploading and all the files are there under the wwwroot folder. I tried manually uploading the files using FileZilla too. At this point I'm getting really frustrated because I've tried everything I found online to deploy the app. DevOps works perfectly fine, the part that isn't working is my web app actually showing up when I go to the URL.

I followed all the tutorials I could find.

This is what I see when I try to visit my site

No idea why this is asking me to deploy my code when the code is clearly deployed :/

3
  • check whether the deployed files are available or not using Kudu Console. Commented Apr 7, 2019 at 1:41
  • @Sajeetharan when I go to the Kudu console and click on "Site wwwroot" all I see is a blank page. That doesn't make sense though, shouldn't the files show up there since I'm directly uploading them to the "wwwroot" folder? Commented Apr 7, 2019 at 18:21
  • are you trying to deploy to azure app service linux instance? Commented Aug 9, 2021 at 9:51

3 Answers 3

1

Failed to reproduce your issue,you could follow my working steps as below:

1.Import repository,I used the git url from this document:https://github.com/MicrosoftDocs/pipelines-javascript

enter image description here

2.Create Build Pipeline.

enter image description here

3.Run the Build process.

enter image description here

4.Release the project and choose Nodejs Web APP.

enter image description here

5.Choosing the azure web app service in your subscription.

enter image description here

6.Navigate to your project url.

enter image description here

7.My files in the /wwwroot directory.

enter image description here

And web.config file as below:

<?xml version="1.0" encoding="utf-8"?>
<!--
     This configuration file is required if iisnode is used to run node processes behind
     IIS or IIS Express.  For more information, visit:

     https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
-->

<configuration>
  <system.webServer>
    <!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support -->
    <webSocket enabled="false" />
    <handlers>
      <!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module -->
      <add name="iisnode" path="server.js" verb="*" modules="iisnode"/>
    </handlers>
    <rewrite>
      <rules>
        <!-- Do not interfere with requests for node-inspector debugging -->
        <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
          <match url="^server.js\/debug[\/]?" />
        </rule>

        <!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
        <rule name="StaticContent">
          <action type="Rewrite" url="public{REQUEST_URI}"/>
        </rule>

        <!-- All other URLs are mapped to the node.js site entry point -->
        <rule name="DynamicContent">
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
          </conditions>
          <action type="Rewrite" url="server.js"/>
        </rule>
      </rules>
    </rewrite>

    <!-- 'bin' directory has no special meaning in node.js and apps can be placed in it -->
    <security>
      <requestFiltering>
        <hiddenSegments>
          <remove segment="bin"/>
        </hiddenSegments>
      </requestFiltering>
    </security>

    <!-- Make sure error responses are left untouched -->
    <httpErrors existingResponse="PassThrough" />

    <!--
      You can control how Node is hosted within IIS using the following options:
        * watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server
        * node_env: will be propagated to node as NODE_ENV environment variable
        * debuggingEnabled - controls whether the built-in debugger is enabled

      See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options
    -->
    <!--<iisnode watchedFiles="web.config;*.js"/>-->
  </system.webServer>
</configuration>

You could check any differences between your steps and mine.Any concern,please let me know.

Sign up to request clarification or add additional context in comments.

3 Comments

Ahh I don't have a server file, I'm using create-react-app
@corasan So now,the issue is solved? Or do i need to do a test for you about create-react-app?
no, the issue isn't solved. This won't work because is not a node app, I'm uploading static build files to Azure App Service
0

The reason I was having this issue was that I was trying to deploy to a Linux web app in Azure.

Unfortunately, I couldn't find a way around getting the deployment to Linux working, but as soon as I switched the app to windows based app service plan the app worked instantly.

Comments

0

If you're deploying react app to azure app service linux instance via Azure devops, then be sure to add following 'Startup command' to the azure app service deployment task:

pm2 serve /home/site/wwwroot --no-daemon --spa

Azure App Service Linux uses Nginx for web server, and has pm2 installed. Know more about pm2 here -> https://pm2.keymetrics.io/docs/usage/pm2-doc-single-page/

To automatically redirect all queries to the index.html use the --spa option.

Devops Azure App Service Deployment Task

After devops run, your azure app service Configuration -> General Settings, will look like:

enter image description here

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.