天蓝色模板输出发布配置文件内容 [英] azure template output publish profile content

查看:51
本文介绍了天蓝色模板输出发布配置文件内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Azure模板来建立网站.我希望它输出发布配置文件的内容,以便我可以自动进行部署.这可能吗?

I'm using an Azure Template to set up a web site. I would like it to output the contents of the publish profile so that I can automate the deploying. Is this possible?

我当前的模板如下所示:

My current template looks something like this:

{
    ...
    "resources": [
        {
            "type": "Microsoft.Web/sites",
            "kind": "app",
            "name": "[variables('webapp').name]",
            "apiVersion": "[variables('webapp').version]",
            "location": "[variables('location')]",
            "tags": {},
            "properties": {
                "serverFarmId": "[variables('webapp').serviceplan.name]",
                "name": "[variables('webapp').name]"
            },
            "dependsOn": [
                "[resourceId('Microsoft.Web/serverfarms', variables('webapp').serviceplan.name)]"
            ]
        },
        {
            "type": "Microsoft.Web/serverfarms",
            "sku": {
                "name": "B1",
                "tier": "Basic",
                "size": "B1",
                "family": "B",
                "capacity": 1
            },
            "kind": "app",
            "name": "[variables('webapp').serviceplan.name]",
            "apiVersion": "[variables('webapp').serviceplan.version]",
            "location": "[variables('location')]",
            "properties": {
                "name": "[variables('webapp').serviceplan.name]",
                "numberOfWorkers": 1
            },
            "dependsOn": []
        }
    ],
    "outputs": {
        "manifest": {
            "type": "object",
            "value": {
                "Website": {
                    "publishUrl": "...",
                    "userPWD": "...",
                    "msdeploySite": "..."
                }
            }
        }
    }
}

我尝试使用 listkeys 函数,但是据我了解,您需要提供要获取的资源ID,即发布配置文件,我不确定如何获取.

I've tried experimenting with the listkeys function but as I understand it you need to give the id of the resource, i.e. publish profile, that you want to get and I'm not sure how to get that.

推荐答案

您需要使用

you need to use reference and\or listkeys functions for that.

它看起来像这样:

"publishUrl": "[reference(variables('webapp').name)[%propertynamegoeshere%]]"

其他事情也一样;但是您需要使用 listkeys 函数来获取Web应用的密钥.

same goes for other things; but you need to use listkeys function to get keys for the webapp.

这篇关于天蓝色模板输出发布配置文件内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