发布到Azur失败,出现500内部服务器错误

时间:2022-12-15 18:21:38

I have a cloud service on Windows Azure, I created a Asp.net WebAPI project and published to the cloud service, that was working fine from Visual Studio to publish before i updated visual studio to update 4 and azure SDK 2.2 to 2.6. But after updating when I publish, I got the following error messages. I tried several times, all failed. Can anyone help me?

我在Windows Azure上有一个云服务,我创建了一个Asp.net WebAPI项目并发布到云服务,在我将visual studio更新到更新4和azure SDK 2.2到2.6之前,它在Visual Studio中正常工作。但在我发布更新后,我收到以下错误消息。我试了几次,都失败了。谁能帮我?

even i am not able to publish a new created project on new azure service !

即使我无法在新的天蓝色服务上发布新创建的项目!

11:00:31 PM - Warning: There are package validation warnings.

11:00:31 PM - 警告:有包验证警告。

11:00:31 PM - Checking for Remote Desktop certificate...

11:00:31 PM - 检查远程桌面证书...

11:00:39 PM - Preparing deployment for TempAzure - 2/12/2014 10:58:23 PM with Subscription ID 'e94e9aeb-7003-4eae-be92-7b7ac0a1ba2c' using Service Management URL 'https://management.core.windows.net/'...

11:00:39 PM - 使用服务管理URL'https://management.core准备部署TempAzure - 2/12/2014 10:58:23 PM,订阅ID为'e94e9aeb-7003-4eae-be92-7b7ac0a1ba2c'。 windows.net /” ...

11:00:39 PM - Connecting...

11:00:39 PM - 正在连接...

11:00:39 PM - Verifying storage account 'jasontest'...

11:00:39 PM - 验证存储帐户'jasontest'...

11:00:41 PM - Uploading Package...

11:00:41 PM - 上传套餐......

11:06:48 PM - Warning: The remote server returned an error: (500) Internal Server Error.

11:06:48 PM - 警告:远程服务器返回错误:(500)内部服务器错误。

11:11:50 PM - Warning: The remote server returned an error: (500) Internal Server Error.

11:11:50 PM - 警告:远程服务器返回错误:(500)内部服务器错误。

11:26:16 PM - Warning: The remote server returned an error: (500) Internal Server Error.

11:26:16 PM - 警告:远程服务器返回错误:(500)内部服务器错误。

12:00:27 AM - Warning: The remote server returned an error: (500) Internal Server Error.

12:00:27 AM - 警告:远程服务器返回错误:(500)内部服务器错误。

12:05:05 AM - Warning: The remote server returned an error: (500) Internal Server Error.

12:05:05 AM - 警告:远程服务器返回错误:(500)内部服务器错误。

12:27:54 AM - Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.

12:27:54 AM - 无法将数据写入传输连接:远程主机强行关闭现有连接。

2 个解决方案

#1


After updating from Azure SDK2.5 to SDK 2.6, I had the same problem when trying publish to my Azure service from VS2013: Any deployment effort using Visual Studio fails after some minutes with 500 Internal server error.

从Azure SDK2.5更新到SDK 2.6后,尝试从VS2013发布到我的Azure服务时遇到了同样的问题:使用Visual Studio的任何部署工作在几分钟后因500内部服务器错误而失败。

As I found the reason is the very slow upload of the Azure package to the cloud - sometimes only between 30kB/s and 50kB/s. The deployment fails because of an timeout which also explains, that the Azure instance logs show no sign of any deployment...

我发现原因是Azure包上传到云端的速度很慢 - 有时只有30kB / s到50kB / s之间。部署失败是因为超时也说明Azure实例日志没有显示任何部署的迹象......

Work around: Deploy from Azure storage

解决方法:从Azure存储部署

1: Package the Azure solution, either via VisualStudio or via command line:

1:通过VisualStudio或命令行打包Azure解决方案:

MSBuild /t:Publish /p:TargetProfile=Cloud /P:Configuration=Release

MSBuild / t:Publish / p:TargetProfile = Cloud / P:Configuration = Release

2: Create an Azure storage container to upload your package to.

2:创建Azure存储容器以将包上载到。

Continue using AzurePowerShell cmdlets:

继续使用AzurePowerShell cmdlet:

3: Login

Add-AzureAccount

4: Upload the package to the your Azure storage container

4:将程序包上载到Azure存储容器

$Ctx = New-AzureStorageContext -StorageAccountName "yourstoragename" -StorageAccountKey "yourkey"

$ Ctx = New-AzureStorageContext -StorageAccountName“yourstoragename”-StorageAccountKey“yourkey”

Set-AzureStorageBlobContent -File "...\app.publish\yourservice.cspkg" -Container "yourazurestoragecontainer" -Blob "yourservice.cspkg" -Context $Ctx -Force

Set-AzureStorageBlobContent -File“... \ app.publish \ yourservice.cspkg”-Container“yourazurestoragecontainer”-Blob“yourservice.cspkg”-Context $ Ctx -Force

Determine the PackageURL of the uploaded package.

确定上载包的PackageURL。

5: Deploy the cloud service referring to the package just uploaded to Azure cloud storage.

5:部署云服务,参考刚刚上传到Azure云存储的软件包。

