Type into console core azure app and give access to that app to end users

旧巷老猫 提交于 2020-02-05 04:06:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!