Post/Code

HomeAboutUsesNow

Azure, Node.js, PowerShell.

  • Check the OS and architecture in PowerShell:

        wmic os get caption
        wmic os get osarchitecture
    
  • 2 Ways to check which version of Node is running on Azure:

    1. Open the Kudu Console (via Advanced Tools, CMD) and run: node -v or npm -v
    2. In the Azure Portal, in the App Service blade, in Application Settings look for:

      WEBSITE_NODE_DEFAULT_VERSION

  • 3 Ways to specify the Node.js version to run in Azure:

    1. In package.json set the following:

          "engines":{
              "node": "0.6.22 || 0.8.x"
          }
      
    2. Set the 'node_env' by changing the value mentioned above in Application settings.

    3. Set 'node_env' in your web.config in the system.webServer block:

          <system.webServer>
              ...
              <iisnode node_env="production" />
              ...
          </system.webServer>
      
    4. Set it via the iisnode.yml file | Link

      Note: The web.config or iisnode.yml values will override the value in Application Settings

    5. Deploying Node.js to Azure:
      Link
      Further reading:
      Link
      Link

    6. The first article above introduced me to Swaggerize, which, via a Yo generator, lets you generate boilerplate code for your API via a Swagger.json document specifying your routes. It will then also setup the Swagger UI for you to enable testing. Very cool! Link

    7. As a reminder, when working with GitHub or Azure via a proxy, remember to:

          git config --global http.proxy http://proxyuser:proxypassword@proxy.server.domain:port
          git config --global --unset http.proxy
          git config --global --get http.proxy