问题
I deployed my console net core app to azure. How can i write something to my published console app bcause my console app takes some values from user and prints out, i cannot find link to this deployed application and then how to give access to end user to that console app?
回答1:
Per my understanding, you published a .net core console app as Azure Webjobs, and you are looking for a webhook so that you can let your users access this console app. You also need to know how to pass params to it via webhook.
I did a simple .net core console demo for you:
using System;
namespace coreconsoleparam
{
class Program
{
static void Main(string[] args)
{
if (args.Length > 0)
{
Console.WriteLine("agrs received :");
foreach (string arg in args) {
Console.WriteLine(arg+ " ");
}
}
else {
Console.WriteLine("received no args");
}
}
}
}
And I have published to Azure Webjobs of my web app. You can find its webhook here :
You can call your console app by POST method with username and password by Http Basic Auth, just as below :
As you can see, in this request URL, there is a param named arguments
, you can use it to pass params to your console app.
You will get a "202 Accepted" response if you called your app successfully.
Finally, let's check its log :
As you can see, the app has been executed successfully and all params has been received .
Hope it helps.
来源:https://stackoverflow.com/questions/59438184/type-into-console-core-azure-app-and-give-access-to-that-app-to-end-users