Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Publish-NewServiceFabricApplication or equivalent should be part of the SDK #135

Closed
troshko111 opened this issue Jan 17, 2017 · 7 comments
Closed

Comments

@troshko111
Copy link

VS generated Scripts\Deploy-FabricApplication.ps1 uses Publish-NewServiceFabricApplication which is dynamically imported as:

$RegKey = "HKLM:\SOFTWARE\Microsoft\Service Fabric SDK"
$ModuleFolderPath = (Get-ItemProperty -Path $RegKey -Name FabricSDKPSModulePath).FabricSDKPSModulePath
Import-Module "$ModuleFolderPath\ServiceFabricSDK.psm1"

Such API should really be part of the SDK (ServiceFabric PowerShell module), right now to automate application deployment using PowerShell we have to manually import said function from said location.

@mikkelhegn
Copy link

The Scripts\Deploy-FabricApplication.ps1 is tied to you SF Application project in VS and part of the tooling, not the SDK/API. You could go ahead and change it to your applications need. It is also being used by VS to deploy locally.

For any automation scenarios, I would recommend not relying on this script, but rather use the SDK provided functions or the CMDlets / APIs in the runtime.

We don't consider the SDK provided functions to be APIs.

@troshko111
Copy link
Author

Publish-NewServiceFabricApplication is much much nicer, you connect to the cluster, run this cmdlet giving it a path and settings - and you're done. This is what PS experience also looks like for deploying websites and other things. Just one cmdlet. With SDK, you need

Copy-ServiceFabricApplicationPackage
Register-ServiceFabricApplicationType
New-ServiceFabricApplication

which require quite some arguments getting which is many lines of boilerplate.

I'd say providing analog to Publish-NewServiceFabricApplication in the SDK would be really nice

your call anyway, but SDK does not seem very friendly when it comes to publishing, imo the amount of boilerplate could be less

@gperrego
Copy link

gperrego commented Feb 6, 2017

I agree that it is clean using Publish-NewServiceFabricApplicaiton. We are having issues identifying how to pass a publish profile via the API? I'm not seeing any other powershell that allows you to pass the publish profile, just the Hashtable to override the values?

https://docs.microsoft.com/en-us/powershell/servicefabric/vlatest/new-servicefabricapplication

[-ApplicationParameter ]

Am I missing something?

@mikkelhegn
Copy link

@gperrego The API does not support Publish Profiles, but the scripts and functions you've discovered in the SDK does. You can use these scripts to see how it can be done.

@alltej
Copy link

alltej commented Sep 7, 2017

@mikkelhegn do you use the SDK cmdlets (Copy-, Register-,New-*) for upgrading existing SF apps?

@mikkelhegn
Copy link

@alltej 2 of 3 :-)

  1. Copy- (puts the app package in to the image store in the cluster)
  2. Register- (Registers the package in the cluster) Application Packages are Types (combination of Type and Version). Once they are registered they are available to be instantiated.

Now it's either New- or Start-ServiceFabricApplicationUpgrade

New- (Creates a new Application Instance of the specified type+version. Becomes a unique app instance in the cluster with the uri fabric:/MyAppInstance).
Start-ServiceFabricApplicationUpgrade- (Upgrades an application instance to the specified type+version). If you have multiple instances of the same application type in the cluster, you upgrade them individually.

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-tutorial-powershell

@artisticcheese
Copy link

Do any of you guys have a good walkthrough of automation of deployment of application outside of Visual Studio for windows containers. Since container applications do not contain any code and only configuration files.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants