我目前有一个代码库,其中包含许多经典的Azure云服务工作者角色。从长远来看,我想将整个基础结构迁移到Azure Service Fabric,但是第一步,我想更新部署模型以使用ARM模板。
I found another answer that seems to have a barebones ARM template to deploy a Cloud Service (classic) component,但是我不确定如何将其转换为自己的应用程序。
具体地说,我将如何/在哪里定义我的工作人员角色的csdef file中的以下标记和属性:
WorkerRole (name, vmsize)
startup tasks (command line, execution context, task type, task variables)
configuration settings
certificates
localresources
它是cscfg files:
Serviceconfiguration (name, osFamily, osVersion)
Role (name)
Instances (count)
ConfigurationSettings (and all the setting name/values under it)
certificates
答案 0 :(得分:1)
不幸的是,今天无法使用ARM模板部署PaaS v1 Cloud Services部署(Web /工作人员角色)。您引用的另一篇SO帖子仅是部署云服务(生产和暂存插槽的逻辑父级),而不是将实际服务本身部署到生产或暂存插槽之一。
答案 1 :(得分:0)
可以使用ARM部署传统的云服务:
*.cspkg
文件的uri。 *.cscfg
文件的uri。我建议您在部署模板之前将文件上传到Blob存储。
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [{
"apiVersion": "2015-06-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"type": "Microsoft.ClassicCompute/domainNames"
},
{
"apiVersion": "2015-06-01",
"name": "[parameters('slotName')]",
"type": "Microsoft.ClassicCompute/domainNames/slots",
"dependsOn": [
"[parameters('name')]"
],
"properties": {
"deploymentLabel": "[parameters('deploymentLabel')]",
"packageLink": {
"Uri": "[parameters('packageLink')]"
},
"configurationLink": {
"Uri": "[parameters('configurationLink')]"
},
"deploymentOptions": "[parameters('deploymentOptions')]"
}
}
]
}
如果您需要更多信息(例如添加证书),请告诉我。