FabricConnectionDeniedException - Where can I configure Azure Service Fabric connections?

I am trying to create a Visual Studio project template that includes a Fabric Project Azure project StatelessService.

In the boiler plate ProgramI get the EntryPoint code FabricConnectionDeniedException. Where can I configure connection information or otherwise fix this exception? I work against Local Cluster Manager. I have looked at various configuration files .xml, but can’t see anything. Do I need to whitelist my applications in cluster manager?

Here is the boiler plate code that I copied from Azure Service Fabric:

    private static void Main()
    {
        try
        {
            // Creating a FabricRuntime connects this host process to the Service Fabric runtime.
            using (var fabricRuntime = System.Fabric.FabricRuntime.Create())
            {
                // The ServiceManifest.XML file defines one or more service type names.
                // RegisterServiceType maps a service type name to a .NET class.
                // When Service Fabric creates an instance of this service type,
                // an instance of the class is created in this host process.
                fabricRuntime.RegisterServiceType(
                    "RunSetManagerServiceType", 
                    typeof(RunSetManagerService));

                ServiceEventSource.Current.ServiceTypeRegistered(
                    Process.GetCurrentProcess().Id, 
                    typeof(RunSetManagerService).Name);

                // Prevents this host process from terminating to keep the service host process running.
                Thread.Sleep(Timeout.Infinite);  
            }
        }
        catch (Exception e)
        { 
           // !!!!!! GETTING FabricConnectionDeniedException HERE !!!!!
            ServiceEventSource.Current.ServiceHostInitializationFailed(e.ToString());
            throw;
        }
    }
+4
source share
1 answer

- , EXE Service Fabric. EXE, ; "" Service Fabric, Fabric.

Visual Studio, , , ( ).

, , , : 2.0.135 SDK, ServiceRuntime:

try
{
    ServiceRuntime.RegisterServiceAsync("RunSetManagerServiceType",
        context => new RunSetManagerService(context)).GetAwaiter().GetResult();

    ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(Stateless1).Name);

    // Prevents this host process from terminating so services keep running.
    Thread.Sleep(Timeout.Infinite);
}
catch (Exception e)
{
    ServiceEventSource.Current.ServiceHostInitializationFailed(e.ToString());
    throw;
}
+4
source

All Articles