1

Below is my C# code in Visual Studio 2017:

[FunctionName("MyFunction")]
public static void Run([ServiceBusTrigger("myqueue", Connection = "ServiceBus")]string myQueueItem, ILogger log)
{
    log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
}

After getting comments from friends below, found that Azure Function v2 only support 1 language. Then I changed to use Visual Studio Code instead of Visual Studio 2017 (without using C# code)

DaiKeung
  • 1,077
  • 1
  • 19
  • 38
  • what is the question here? – Sajeetharan Nov 06 '19 at 04:25
  • I would like to call NodeJS code (should need to have package.json?) in this function but don’t how to include it – DaiKeung Nov 06 '19 at 04:27
  • I'm not sure what you want. As I understand of it, you want to call Node.js code in your Azure Function, is that right? – Cindy Pau Nov 06 '19 at 05:53
  • Yes, I have nodejs.js, package.json and package-lock.json already. But don't know how to run it. I read @Sajeetharan link but I am still confused how to start. – DaiKeung Nov 06 '19 at 05:57
  • Since last June, Function v2 has only supported one language in per app. – Cindy Pau Nov 06 '19 at 06:05
  • Have a look of the announcements: https://github.com/Azure/app-service-announcements/issues/129 – Cindy Pau Nov 06 '19 at 06:05
  • @DaiKeung, so you want to include nodejs function in a c# function or want to use VS run nodejs function, or just don't know how to run nodejs function local. – George Chen Nov 06 '19 at 06:08
  • Hi GeorgeChen, I know how to run locally. I would like to use Azure Functions(Linux) as I want to have scaling of my NodeJS code which should be triggered by queueTrigger from ServiceBus. But @BowmanZhu just mentioned I can only use 1 language form Function v2. – DaiKeung Nov 06 '19 at 06:13
  • So why not just use the nodejs servicebus trigger function? – George Chen Nov 06 '19 at 06:16
  • I have a file call puppeteer.js which is hardcode using 3001 port and using azure-sb for queueTrigger(`serviceBusService.receiveQueueMessage()`). I could run it locally without problem. However, I don't know how to put to Azure Functions (Linux) and would like to support scaling (as I would like to run 3 threads) . – DaiKeung Nov 06 '19 at 06:44
  • Hi, @DaiKeung Please add the details of your question(edit the text of your question), maybe someone will know how to achieve. Of course, as far as I know, it is not possible. Edit your question so that it can be easily read by people in the community. good luck :-) – Cindy Pau Nov 06 '19 at 07:21
  • If your now problem is don't know how to put nodejs function to Linux Function, create the azure function(linux), then use the [azure function core tool](https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local#publish) to publish it. – George Chen Nov 06 '19 at 08:28

1 Answers1

2

Now, you need to use Single language in one Function app.

Previously a function app could have more than one language functions. But now in Function v2 we are forced to use a single language.

See app-service-announcements

Cindy Pau
  • 13,085
  • 1
  • 15
  • 27