Git Product home page Git Product logo

service-fabric-dotnet-getting-started's Introduction

page_type description languages products
sample
The project contains an application demonstrating the concepts needed to get started building highly-available, distributed applications.
csharp
azure
azure-service-fabric

Service Fabric Getting Started Sample

This repository contains an introductory sample project for Microsoft Azure Service Fabric. The sample project contains a single application with multiple services demonstrating the basic concepts needed to get you started building highly-available, scalable, distributed applications.

Looking for the older getting started samples? They're in the classic branch.

More info on Service Fabric:

Building and deploying

First, set up your development environment with Visual Studio 2017. Make sure you have at least version 15.1 of Visual Studio 2017 installed.

Looking for the Visual Studio 2015 version? It's in the vs2015 branch.

This sample application can be built and deployed immediately using Visual Studio 2017. To deploy on the local cluster, you can simply hit F5 to debug the sample. If you'd like to try publishing the sample to an Azure cluster:

  1. Right-click on the application project in Solution Explorer and choose Publish.
  2. Sign-in to the Microsoft account associated with your Azure subscription.
  3. Choose the cluster you'd like to deploy to.
    • Ensure that your cluster has the reverse proxy feature enabled, more info
  4. Add a Load Balancing Rule to map the inbound port 8081 to the same port on the backend pool, more info

About this sample application

The sample application contains several services, each demonstrating how to use key parts of Service Fabric.

Web Service

This is a stateless front-end web service using ASP.NET Core in a Reliable Service. This service demonstrates a basic front-end service that acts as a gateway for users into your application. It presents a single-page application UI and an HTTP API to interact with the rest of the application. This is the only service that exposes an endpoint to the Internet for users to interact with, and all user ingress to the application comes through this service.

Key concepts

  • Stateless public-facing ASP.NET Core service using WebListener
  • Communicating with other services in a variety of ways:
    • Over HTTP to another service using the Service Fabric Reverse Proxy
    • RPC calls with Service Remoting
    • RPC calls to a Reliable Actor service
  • Communicating with partitioned services, including partition key generation, querying, and aggregation.
  • Using the Service Fabric cluster querying APIs
  • Dependency injection of Service Fabric components into an ASP.NET Core application

Guest EXE Backend Service

This is a simple guest executable service that is not built on Reliable Services, Reliable Actors, or any Service Fabric APIs. It is a pre-compiled EXE that is packaged up and run on Service Fabric as-is. The EXE is a simple web server that returns the machine name of the node it is currently running on.

Key concepts

  • How to take an existing executable and host it on Service Fabric.

Stateless Backend Service

This is a stateless back-end service using Service Remoting. This service demonstrates a basic back-end service that can be used for processing work with an RPC API to check the status of that work.

Key concepts

  • Stateless internal-only service
  • Setting up Service Remoting

Stateful Backend Service

This is a stateful back-end service using ASP.NET Core. This service demonstrates the use of Reliable Collections in a stateful service. It presents an internal-only HTTP API for other services to interact with.

Key concepts

  • Stateful internal-only ASP.NET Core service using Kestrel
  • Reliable Collections
  • Service partitioning
  • Dependency injection of IReliableStateManager for use in MVC controllers

Actor Backend Service

This is a back-end Reliable Actor service. This service demonstrates how to set up a Reliable Actor service and use its features to implement a simple process service using the Virtual Actor model.

Key concepts

  • Reliable Actors with persisted state
  • Reminders and basic Reliable Actor lifecycle

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

service-fabric-dotnet-getting-started's People

Contributors

acomsmpbot avatar bharatnarasimman avatar craftyhouse avatar erikadoyle avatar johnnymaxk avatar knizkar avatar krzysztof-cieslak avatar masnider avatar mikewo avatar mikkelhegn avatar seanmck avatar shawnweisfeld avatar supernova-eng avatar vipul-modi avatar vturecek avatar youngjaekim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

service-fabric-dotnet-getting-started's Issues

Questions about HttpClient used in InvokeWithRetry

Hey guys,

I have some questions about the HttpClient used to call the services:

  • How should the method be used because if I call a Service that moved (e.g. I get 404 or 410) there should be a retry but normally there is no exception. Do I have to throw my own exception and handle it. with a retry??

and another one:

  • is there some kind of logging what's going on while sending the request / retrying?

Thanks.

Sample doesn't build correctly in Release config

