我正在关注这个 Azure Devops 实验室:https://azuredevopslabs.com/labs/vstsextend/github-azurepipelines/#task-4-embedding-automated
但是当我部署应用程序时出现此错误:
您的部署出现错误。错误代码:DeploymentFailed。
##[error]至少有一个资源部署操作失败。请列出部署操作以了解详情。请参阅https://aka.ms/arm-debug了解使用详情。
##[error]详细信息:
##[error]BadRequest:{
“error”:{
“code”:“InternalServerError”,
“message”:“发生意外的InternalServerError。请
稍后重试。x-ms-correlation-request-id:a016b467-fbd6-4851-a411-30f253ad4854”
}
} undefined
##[error]创建或更新模板部署时任务失败。
我不知道哪个参数是错误的,我尝试手动部署但仍然失败。
附件是我用来进行部署的部署细节。
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"p_environment": {
"type": "string"
},
"p_separator": {
"defaultValue": "-",
"type": "string"
},
"p_site_prefix": {
"defaultValue": "githubci",
"type": "string"
},
"p_site_web_name": {
"defaultValue": "web",
"type": "string"
},
"p_comosdb_name": {
"defaultValue": "db",
"type": "string"
}
},
"variables": {
"site_web_name": "[concat(parameters('p_site_prefix'), parameters('p_separator'), parameters('p_site_web_name'), parameters('p_separator'), parameters('p_environment'))]",
"comosdb_default_name": "[concat(parameters('p_site_prefix'), parameters('p_separator'), parameters('p_comosdb_name'), parameters('p_separator'), parameters('p_environment'))]"
},
"resources": [
{
"type": "Microsoft.DocumentDB/databaseAccounts",
"kind": "MongoDB",
"name": "[variables('comosdb_default_name')]",
"apiVersion": "2015-04-08",
"location": "[resourceGroup().location]",
"tags": {
"defaultExperience": "MongoDB"
},
"scale": null,
"properties": {
"name": "[variables('comosdb_default_name')]",
"databaseAccountOfferType": "Standard",
"consistencyPolicy": {
"defaultConsistencyLevel": "Session",
"maxIntervalInSeconds": 5,
"maxStalenessPrefix": 100
}
},
"dependsOn": []
},
{
"type": "Microsoft.Web/sites",
"kind": "app",
"name": "[variables('site_web_name')]",
"apiVersion": "2016-08-01",
"location": "[resourceGroup().location]",
"properties": {
"name": "[variables('site_web_name')]",
"reserved": false,
"siteConfig": {
"appSettings": [
{
"name": "COSMOS_DB_NAME",
"value":"[variables('comosdb_default_name')]"
},
{
"name": "COSMOS_DB_AUTH_KEY",
"value": "[listKeys(resourceId('Microsoft.DocumentDb/databaseAccounts', variables('comosdb_default_name')), '2015-04-08').primaryMasterKey]"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "8.9.4"
}
]
}
},
"dependsOn": [
"[concat('Microsoft.DocumentDB/databaseAccounts/', variables('comosdb_default_name'))]"
]
}
],
"outputs": {
"web": {
"type": "string",
"value": "[variables('site_web_name')]"
}
}
}
提前致谢,
此致。
答案1
我知道缺少了什么。
似乎实验室中缺少一个步骤。它应该说,在部署应用程序之前,您必须在 Azure 上创建一个应用服务层,其域与实验室中显示的域相同:githubci-web-...
此致敬礼。
代码安全。