1

We have a node.js web application running in Microsoft Azure and need to modify the App Settings of the instance program programmatically. We have setup a simple project in Visual Studio in order to test the functionality of the Azure Node SDK but are unable to find a way to retrieve the App Settings themselves using the getSite class.

This could be because we are not calling App Settings correctly however the documentation provided here: http://azure.github.io/azure-sdk-for-node/azure-arm-website/latest/Sites.html#getSite simply states propertiesToInclude but doesn't list what the properties could be so we pretty much took a guess. Our code is below:

var msRestAzure = require('ms-rest-azure');
var webSiteManagementClient = require('azure-arm-website');
msRestAzure.interactiveLogin(function (err, credentials) {
    var client = new webSiteManagementClient(credentials, "252a971e-c5c0-4e34-84a3-58a5b1e5c7f9");
    client.sites.getSite("*****resourcegroup", "*********service", {propertiesToInclude:'appSettings'}, function (err, result, request, response) {
        console.log('Err:' + err);
        console.log('Result:' + JSON.stringify(result));
        console.log('Requrest:' + JSON.stringify(request));
        console.log('Response:' + JSON.stringify(response));
    });
});

If the property is something specific or if we should be using a different class entirely please let me know as any help is greatly appreciated.

Thanks.

1 Answer 1

1

To get the App Settings in your web app, please use function listSiteAppSettings(resourceGroupName, name, optionsopt, callback), e.g.

client.sites.listSiteAppSettings("*****resourcegroup", "*********service", function (err, result, request, response) {
    console.log('Result:' + JSON.stringify(result.properties));
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.