The Release build settings for the WebService and StatefulBackendService projects are set to x86. That causes "MSB3270: There was a mismatch between the processor architecture of the project being built "x86" and the processor architecture of the reference. [...] "AMD64" when building the project in Release mode.

Thread.Sleep instead of Task.Delay?

I am surprised to see

Thread.Sleep(Timeout.Infinite);

and not

async Task Main...
...
await Task.Delay(Timeout.Infinite);

My concern is that, Thread.Sleep is a blocking operation. Won't it completely disable 1 thread from doing any work at all times? Won't Task.Delay give the thread back to the scheduler instead so it could do whatever it has to, while it simply await and not blocks?

Please let me know if the example is simply outdated or if it is justified. Thanks!

System.Collections.Generic.KeyNotFoundException in mscorlib.dll at runtime

When I run this sample, I get a stream of "Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll"

I've pulled the latest source, restarted VS, restarted my machine, cleaned/rebuilt, and even updated to the latest Service Fabric SDK. I get the same issue when I perform file->new Stateful Service.

It seems like I'm not the only person having difficulty running the samples:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/6ca0527a-8aa7-44e4-bca2-7087f217a434/problem-deploying-helloworldstateful-stateful-service?forum=AzureServiceFabric

Any advice on this? Is there something obvious that I haven't tried? What information can I provide to help track this down?

Cannot deploy fabric application

We are (from Visual Studio 2015) trying to deploy a little solution (with a stateful actor) to the local machine, but cannot get through the deployment phases. The following error occurs:

Finished executing script 'Set-LocalClusterReady'.
Time elapsed: 00:00:01.8736772
Started executing script 'Deploy-FabricApplication.ps1'.
. 'C:\Users\My name\Desktop\TestProject\TestProject\Scripts\Deploy-FabricApplication.ps1' -ApplicationPackagePath 'C:\Users\My Name\Desktop\TestProject\TestProject\pkg\Debug' -PublishProfileFile 'C:\Users\My Name\Desktop\TestProject\TestProject\PublishProfiles\Local.xml' -DeployOnly:$false -UnregisterUnusedApplicationVersionsAfterUpgrade $false -ForceUpgrade $false -OverwriteBehavior 'SameAppTypeAndVersion' -ErrorAction Stop
Test-ServiceFabricApplicationPackage : Could not find a part of the path 'Microsoft.AspNet.PageExecutionInstrumentation.Interfaces.dll'.
At C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\Publish-UpgradedServiceFabricApplication.ps1:107 char:34
+ ... tionSuccess = (Test-ServiceFabricApplicationPackage $AppPkgPathToUse)
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Test-ServiceFabricApplicationPackage], DirectoryNotFoundException
    + FullyQualifiedErrorId : System.IO.DirectoryNotFoundException,Microsoft.ServiceFabric.Powershell.TestApplicationPackage

Some version information:

Microsoft.AspNet.PageExecutionInstrumentation.Interfaces: 1.0.0-rc1-final
Microsoft.ServiceFabric: 4.4.87-preview
Microsoft.ServiceFabric.Actors: 1.4.87-preview
Microsoft.ServiceFabric.Data: 1.4.87-preview
Microsoft.ServiceFabric.Services: 1.4.87-preview

How to get access to :8081/visualobjects when deployed in Azure Cluster?

Hello!

Thanks for great example! Locally works great and I able to access localhost:8081/visualobjects endpoint. Though when I trying to deploy cluster to Azure I can't find the way I could access this page. First I made LB Rule for 8081, but as web service deployed on only one of five VMs (nodes) it only available if LB choose right VM to make request.

Could you please clarify how to make right deployment and config of VisualObject example to Azure Cluster.

Thanks in advance!

StateManager availability in ICommunicationListeners

This is more of a question.

From the samples, it looks like StateManager is available when communication listeners are created/opened. For example, in the AlphabetPartitions sample, Alphabet.Web HttpCommunicationListener the usage of the state manager to access and write the RC "dictionary" seems to be possible the moment communication listener is opened (OpenAsync() in invoked). The request will be processed right away. Based on what I've seen, the state manager while available is not really usable until RunAsync() of a service in invoked.

Tried to sketch a lifecycle and state manager timeline
image

  1. Is that so?
  2. If StateManager cannot be used until certain point in the life-cycle of a stateful service, does that mean SF simply doesn't forward any HTTP requests to the service even though communication listeners OpenAsync() has been executed?

this application no longer runs on VS2017, can you please update?

