无法使用 ARM 在 App Service Plan 上创建基于 Windows (OS) 的 Function App
Cannot create Windows (OS) based Function App on App Service Plan using ARM
我创建了一个函数应用程序 ARM 模板和参数 JSON 文件,并通过 CLI 部署了它。问题是,然而,我调整模板,我总是以 Linux Function App.
当我在部署后点击导出模板时,功能应用程序的类型自动更改为:
"kind": "functionapp,linux",
有什么方法可以将 Windows OS 函数应用程序部署到 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 模板。那么测试起来就容易多了。
属性 reserved 必须设置为 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
}
}
属性:
我创建了一个函数应用程序 ARM 模板和参数 JSON 文件,并通过 CLI 部署了它。问题是,然而,我调整模板,我总是以 Linux Function App.
当我在部署后点击导出模板时,功能应用程序的类型自动更改为:
"kind": "functionapp,linux",
有什么方法可以将 Windows OS 函数应用程序部署到 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 模板。那么测试起来就容易多了。 属性 reserved 必须设置为 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
}
}
属性: