Deploy Azure web app with private credentials via Git

I would like to deploy my Node.js app via GitHub to Azure.

I intend to make the app open source, thus no private info would be published in the repo; however, I still need to push the necessary credentials, API keys, etc. for the app to connect to other services.

How can I deploy the app without resorting to the private Git endpoint, and then awkward copy-pasting between the repos?

  • Heroku + Github deployment strategies
  • Recommended Go project structure and build system for project with static assets that require compilation?
  • Heroku Node Application Push Failure
  • env: node: No such file or directory (using jenkings, windows machine, node and a remote web interface)
  • How do I include a .gitignore file as part of my npm module?
  • Heroku NodeJS app (“Push rejected, failed to compile Node.js app”)
  • How can I preserve local changes made to an NPM module?
  • How to add /usr/local/bin in $PATH on Mac
  • 4 Solutions collect form web for “Deploy Azure web app with private credentials via Git”

    Typically you’ll want to utilize an npm module like nconf to load environment variables from either a file or environment variables.
    enter image description here

    config.json is just a JSON document listing your key:value pairs. You’ll want to add config.json to your .gitignore file to ensure you don’t share your credentials publically.
    enter image description here

    Within the Azure Portal, you’ll want to add your credentials as key:value pairs under Application Settings.
    enter image description here

    Note: You may be wondering what will happen if config.json is not found. nconf will simply move on to the next chained option. You could continue to chain config options together as in the following code snippet:

    var nconf = require('nconf');
    // Create nconf environtment 
        .file({ file: 'config.json' })  // Committed to repo; public settings
        .file({file: 'local_config.json'})  // Not committed to repo; private or dev environment settings

    Persistent data can be stored under d:\home, so I would recommend placing your private customizations there. If they need to be applied to the site in some way, you should do this by writing a deployment hook.

    Set configuration as environment variables found in the “App Settings” section under Settings->Application Settings. Rationale here.

    Your issue seems to be continuous deployment for Web App via Git from GitHub repo.
    So I think @Dark Falcon ‘s answer is correct.

    Azure continuous deployment support GitHub just need to do OAuth authentication in Azure Portal.

    Find out the link “set up deployment from source control” at Azure WebApp Dashboard page and do it step by step, as the pictures below.

    enter image description here
    enter image description here
    enter image description here

    There is some blogs and vedio tutorials for details of helping you.

    The blog explains how to use continuous deployment support for repo hosted on GitHub

    You also can follow these vedio tutorials to try to do it, as the references below.


    Best Regards.

    Git Baby is a git and github fan, let's start git clone.