How to Deploy AdonisJS in Azure Web App?


I need a help,
I could not run the Adonijs in AZURE web app.
Can anyone help me?
Simply does not work and displays a message
“You do not have permission to view this directory or page.”



Did you deploy to Azure?
I’m trying to do using Pipeline, but without success, the .env file I’m not able to create through ssh.



Does Azure support NodeJS?
If so, the you should ask your provider and ask them the permission for deployment.
I also recommend you to use docker before any deployment just to make sure that everything is running perfectly and and you try to deploy it.:hugs:



Hey. I was able to run it just by adding the web.config file to the project root. Within the server rules file, my server Nodejs, in my case server.js

Configure CORS in Azure as *
In Configurations add Applications Settings: WEBSITE_NODE_DEFAULT_VERSION -> 8.9.0

    <webSocket enabled="false" />
      <!-- 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"/>
        <!-- Do not interfere with requests for node-inspector debugging -->
        <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
          <match url="^server.js\/debug[\/]?" />

        <!-- All other URLs are mapped to the node.js site entry point -->
        <rule name="API Routes">
          <match url="^api\/.*" />
          <action type="Rewrite" url="server.js"/>

        <!-- React Routes -->
        <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" />
          <action type="Rewrite" url="/" />

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

    <!-- 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 for a full list of options
    <!--<iisnode watchedFiles="web.config;*.js"/>-->
1 Like