azure - 无法使用 ARM 在应用服务计划上创建基于 Windows (OS) 的函数应用
问题描述
我创建了一个函数应用 ARM 模板和参数 JSON 文件,并通过 CLI 部署它。问题是,然而,我调整了模板,我总是得到一个 Linux 函数应用程序。
当我在部署后点击导出模板时,函数应用的类型会自动更改为:
"kind": "functionapp,linux",
有什么方法可以将 Windows 操作系统功能应用程序部署到 Azure?微软根本没有记录这一点。
这是我的 ARM 模板(重要部分):
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('app_serviceplan_name'))]",
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storage_account_name'))]"
],
"tags": {},
"kind": "functionapp",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"name": "[parameters('name')]",
"siteConfig": {
"appSettings": [
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "node"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~3"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "~14"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[BLANK_HERE_FOR_SECURITY_PURPOSES]"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('BLANK_HERE_FOR_SECURITY_PURPOSES')]"
}
]
},
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('app_serviceplan_name'))]",
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"name": "[parameters('app_serviceplan_name')]",
"location": "[parameters('location')]",
"sku": {
"name": "EP1",
"tier": "ElasticPremium",
"size": "EP1",
"family": "EP",
"capacity": 1
},
"kind": "elastic",
"properties": {
"perSiteScaling": false,
"maximumElasticWorkerCount": 20,
"isSpot": false,
"reserved": true,
"isXenon": false,
"hyperV": false,
"targetWorkerCount": 0,
"targetWorkerSizeId": 0
}
},
解决方案
请完成您的 ARM 模板。然后更容易测试。保留的属性必须设置为false。
解决方案应该是:
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"name": "[parameters('app_serviceplan_name')]",
"location": "[parameters('location')]",
"sku": {
"name": "EP1",
"tier": "ElasticPremium",
"size": "EP1",
"family": "EP",
"capacity": 1
},
"kind": "elastic",
"properties": {
"perSiteScaling": false,
"maximumElasticWorkerCount": 20,
"isSpot": false,
"reserved": false,
"isXenon": false,
"hyperV": false,
"targetWorkerCount": 0,
"targetWorkerSizeId": 0
}
}
特性:
推荐阅读
- python - 如何从shopify获取报告
- excel - 访问存储在 VBA 字典中的范围内的单个单元格值
- google-classroom - 如何在 API 调用上发布课堂帖子(仅使用材料)?
- html - 尝试更改 Doxygen 中的页眉和/或页脚
- javascript - 返回一个与另一个数组中的任何项都不匹配的数组项?
- git - git:关于创建分支和克隆 repos 的问题
- gridview - Yii2:固定第一列的Gridview
- unit-testing - VSTS - 运行控制台应用程序而不是单元测试
- wordpress - wp_mail() 不会在服务器上发送两个以上的连续消息或通过 mailtrap.io 在本地测试
- python - 如何表示具有多个属性的数据?