如何设置Azure应用服务以通过Azure资源管理器在.Net Core上运行 [英] How to setup Azure App Service to run on .Net Core through Azure Resource Manager
问题描述
我已使用以下ARM模板代码段设置了应用服务:
I've set-up an App Service using the following ARM template snippet:
{
"name": "[variables('webBackEnd')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('location')]",
"apiVersion": "2015-08-01",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
],
"tags": {
"[concat('hidden-related:', resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName')))]": "Resource",
"displayName": "BackendWebApp"
},
"properties": {
"name": "[variables('webBackEnd')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
}
},
这将部署一个应用程序服务.但是,默认情况下,它将设置为使用.Net Framework.下面是我的Azure门户的视图:
This will deploy an App Service. However, by default, it will be setup to use the .Net Framework. Below is a view from my Azure Portal:
为了运行基于ASP.Net Core的Web服务器,我必须手动将堆栈设置从".Net"切换为".Net Core".这是一件微不足道的事情,但是我宁愿通过ARM模板正确配置它.我搜索了 Microsoft的文档,但找不到正确的属性.一个人该怎么做呢?
In order to run my ASP.Net Core-based web server, I have to manually switch the Stack Settings from ".Net" to ".Net Core". It's a trivial thing to do, but I'd much rather configure it correctly through the ARM template. I searched Microsoft's docs but was unable to find the correct property. How does one go about to do this?
推荐答案
以下是从门户网站创建时示例Web应用程序的外观:
here's how an example web app looks when created from the portal:
{
"apiVersion": "2018-02-01",
"name": "[parameters('name')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('location')]",
"properties": {
"name": "[parameters('name')]",
"siteConfig": {
"appSettings": [],
"metadata": [
{
"name": "CURRENT_STACK",
"value": "[parameters('currentStack')]"
}
]
},
// redacted some values
}
},
,当前堆栈值为dotnetcore
这篇关于如何设置Azure应用服务以通过Azure资源管理器在.Net Core上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!