GettingStartedApplication\GettingStartedApplication.sfproj: The application which this project type is based on was not found. Please try this link for further information: https://go.microsoft.com/fwlink/?LinkId=660751&projecttype=A07B5EB6-E848-4116-A8D0-A826331D98C6

I have followed the steps from here: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started

Installed SDK and enabled owershell script, and Visual Studio 2017, below is the version information of vs2017:

Microsoft Visual Studio Professional 2017
Version 15.9.36
VisualStudio.15.Release/15.9.36+28307.1525
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Professional

Application Insights Tools for Visual Studio Package 8.14.20131.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017 15.9.04012.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services 15.8.31590
Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2017 5.2.61435.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 15.9.03024.0
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 15.9.03024.0
Azure Functions and Web Jobs Tools

C# Tools 2.10.0-beta2-63501-03+b9fb1610c87cccc8ceb74a770dba261a58e39c4a
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service 2.0
JavaScript Language Service

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.20417.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 1.0
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

NuGet Package Manager 4.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info

SQL Server Data Tools 15.1.62002.01090
Microsoft SQL Server Data Tools

TypeScript Tools 15.9.30718.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 2.10.0-beta2-63501-03+b9fb1610c87cccc8ceb74a770dba261a58e39c4a
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.2 for F# 4.5 15.8.0.0. Commit Hash: 6e26c5bacc8c4201e962f5bdde0a177f82f88691.
Microsoft Visual F# Tools 10.2 for F# 4.5

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers

System.Net.WebException: Unable to connect to the remote server

Please assist with this problem I encounter:

On the page http://localhost:8081/Home/Stateful, when I enter a key value paid and click the Add button, a "404 Not Found" is displayed (Figure 1).

The debug output is as follows:

Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker: Information: Executing action method WebService.Controllers.StatefulBackendServiceController.PutAsync (WebService) with arguments ([B, Bing]) - ModelState is Valid
...
Exception thrown: 'System.Net.Http.HttpRequestException' in mscorlib.dll
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware: Error: An unhandled exception has occurred: An error occurred while sending the request.

System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:19081
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
   at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at WebService.Controllers.StatefulBackendServiceController.<PutAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionFilterAsync>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()

Figure 1
image

Actor service does not function correctly

This is the code for the Actor service:

public async Task StartProcessingAsync(CancellationToken cancellationToken)
{
    try
    {
        // this throws an exception
        this.GetReminder(ReminderName);
            
        // therefore this never gets called
        bool added = await this.StateManager.TryAddStateAsync<long>(StateName, 0);

        if (!added)
        {
            // value already exists, which means processing has already started.
            throw new InvalidOperationException("Processing for this actor has already started.");
        }
    }
    catch (ReminderNotFoundException)
    {
        await this.RegisterReminderAsync(ReminderName, null, TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(10));
    }
}

public async Task ReceiveReminderAsync(string reminderName, byte[] context, TimeSpan dueTime, TimeSpan period)
{
    if (reminderName.Equals(ReminderName, StringComparison.OrdinalIgnoreCase))
    {
        // since TrySetState never gets called -- this will cause an exception
        long currentValue = await this.StateManager.GetStateAsync<long>(StateName);

        ActorEventSource.Current.ActorMessage(this, $"Processing. Current value: {currentValue}");

        await this.StateManager.SetStateAsync<long>(StateName, ++currentValue);
    }
}

The ActorBackendService controller will use the proxy to call this method. GetReminder will throw an exception which will go to the catch block and call RegisterReminderAsync.

Once the reminder is received it tries to use GetState but the state was never initialized because GetReminder threw an exception and skipped the rest of the code.

The example throw System.TypeInitializationException after a successful build with a clean downloaded code

I download the code and with updated nugget package and not updated package the code is throwing this exception:

I have installed SF version: 5.7.198.9494

