Giter Site home page Giter Site logo

azure-publish-settings's Introduction

azure-publish-settings

Reads Azure publish settings for use with Web Deploy, FTP, Git and Kudu. Includes first class support for working with kudu-api.

Installation

npm install azure-publish-settings --save

Usage

var aps = require("azure-publish-settings");

// Traditional
aps.read("path/to/MySite.PublishSettings", function (err, settings) {
    var iisSite = settings.web.iisSite;
    var username = settings.web.username;
    var password = settings.web.password;

    // Use settings with Web Deploy etc.
});

// Promise
aps.readAsync("path/to/MySite.PublishSettings")
    .then(function (settings) {
        var ftpUrl = settings.ftp.url;
        var username = settings.ftp.username;
        var password = settings.ftp.password;

        // Use settings with an FTP client
    });

// Integration with kudu-api
var kuduApi = require("kudu-api");

aps.read("path/to/MySite.PublishSettings", function (err, settings) {
    // Use the "kudu" property to pass credentials directly to kudu-api
    var api = kuduApi(settings.kudu);

    // Use kudu-api to manage an Azure web app
});

Schema

The following schema describes the output.

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The DNS friendly name of the web app."
        },
        "url": {
            "type": "string",
            "description": "The full URL of the web app."
        },
        "web": {
            "type": "object",
            "description": "The primary profile using the method 'web'.",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "The profile name"
                },
                "url": {
                    "type": "string",
                    "description": "The URL for web publishing."
                },
                "username": {
                    "type": "string",
                    "description": "The username for web publishing."
                },
                "password": {
                    "type": "string",
                    "description": "The password for web publishing."
                },
                "iisSite": {
                    "type": "string",
                    "description": "The IIS site name."
                }
            }
        },
        "ftp": {
            "type": "object",
            "description": "The primary profile using the method 'ftp'.",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "The profile name"
                },
                "url": {
                    "type": "string",
                    "description": "The URL for FTP publishing."
                },
                "username": {
                    "type": "string",
                    "description": "The username for FTP publishing."
                },
                "password": {
                    "type": "string",
                    "description": "The password for FTP publishing."
                },
                "passive": {
                    "type": "boolean",
                    "description": "True if passive mode should be used."
                }
            }
        },
        "profiles": {
            "type": "array",
            "description": "The list of all profiles in the publish settings file.",
            "items": {
                "type": "object",
                "properties": {
                    "method": {
                        "type": "string",
                        "description": "The publish method. Either 'web' or 'ftp'."
                    },
                    "name": {
                        "type": "string",
                        "description": "The profile name"
                    },
                    "url": {
                        "type": "string",
                        "description": "The URL for the publish method."
                    },
                    "username": {
                        "type": "string",
                        "description": "The username for the publish method."
                    },
                    "password": {
                        "type": "string",
                        "description": "The password for the publish method."
                    },
                    "iisSite": {
                        "type": "string",
                        "description": "Only for method 'web'. The IIS site name."
                    },
                    "passive": {
                        "type": "boolean",
                        "description": "Only for the method 'ftp'. True if passive mode should be used."
                    }
                }
            }
        }
    }
}

azure-publish-settings's People

Contributors

benquarmby avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.