Set-AzureDeployment -Upgrade -Slot "Staging" -Package "PackageURL" -Configuration "PathToYourCloudConfiguration.cscfg" -label "SomeDeploymentInfo" -ServiceName "yourservicename" -Force

Set-AzureDeployment -Upgrade -Slot“Staging”-Package“PackageURL”-Configuration“PathToYourCloudConfiguration.cscfg”-label“SomeDeploymentInfo”-ServiceName“yourservicename”-Force

(Of course the entire process is scriptable. Kemp Brown wrote a great article: with a script you could adapt to explictly upload the package: Continuous Delivery for Cloud Services in Azure)

(当然整个过程都是可编写脚本的.Kemp Brown写了一篇很棒的文章:用一个脚本你可以适应显然上传包:Azure中的云服务持续交付)

#2


Actually the problem was my network connection.

实际上问题是我的网络连接。

to identify this problem i created VM on azure with same windows 8.1 OS and same VS. i tried to deploy from there. deployment worked fine. latter I disconnected all other devices from my internet connection and i tried to publish from my machine. it worked !

为了识别这个问题,我使用相同的Windows 8.1操作系统和相同的VS在azure上创建了VM。我试图从那里部署。部署工作正常。后者我从我的互联网连接断开所有其他设备,我试图从我的机器发布。有效 !

so conclusion is slow internet connection or may be now we have less timeout time for publish from VS !

所以结论是互联网连接缓慢,或者现在我们从VS发布的暂停时间更短!

#1


After updating from Azure SDK2.5 to SDK 2.6, I had the same problem when trying publish to my Azure service from VS2013: Any deployment effort using Visual Studio fails after some minutes with 500 Internal server error.

从Azure SDK2.5更新到SDK 2.6后,尝试从VS2013发布到我的Azure服务时遇到了同样的问题:使用Visual Studio的任何部署工作在几分钟后因500内部服务器错误而失败。

As I found the reason is the very slow upload of the Azure package to the cloud - sometimes only between 30kB/s and 50kB/s. The deployment fails because of an timeout which also explains, that the Azure instance logs show no sign of any deployment...

我发现原因是Azure包上传到云端的速度很慢 - 有时只有30kB / s到50kB / s之间。部署失败是因为超时也说明Azure实例日志没有显示任何部署的迹象......

Work around: Deploy from Azure storage

解决方法:从Azure存储部署

1: Package the Azure solution, either via VisualStudio or via command line:

1:通过VisualStudio或命令行打包Azure解决方案:

MSBuild /t:Publish /p:TargetProfile=Cloud /P:Configuration=Release

MSBuild / t:Publish / p:TargetProfile = Cloud / P:Configuration = Release

2: Create an Azure storage container to upload your package to.

2:创建Azure存储容器以将包上载到。

Continue using AzurePowerShell cmdlets:

继续使用AzurePowerShell cmdlet:

3: Login

Add-AzureAccount

4: Upload the package to the your Azure storage container

4:将程序包上载到Azure存储容器

$Ctx = New-AzureStorageContext -StorageAccountName "yourstoragename" -StorageAccountKey "yourkey"

$ Ctx = New-AzureStorageContext -StorageAccountName“yourstoragename”-StorageAccountKey“yourkey”

Set-AzureStorageBlobContent -File "...\app.publish\yourservice.cspkg" -Container "yourazurestoragecontainer" -Blob "yourservice.cspkg" -Context $Ctx -Force

Set-AzureStorageBlobContent -File“... \ app.publish \ yourservice.cspkg”-Container“yourazurestoragecontainer”-Blob“yourservice.cspkg”-Context $ Ctx -Force

Determine the PackageURL of the uploaded package.

确定上载包的PackageURL。

5: Deploy the cloud service referring to the package just uploaded to Azure cloud storage.

5:部署云服务,参考刚刚上传到Azure云存储的软件包。

Set-AzureDeployment -Upgrade -Slot "Staging" -Package "PackageURL" -Configuration "PathToYourCloudConfiguration.cscfg" -label "SomeDeploymentInfo" -ServiceName "yourservicename" -Force

Set-AzureDeployment -Upgrade -Slot“Staging”-Package“PackageURL”-Configuration“PathToYourCloudConfiguration.cscfg”-label“SomeDeploymentInfo”-ServiceName“yourservicename”-Force

(Of course the entire process is scriptable. Kemp Brown wrote a great article: with a script you could adapt to explictly upload the package: Continuous Delivery for Cloud Services in Azure)

(当然整个过程都是可编写脚本的.Kemp Brown写了一篇很棒的文章:用一个脚本你可以适应显然上传包:Azure中的云服务持续交付)

#2


Actually the problem was my network connection.

实际上问题是我的网络连接。

to identify this problem i created VM on azure with same windows 8.1 OS and same VS. i tried to deploy from there. deployment worked fine. latter I disconnected all other devices from my internet connection and i tried to publish from my machine. it worked !

为了识别这个问题,我使用相同的Windows 8.1操作系统和相同的VS在azure上创建了VM。我试图从那里部署。部署工作正常。后者我从我的互联网连接断开所有其他设备,我试图从我的机器发布。有效 !

so conclusion is slow internet connection or may be now we have less timeout time for publish from VS !

所以结论是互联网连接缓慢,或者现在我们从VS发布的暂停时间更短!