来自节点的azure-arm-websites API的createDeploymentSlot参数?

时间:2017-12-11 14:12:36

标签: node.js azure azure-web-sites

我正在寻找一种方法来为我的一个webapps(最好是在nodejs中)自动创建azure app-services插槽。我找到了一个名为azure-arm-websites的库的文档。看起来它为我提供了正确的界面,但文档非常有限。例如,我找到了一个名为createDeployment的方法,我想使用它,但这个函数的参数不是很好Documented。有没有人知道如何正确调用此函数来创建github部署?

const client = new WebSiteManagementClient(credentials, subscriptionId, baseUri)
const app = new WebApp(client);
const name = '<filtered>';
const id = 'production';
resourceGroupName = '<resource_group_name>'
const slot = '<slot_name>'
const deployment = {
   deploymentId: '',
   active: true,
   status: 0,
   author: '',
   deployer: '',
   authourEmail: '',
   details: '',
   kind: '',
};
const options = {};
optionsCallback = function(){};
app.createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, optionalCallback)

我不知道如何填充部署对象参数。例如,kind似乎是一个枚举,但它没有进一步的文档。

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

查看Azure CLI的帮助(节点一,而不是Python)。可以定义插槽:

root@2e30e94ca7b7:/# azure webapp create -h
help:    create a web app
help:
help:    Usage: webapp create [options] <resource-group> <name> <location> <plan>
help:
help:    Options:
help:      -h, --help                            output usage information
help:      -v, --verbose                         use verbose output
help:      -vv                                   more verbose with debug output
help:      --json                                use json output
help:      -g --resource-group <resource-group>  Name of the resource group
help:      -n --name <name>                      the name of the webapp to create
help:      --slot <slot>                         the name of the slot
help:      -l --location <location>              the geographic region to create the webapp,
help:                                              locations found at https://azure.microsoft.com/en-us/status/
help:      -p --plan <plan>                      the name of the app service plan eg: Default1.
help:      -s, --subscription <id>               the subscription identifier