Singh
Singh

Reputation: 554

WCF in webjob returns list of records to webapp

Is this possible to put WCF in webjob that will return list of records to webapp.Actually I have project that returns search results (searching is done via lucene.net). Is there any guide or way to get results in my webapp from webjob?

Also can anyone guide me on my localhost I am running my webapp and web job is part of same solution. When I run web application, main function of WebJob is not hitting. Web app and web job can run simultaneously? If these are not runs simultaneously then How can I invoke my searching project initially ? How can my web project relate with my web jobs? I know about invoking by queue but some functions should be run initially when web application is started.

I want to test this behavior on my localhost

Upvotes: 0

Views: 251

Answers (1)

Bruce Chen
Bruce Chen

Reputation: 18465

Is this possible to put WCF in webjob that will return list of records to webapp.Actually I have project that returns search results (searching is done via lucene.net). Is there any guide or way to get results in my webapp from webjob?

As I known, Azure WebJobs provide you with an easy way to run scripts or programs as background process in the context of your Azure Web Apps. You could not get results directly from WebJobs in your Web Application, you need to store your results in a central data center (Azure Queue, Table Storage,Service Bus,etc.), then you need to retrieve the data explicitly in your Web App. Here is a official tutorial about web application working with Azure WebJob.

Also can anyone guide me on my localhost I am running my webapp and web job is part of same solution. When I run web application, main function of WebJob is not hitting. Web app and web job can run simultaneously?

You could right click your solution and select Properties, choose Startup Project under Common Properties, choose Multiple startup projects and configure the Action for your web application and your WebJob. For more details, you could refer to this issue.

UPDATE:

enter image description here

enter image description here

Upvotes: 1

Related Questions