gpt4 book ai didi

azure - ARM模板-网站部署失败

转载 作者:行者123 更新时间:2023-12-04 13:09:21 26 4
gpt4 key购买 nike

我尝试使用 Azure 资源管理器 (ARM) 模板文件部署为 ASP.net 网站,但遇到了障碍。这是 Azure 的一项新兴功能,因此网络上没有太多关于它的专业知识,希望这里有人可以提供帮助。

我可以在新资源组中成功创建一个新网站(即 Microsoft.Web/sites 资源),即当我在 ARM 模板中定义网站时,它可以工作,如下所示:

{
"apiVersion": "2014-06-01",
"name": "[parameters('siteName')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('siteLocation')]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource",
"displayName": "Website"

},
"dependsOn": [
"[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
],
"properties": {
"name": "[parameters('siteName')]",
"serverFarm": "[parameters('hostingPlanName')]"
}
}

当我尝试将 ASP.net 网站部署到其中时,我的问题出现了。以下是我添加到 ARM 模板中的内容:

{
"apiVersion": "2014-06-01",
"name": "[parameters('siteName')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('siteLocation')]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource",
"displayName": "Website"

},
"dependsOn": [
"[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
],
"properties": {
"name": "[parameters('siteName')]",
"serverFarm": "[parameters('hostingPlanName')]"
},
"resources": [
{
"apiVersion": "2014-06-01",
"type": "extensions",
"name": "MSDeploy",
"dependsOn": [ "[concat('Microsoft.Web/sites/', parameters('siteName'))]" ],
"properties": {
"connectionString": "",
"dbType": "",
"packageUri": "file:///D:/svn/dh.PSP.Conductor/dh.PSP.Conductor.AzureResourceGroup/obj/Release/ProjectReferences/dh.PSP.Conductor.Api/package.zip"
}
}
]
}

我从 PowerShell 进行部署,但失败了:

New-AzureResourceGroup : 16:00:35 - Resource Microsoft.Web/sites/extensions 'ARMTest20150604/MSDeploy' failed with message 'The resource operation completed with terminal provisioning state 'Failed'.'

如果我查看门户,我会看到一个稍微有用的错误:

statusCode:Conflict statusMessage:{"status":"Failed","error":{"code":"ResourceDeploymentFailure","message":"The resource operation completed with terminal provisioning state 'Failed'."}}

enter image description here但我不知道为什么会失败。谁能建议我如何进一步调查?

最佳答案

错误是我的(正如你所料)。 packageUri 属性无法引用本地文件,需要先将文件上传到 Blob 存储。

我发现了其他有用的东西,可以通过浏览 https://websitename.scm.azurewebsites.net/DebugConsole 来获取部署日志。 、“cd logfiles\siteextensions\msdeploy”,打开 appManagerLog.xml。里面有更多有用的信息。就我而言:

<entry time="2015-06-04T15:28:12.0718158+00:00" type="Error">
<message>AppGallery Deploy Failed: 'System.UriFormatException: Invalid URI: The URI is empty.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at Microsoft.Web.Deployment.WebApi.AppGalleryPackage.IsPremiumApp()
at Microsoft.Web.Deployment.WebApi.DeploymentController.CheckCanDeployIfAppIsPremium(AppGalleryPackageInfo packageInfo, Boolean&amp;amp; isPremium)'</message>
</entry>
<entry time="2015-06-04T15:28:12.1186872Z" type="Message">
<message>Downloading package path 'D:\svn\dh.PSP.Conductor\dh.PSP.Conductor.AzureResourceGroup\obj\Release\ProjectReferences\dh.PSP.Conductor.Api\package.zip' from blob ''</message>
</entry>
<entry time="2015-06-04T15:28:12.1186872Z" type="Error">
<message>Failed to download package.</message>
</entry>

关于azure - ARM模板-网站部署失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30647671/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com