public static Task <HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
        {
            Log(log, $"C# HTTP trigger function processed a request! RequestUri={req.RequestUri}");
            var func = new ValidateCredentialTokenHandler(req);

            func.FunctionNotify += (sender, args) => Log(log, args.Message);

            var ValidateCredentialTokenFunctionArgs = new ValidateCredentialTokenFunctionArgs()
            {
                StorageAccount    = ConfigurationManager.AppSettings["ConfigurationStorageAccount"],
                StorageAccountKey = ConfigurationManager.AppSettings["ConfigurationStorageAccountKey"]
            };

            return(Task.FromResult(func.Execute(ValidateCredentialTokenFunctionArgs)));
        }
Exemplo n.º 2
0
        public static async Task <HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = "ValidateCredentialToken")] HttpRequestMessage req, TraceWriter log)
        {
            Log(log, $"C# HTTP trigger function processed a request! RequestUri={req.RequestUri}");
            var func = new ValidateCredentialTokenHandler(req);

            func.FunctionNotify += (sender, args) => Log(log, args.Message);

            var validateCredentialTokenFunctionArgs = new ValidateCredentialTokenFunctionArgs
            {
                StorageAccount    = ConfigurationManager.AppSettings["ConfigurationStorageAccount"],
                StorageAccountKey = ConfigurationManager.AppSettings["ConfigurationStorageAccountKey"]
            };

            return(await Task.Run(() => func.Execute(validateCredentialTokenFunctionArgs)));
        }