System.TypeInitializationException occurred
HResult=0x80131534
Message=The type initializer for 'Microsoft.ServiceFabric.Actors.Runtime.ActorRuntime' threw an exception.
Source=Microsoft.ServiceFabric.Actors
StackTrace:
at Microsoft.ServiceFabric.Actors.Runtime.ActorRuntime.RegisterActorAsync[TActor](Func`3 actorServiceFactory, TimeSpan timeout, CancellationToken cancellationToken)
at ActorBackendService.Program.Main() in C:\service-fabric-demo\src\GettingStartedApplication\ActorBackendService\Program.cs:line 34

Inner Exception 1:
InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'IFabricNodeContextResult2'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{472BF2E1-D617-4B5C-A91D-FABED9FF3550}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

Dependency Injection with .net core

Hi,

I'm using service fabric with a .net core service that registers a few dependent web socket classes in that Startup class. I would like to give the service class the ability to access these classes via dependency injection but I do not see a way to do that with the way the service is initialized.

For example, in the main function is where the service registration is called, but it isn't until CreateServiceInstanceListeners until Startup.cs is called which initially registers the dependencies.

Is there anyway to achieve this?

Thanks!

Can't deploy visual objects to SF Party

Repro

  • clone this repo
  • open VisualObjects solution
  • join a SF party cluster
  • modify PublishProfiles/Cloud.xml to publish to the party endpoint
  • publish

Errors

image

1>------ Build started: Project: VisualObjects.ActorService, Configuration: Debug x64 ------
2>------ Build started: Project: VisualObjects.WebService, Configuration: Debug x64 ------
1>  VisualObjects.ActorService -> c:\git\oss\service-fabric-dotnet-getting-started\Actors\VisualObjects\VisualObjects.ActorService\bin\Debug\VisualObjects.ActorService.exe
2>  VisualObjects.WebService -> c:\git\oss\service-fabric-dotnet-getting-started\Actors\VisualObjects\VisualObjects.WebService\bin\Debug\VisualObjects.WebService.exe
3>------ Build started: Project: VisualObjectsApplication, Configuration: Debug x64 ------
4>------ Publish started: Project: VisualObjectsApplication, Configuration: Debug x64 ------
-------- Package started: Project: VisualObjectsApplication, Configuration: Debug x64 ------
-------- Package: Project: VisualObjectsApplication succeeded, Time elapsed: 00:00:01.6975286 --------
4>Started executing script 'Deploy-FabricApplication.ps1'.
4>. 'c:\git\oss\service-fabric-dotnet-getting-started\Actors\VisualObjects\VisualObjectsApplication\Scripts\Deploy-FabricApplication.ps1' -ApplicationPackagePath 'c:\git\oss\service-fabric-dotnet-getting-started\Actors\VisualObjects\VisualObjectsApplication\pkg\Debug' -PublishProfileFile 'c:\git\oss\service-fabric-dotnet-getting-started\Actors\VisualObjects\VisualObjectsApplication\PublishProfiles\Cloud.xml' -DeployOnly:$false -UnregisterUnusedApplicationVersionsAfterUpgrade $false -ForceUpgrade $false -OverwriteBehavior 'SameAppTypeAndVersion' -ErrorAction Stop
4>Copying application to image store...
4>Copy application package succeeded
4>Registering application type...
4>Register application type succeeded
4>Removing application package from image store...
4>Remove application package succeeded
4>Creating application...
4>Create application succeeded.
4>Finished executing script 'Deploy-FabricApplication.ps1'.
4>Time elapsed: 00:00:41.9914302
4>Started executing script 'Get-ServiceFabricApplicationStatus'.
4>[void](Connect-ServiceFabricCluster -ConnectionEndpoint:'party31564.westus.cloudapp.azure.com:19000'); Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1'; Get-ServiceFabricApplicationStatus -ApplicationName 'fabric:/VisualObjectsApplication' -ErrorAction Stop
4>The application has started.
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Service Status:
4>fabric:/VisualObjectsApplication/VisualObjects.ActorService is not ready, 9 partitions remaining.
4>fabric:/VisualObjectsApplication/VisualObjects.WebService is ready.
4>
4>Something is taking too long, the application is still not ready.
4>Finished executing script 'Get-ServiceFabricApplicationStatus'.
4>Time elapsed: 00:01:57.9909897
========== Build: 3 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========

No corresponding tools

It seems the .sfproj projects in latest samples is updated to version 1.1 and I have VS 2015 Update3 and when I try to open the project in VS, it complains that the Service fabric (SF) tools I have is versioned 1.0,

I tried to manually fix it in a couple of ways:

  • First I searched for the SF tools for VS 2015 Update 3 and I did not find any.
  • Then I thought I will manually edit the sfpoj file and use 1.0 version (hoping it works around stuff for me) but surprisingly I could not find the package "Microsoft.VisualStudio.Azure.Fabric.MSBuild" version 1.0.0 on nuget.org and it seems that sfproj build expects the package version to match with the tools version.

This seems a bit broken.

Exception handling issues

re WordCount.WebService.HttpExceptionHandler - Which version of which HttpClient are you using, that gives you HttpWebResponses and throws WebExceptions?

For example with a request of mine returning a 404 -

HttpClient.PostAsync returns me a Task<HttpResponseMessage> and nothing is thrown.
I can access the Result, still nothing is thrown.
I have to call EnsureSuccessStatusCode() on the result if I want something thrown, and this only ever throws HttpRequestException, which is not what your HttpExceptionHandler is looking for.

No mention of LBRule as prereq for deploying to Azure SF

In https://github.com/Azure-Samples/service-fabric-dotnet-getting-started#voicemailbox

The application includes a web UI accessible at http://:8081/voicemailbox/ and a set of web APIs that can be used to interact with the actor methods.

It isn't immediately obvious that i have to go and manually create a load balancing rule first (for port 8081/TCP) if i want this deployed in Azure Service Fabric - see this other related Issue here MicrosoftDocs/azure-docs#5763

Please add a paragraph stating this is a prerequisite for all sample applications that require a LBRule.

Project references in Chatter service

@seanmck I notice that the Chat.Domain is a class library for the purpose of sharing the service interfaces between each of the services and the web api. However, I'm wondering why those interfaces/models were defined in the web api project and then linked into the Chat.Domain project?

Why not just reference the class library in the web api in the same way that the Chat.Service references it?

As an aside, this workflow actually fixes an issue that I'm running into. By referencing the class library from all projects the solution builds, but when publishing to the SF cluster I get a build error because the asp.net core web api isn't building the dependent class library. It just seems dirty to have to define the service definitions in the web api and link the code files to the class library. Thoughts?

The project does not have a package action set

I've down loaded and successfully built the VisualObject sample solutions and I have a local cluster setup and running. However running or publishing the application outputs the following deployment error

The project does not have a package action set

1>------ Build started: Project: VisualObjects.ActorService, Configuration: Debug x64 ------ 2>------ Build started: Project: VisualObjects.WebService, Configuration: Debug x64 ------ 2> VisualObjects.WebService -> C:\@projects\Research\service-fabric-dotnet-getting-started-master\Actors\VisualObjects\VisualObjects.WebService\bin\x64\Debug\VisualObjects.WebService.exe 1> VisualObjects.ActorService -> C:\@projects\Research\service-fabric-dotnet-getting-started-master\Actors\VisualObjects\VisualObjects.ActorService\bin\x64\Debug\VisualObjects.ActorService.exe 3>------ Build started: Project: VisualObjects, Configuration: Debug x64 ------ 4>------ Publish started: Project: VisualObjects, Configuration: Debug x64 ------ -------- Package started: Project: VisualObjects, Configuration: Debug x64 ------ 4>The project does not have a package action set. ========== Build: 3 succeeded, 0 failed, 1 up-to-date, 0 skipped ========== ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

I cant find anything online to suggest what this might be?

Sample doesn't build from MSBuild

Repro:

E:\service-fabric-dotnet-getting-started\src\GettingStartedApplication\GettingStartedApplication> msbuild /t:Package

Error:

"E:\service-fabric-dotnet-getting-started\src\GettingStartedApplication\GettingStartedApplication\GettingStartedApplication.sfproj" (Package target) (1) ->
"E:\service-fabric-dotnet-getting-started\src\GettingStartedApplication\ActorBackendService\ActorBackendService.csproj" (default target) (2:2) ->
"E:\service-fabric-dotnet-getting-started\src\GettingStartedApplication\ActorBackendService.Interfaces\ActorBackendService.Interfaces.csproj" (default target) (6:2) ->
(_CheckForInvalidConfigurationAndPlatform target) ->
  C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(780,5): error : The OutputPath property is not set for project 'ActorBacke
ndService.Interfaces.csproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Debug'  Platform='AnyCPU'.  You ma
y be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [E:\service
-fabric-dotnet-getting-started\src\GettingStartedApplication\ActorBackendService.Interfaces\ActorBackendService.Interfaces.csproj]


"E:\service-fabric-dotnet-getting-started\src\GettingStartedApplication\GettingStartedApplication\GettingStartedApplication.sfproj" (Package target) (1) ->
"E:\service-fabric-dotnet-getting-started\src\GettingStartedApplication\StatelessBackendService\StatelessBackendService.csproj" (default target) (4:2) ->
"E:\service-fabric-dotnet-getting-started\src\GettingStartedApplication\StatelessBackendService.Interfaces\StatelessBackendService.Interfaces.csproj" (default target) (7:2) ->
  C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(780,5): error : The OutputPath property is not set for project 'StatelessB
ackendService.Interfaces.csproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Debug'  Platform='AnyCPU'.  Yo
u may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [E:\ser
vice-fabric-dotnet-getting-started\src\GettingStartedApplication\StatelessBackendService.Interfaces\StatelessBackendService.Interfaces.csproj]

    0 Warning(s)
    2 Error(s)

Time Elapsed 00:00:02.23

Looking at those projects, they only define OutputPath for Platform x64, but AnyCPU is the Platform being used.

sfproj issue

If i move any of the sfproj projects to a subdirectory it creates an Output path error this makes it hard transitioning the samples ( eg remove the sfproj , create a sub dir , move it in and re add to solution ) .,

FileLoadException in WordCountService Pckg Code

Running the sample out of box, but having to update the JSON stuff, I get this:
An exception of type 'System.IO.FileLoadException' occurred in WordCount.Common.dll but was not handled in user code
The fusion log:
=== Pre-bind state information ===
LOG: DisplayName = Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
(Fully-specified)
LOG: Appbase = file:///C:/SfDevCluster/Data/_App/_Node_1/WordCount_App6/WordCountServicePkg.Code.1.0.0/
LOG: Initial PrivatePath = NULL

Calling assembly : System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.

LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\SfDevCluster\Data_App_Node_1\WordCount_App6\WordCountServicePkg.Code.1.0.0\WordCount.Service.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 6.0.0.0 redirected to 9.0.1.19813.
LOG: Post-policy reference: Newtonsoft.Json, Version=9.0.1.19813, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
LOG: Attempting download of new URL file:///C:/SfDevCluster/Data/_App/_Node_1/WordCount_App6/WordCountServicePkg.Code.1.0.0/Newtonsoft.Json.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

I've tried serveral changes in the config files, but to no avail. I haven't been able to understand how things should work, since the sample won't run,.

Any help appreciated.
-e

I don't get it

I can run the the project successfully and also published to Local service fabric cluster. But I don't know how to use them. EG. How to call one of api that hosted at service fabric.

mat4 is not defined

I'm trying to run visualobjects and am getting mat4 is not defined on line 100 of visualobjects.js. Any ideas?

Black page with a green border

I'm able to build, deploy, debug and start the project (just downloaded).
But unfortunately, I only see a black page with a green border.
No triangle at all.

image

hash codes are asking for trouble

These Partition keys create hot partitions as some letters are much more common and the moment you use a non A to Z value the same code will break.

Dependencies & changes needed to make the project work

When I cloned the project initially, it didn't work. I had to install Microsoft.NET.Sdk.Razor to make it work. Without this it errors with the output -
Assembly location for Razor SDK Tasks was not specified. The most likely cause is an older incompatible version of Microsoft.NET.Sdk.Razor, or Microsoft.NET.Sdk.Web used by this project. Please target a newer version of the .NET Core SDK.

Additionally, after installing the above package, config change is needed in WebService.csproj to add false in the property group.

VS Target Framework is wrong

If you right click on Properties on VotingWeb, the Target framework says .Net Framework 4.5.2 and not dot net core? Is this just an issue in VS 2017 or can this not run on dot net core?

I'm sure i'm doing this wrong but could you have a look?

Just deployed VisualObjects to Service Fabric on Azure, opened 8081/TCP in the Load Balancer and i'm getting 503 Service Unavailable when i hit the URL with a browser:

http://servicefabricname.region.cloudapp.azure.com:8081/

The ServiceManifest does say 8081/TCP for the Web listener.
What am i doing wrong? Works just fine in the local emulator.

Chatter is missing global.json file

I am using this project to do a POC for VSTS deployments.

As the global.json file is missing there is no indication of which dnx version is required to be installed.

How to download Service Fabric certificate?

I'm working on Azure Service Fabric , It is already created and in Security tab I can able to see Primary certificate and Thumbprint as well.

I want to know How can I download this certificate and import it into my local machine.

As Cloud explorer giving me error:

Cloud Explorer could not connect to cluster 'Testcluster': Unable to find a matching client certificate. Make sure you have the certificate installed on this machine.

[Info requested] What is the purpose of CancellationToken in reliable actors

Hi,

In the sample app's Actor sample, you can find this line:
public async Task StartProcessingAsync(CancellationToken cancellationToken)

The token is never used in the method though.

Also, upon creating the actor's proxy, I notice the parameter passed is CancellationToke.None.

Can you please comment on the purpose of cancellation tokens in the context of Reliable Actors?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.