无法将 Twilio 短信与 azure 功能绑定,

问题描述

无法成功将 twilio 短信与 azure 函数绑定,出现错误提示无法识别 twilio..

如果有人知道这里需要做什么,请发布带有工作代码解决方案,否则 请让我知道如何在触发时在 azure 函数显示弹出消息。

使用系统; 使用 Twilio;

public static void Run(TimerInfo myTimer,TraceWriter log) { log.Info($"C# 定时器触发函数执行时间:{DateTime.Now}");

string accountSid = "SID";
string authToken = "token";

var client = new TwilioRestClient(accountSid,authToken);

    client.SendMessage(
        "+from",// Insert your Twilio from SMS number here
        "+to",// Insert your verified (trial) to SMS number here
        "hello from Azure Functions!" + DateTime.Now            
    );

}

解决方法

这是 Twilio 网站本身:https://www.twilio.com/blog/send-rain-notifications-from-azure-functions