Azure Service Fabric: Registering application type timed out

Visual Studio can be really handy to deploy a service fabric application, it hides all the chain of scripts that you otherwise should run by yourself. However when something goes wrong it’s not so simple to understand what actually is going on and how to fix it, especially without totally renouncing to VS help.

First problem that you may encounter with big applications, particularly if you have a slow connection, is a time out on the package copy:
Copy-ServiceFabricApplicationPackage : Operation timed out.
Fortunately in the latest Service Fabric SDK the deploy script exposes a CopyPackageTimeoutSec parameter.

Another issue I’ve encountered is a time out while registering the application.

Register-ServiceFabricApplicationType : Operation timed out.

Even though such function has a TimeoutSec parameter, it’s not exposed by the top-level script Deploy-FabricApplication nor in the latest Service Fabric SDK (v2.5.216.0) script called for the actual deployment Publish-UpgradedServiceFabricApplication. (All the following considerations hold also for a new application deploy with Publish-NewServiceFabricApplication).

The publish script are located in the SDK folder C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\, you could directly edit those scripts hard coding the timeout (or exposing it as an extra parameter) however it’s not so nice to change the SDK system-wide.

Personally I’ve copied and edited the publish script in my Visual Studio (2015) script folder. Then I called it from the deploy script of the SF project

. ".\Publish-UpgradedServiceFabricApplication-Custom" # Trust the script
Publish-UpgradedServiceFabricApplication-Custom @PublishParameters
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *