Operation timed out publishing Service Fabric application to Azure

╄→尐↘猪︶ㄣ 提交于 2020-01-23 06:59:47

问题


When I try to publish my Service Fabric application to a Azure cluster I get the following error message:

3>Copy-ServiceFabricApplicationPackage : Operation timed out.
3>At C:\Program Files\Microsoft SDKs\Service 
3>Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:230 char:9
3>+         Copy-ServiceFabricApplicationPackage -ApplicationPackagePath  ...
3>+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3>    + CategoryInfo          : OperationTimeout: (:) [Copy-ServiceFabricApplicationPackage], TimeoutException
3>    + FullyQualifiedErrorId : CopyApplicationPackageErrorId,Microsoft.ServiceFabric.Powershell.CopyApplicationPackage
3> 
3>Finished executing script 'Deploy-FabricApplication.ps1'.
3>Time elapsed: 00:12:45.2589165

Apperently there is a hard-coded 10 minute timeout in the publish script as you can read here: https://github.com/Azure/service-fabric-issues/issues/10

This timeout will be removed in an upcomming release, but in the mean time what are my options? Is there a way I can publish my application service by service?

Any suggestion is welcome!


回答1:


I've solved this by having a virtual machine running in azure. I've installed Visual Studio 2015 community and the service fabric SDK.

I then use Visual Studio Online to host my code. I build and test locally, and when I'm happy, commit to visual studio online, then RDP onto my build machine and then pull, build and deploy from there.

I've actually gone one step further by creating build and deploy powershell scripts so I don't need to run visual studio.




回答2:


This problem has been addressed in version 2.5.216 of the Service Fabric SDK.

In the publish profile schema, you can now:

  • Compress the package to speed up transfer
  • Set the timeout duration to a value greater than 10 minutes

Add the following line to the PublishProfiles\Cloud.xml file to enable compression and change the timeout from 10 minutes to 60 minutes:

<CopyPackageParameters CopyPackageTimeoutSec="3600" CompressPackage="true" />



回答3:


I followed a similar approach to Andrew Shepherd suggestion. Edited the powershell deployment file located in <MyServiceFabricApp>\Scripts\Deploy-FabricApplication.ps1 and changed the $CopyPackageTimeoutSec variable to 3600. A code snippet is shown below :

Param
(
....

[int]
$CopyPackageTimeoutSec = 3600
)
...


来源:https://stackoverflow.com/questions/38688268/operation-timed-out-publishing-service-fabric-application-to-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!