Setup a cluster on a remote machine without visual studio installed - azure-service-fabric

I have a dedicated machine with Windows Server 2012.
When I debug service fabric in local environment, I only need to click Run in Visual Studio and the cluster creation and all the setups a performed automatically. I don't have to call any scripts or configure the cluster.
Is there a way to have such easy creation of a cluster on a remote machine without any manual config editing and without VS installed on the remote machine?
I have read how to install a cluster on-premises, but I don't want to configure anything. Guess if Visual Studio can figure out the right configuration, there could be a way to simplify the process for a developer.

Assuming that you're looking to set up a one-box configuration on the remote machine, you can do that as follows:
On the remote machine, set up a dev environment using the runtime and SDK only (no VS tools).
In an Admin PowerShell, run c:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\DevClusterSetup.ps1.
This will set up a local cluster using the same configuration used by Visual Studio. In fact, all Visual Studio does is trigger this setup script.

Figured out that there are predefined templates for cluster's manifest. They are located inside Service Fabric SDK, \Microsoft SDKs\Service Fabric\ClusterSetup\NonSecure. Visual Studio use them to create a new cluster for development.
Not sure if we are able to obtain these configs without VS installed, but at least we can copy them from another development machine.

Related

Debug via SSH without visual studio code server

Is it possible to debug c++ on visual studio code without using visual studio code server and thus without installing extensions on the host?
I've tried using the local SSH FS extension on my client which doesn't need visual studio code server. However I am not able to step and inspect objects.
However I don't see a reason why it shouldn't work as other IDEs (e.g. netbeans) are able to use GDB as explained without installing anything on the host.

Remote Kubernetes development in Spyder (Python) with Okteto

For Visual Studio Code (VSC) it is possible to install the Remote-Kubernetes extension which allows you to work directly with remote development environments, spinning them up, configuring them etc. More info here.
Is something similar possible for Spyder?
I am aware that a connection to a remote kernel can be made but this seems to require for the remote environment to already be running. Am looking for same functionality as the okteto up command in VSC.

Debugging a Service Fabric application against a remote on-premises cluster using VS 2019

The development machine does not have enough capacity to host and run the Service Fabric cluster on the same machine where VS 2019 installed. So, a possible workaround would be having the cluster created on the local network (not Azure) and debug it remotely. Is it a feasible scenario, and if so how we can configure VS 2019 to remotely debug the application?
We have a doc for remote debugging a SF application using VS
https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-debugging-your-application#debug-a-remote-service-fabric-application
It doesn't appear it has been updated for VS 2019 though so some steps might be a bit different. But it is possible and should give you a place to start.

Connect-ServiceFabricCluster : Argument 'Connect-ServiceFabricCluster' is not recognized as a cmdlet: Unable to load DLL 'FabricCommon.dll'

I installed Service Fabric by using the Install the Service Fabric runtime, SDK, and tools for Visual Studio 2015 Update 2 link from Prepare your development environment.
Trying to publish a Service Fabric Application fails with:
2>Connect-ServiceFabricCluster : Argument 'Connect-ServiceFabricCluster' is not recognized as a cmdlet: Unable to load
2>DLL 'FabricCommon.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Same error described in Troubleshoot your local development cluster setup, but it does not matter what PowerShell version I use, 64 or 32.
The Service Fabric SDK version I got is 2.1.163.
I am running Windows 10 10586 with Visual Studio 2015 Update 3.
FabricCommon.dll is located at c:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\FabricCommon.dll
What am I missing?
I will focus on this error first:
DLL 'FabricCommon.dll': The specified module could not be found
You can fix this by re-installing the service fabric SDK. This happens to me before during installation and I thought it was fixed but you never know.
Also make sure you are using the same version of the SDK and nuget package that you referenced in your Service Fabric application.
A workaround for this issue (which does not include reinstall of the Service Fabric SDK) is to add the following to your path environment variable and restart the application which is throwing error (Visual Studio or PowerShell so that it can access the new environment variable):
C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code
You do not need to restart your computer, just restart the application after you have update the path environment variable. The dll fabricCommon.dll lives in this folder.
This workaround is inspired by (but is not identical to) the solution to a somewhat related issue presented here: https://social.msdn.microsoft.com/Forums/azure/en-US/6c8cc261-6c84-4097-be03-e8073cbc9397/unable-to-load-dll-fabricruntimedll?forum=AzureServiceFabric&prof=required
All I had to do is restart Visual Studio and it worked. This happens time to time.
Please Run Windows PowerShell as Administrator and then try.
I have experienced the same problem on my Win10 box, and even adding the relevant powershell module that contained necessary cmdlets didn't work. The solution that worked for me was: Control Panel -> "Programs and Features", uninstall Service Fabric SDK, then click "Turn Windows features on or off" link and uninstall PowerShell. Next, reboot Windows, back to Control Panel -> "Programs and Features" -> "Turn Windows features on or off", install PowerShell, after which download/install Service Fabric SDK. Again, restart the PC, start the Service Fabric Cluster Manager (if it doesn't auto-start), right-click its icon on the task-bar and try creating 1-node or 5-node cluster.
I was facing same issue on vs2017 and window server 2016. I reinstalled service fabric sdk and issue fixed.
I had similar issue after creating a cluster on windows server 2016.
In my scenario all I had to do was log out/in again and issue was fixed.
You could try restarting VM too - only if it still fails would I try re-installing the SDK.

Local servicefabric cluster no longer shown in server explorer in visual studio

I just upgraded the ServiceFabric SDK to version 1.5.175. In Visual Studio (2015) I no longer see the Local cluster in the Server Explorer.
Questions:
1) How can I add the Local cluster to the Server Explorer?
2) Is there another way to see the diagnostics log in Visual Studio (or elsewhere).
Thanks,
Bart
Going forward, the best experience for interacting with Azure resources (including the Service Fabric local cluster) in Visual Studio is Cloud Explorer.
You can also bring up the diagnostic viewer from View > Other Windows > Diagnostic Events Viewer.