0

I have created a very simple publisher and subscriber solution using this tutorial. I want to host the subscriber into azure as continuously executing webjob which consumes all the event sent out to particular topic.

Subscriber is a simple dotnet core application which runs fine on local development machine.

I have wrapped all the content of 'Debug' ( or 'Release') folder into zip file which contains a batfile name taskRunner.bat as an entrypoint for webjob to begin execution. Below are content of the taskRunner.bat

dotnet SBClient.dll 

SBClient.dll is an assembly which contains logic to fetch messages out of topic. When I run this batchfile on my machine things are are fine. But the moment I deploy this as a webjob in my azure webjobs I get to see below errors and status of WebJob remains PendingRestart

[01/11/2018 03:51:51 > f07a91: INFO] D:\local\Temp\jobs\continuous\coretask\kigmen2q.zmj>dotnet SBClient.dll 
[01/11/2018 03:51:51 > f07a91: ERR ] Error:
[01/11/2018 03:51:51 > f07a91: ERR ]   An assembly specified in the application dependencies manifest (SBClient.deps.json) was not found:
[01/11/2018 03:51:51 > f07a91: ERR ]     package: 'Microsoft.Azure.Amqp', version: '2.1.2'
[01/11/2018 03:51:51 > f07a91: ERR ]     path: 'lib/netstandard1.3/Microsoft.Azure.Amqp.dll'
[01/11/2018 03:51:51 > f07a91: ERR ] 
[01/11/2018 03:51:51 > f07a91: SYS ERR ] Job failed due to exit code -2147450740
[01/11/2018 03:51:51 > f07a91: SYS INFO] Process went down, waiting for 60 seconds
[01/11/2018 03:51:51 > f07a91: SYS INFO] Status changed to PendingRestart

Looking at the message I can tell that its looking for a file named 'Microsoft.Azure.Amqp' but don't know how its working on my machine.

Dose that mean I don't have latest version of dotnet core on Azure? Is there any setting that I need to configure to make it work?

user2243747
  • 2,767
  • 6
  • 41
  • 61

1 Answers1

0

Based on the error, you're missing Microsoft.Azurem.Amqp.dll assembly which is a dependency for Microsoft.Azure.ServiceBus assembly. Does your zip file contains all the required dependency assemblies including AMQP assembly?

Sean Feldman
  • 23,443
  • 7
  • 55
  • 80
  • you are right, my zip file don't have this file but on my local machine since dotnet core framework is installed it is picking from GAC ( I guess ) . And that's what my question is. don't we have dot net core framework install on the virtual machine where we deploy our webjobs? I check webapp->Application Setting and it says version of webapp is v4.7 I can't change it to .net core 2 ( on azure portal ) – user2243747 Jan 11 '18 at 04:58
  • WebJobs are hosted under Azure App Service which has support for a full .NET framework. You should be able to run your WebJob using full framework w/o a problem (the ASB client can run under both). As for how to run a webjob with .NET Core, there are quite a few resources, including [similar questions on StackOverlfow](https://stackoverflow.com/questions/43268344/azure-webjob-in-net-core) and [blog posts](https://blogs.msdn.microsoft.com/benjaminperkins/2017/03/07/how-to-deploy-a-net-core-console-application-to-azure-webjob/). – Sean Feldman Jan 11 '18 at 05:29