Как развернуть приложение create-реакции с помощью DevOps Azure? - PullRequest
5 голосов
/ 07 апреля 2019

Последние 2 дня я пытался выяснить, как развернуть мое веб-приложение с помощью DevOps Azure, но ничего не появляется.Я использовал FileZila, чтобы проверить, загружаются ли файлы, сгенерированные сборкой, и находятся ли они в папке wwwroot.Я попытался вручную загрузить файлы, используя FileZilla тоже.На данный момент я очень расстроен, потому что перепробовал все, что нашел в Интернете, чтобы развернуть приложение.DevOps отлично работает, часть, которая не работает, - это мое веб-приложение, которое фактически появляется, когда я перехожу по URL.

Я следовал всем учебникам, которые смог найти.

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

Понятия не имею, почему это просит меня развернуть мой код, когда код явно развернут: /

1 Ответ

2 голосов
/ 16 апреля 2019

Не удалось воспроизвести вашу проблему, вы можете выполнить мои рабочие шаги, как показано ниже:

1.Импортный репозиторий, я использовал URL-адрес git из этого документа : https://github.com/MicrosoftDocs/pipelines-javascript

enter image description here

2.Создать конвейер сборки.

enter image description here

3. Запустите процесс сборки.

enter image description here

4.Выберите проект и выберите Nodejs Web APP.

enter image description here

5.Выберите службу Azure Web App в своей подписке.

enter image description here

6. Перейдите к URL вашего проекта.

enter image description here

7.Мои файлы в каталоге / wwwroot.

enter image description here

И web.config файл, как показано ниже:

<?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>

Вы могли бы проверить любые различия между вашими шагами и моими. Любая проблема, пожалуйста, дайте мне знать.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...