- Azure Serverless Computing Cookbook
- Praveen Kumar Sreeram
- 266字
- 2021-07-02 20:23:09
How to do it...
- Navigate to the Integrate tab of the RegisterUser function, click on New Output , and choose Azure Blob Storage.
- Provide the required parameters in the Azure Blob Storage output (outputBlob) section, as shown in the following screenshot. Note the .log extension in the Path field:

- Navigate to the code editor of the run.csx file and make the following change:
- Add a new parameter outputBlob of type TextWriter to the Run method.
- Add a new string variable named emailContent. This variable is used to frame the content of the email. We will also use the same variable to create the log file content that is finally stored in the blob.
- Frame the email content by appending the required static text and the input parameters received in Request body:
public static void Run(HttpRequestMessage req,
TraceWriter log,
CloudTable objUserProfileTable,
out string objUserProfileQueueItem,
out Mail message,
TextWriter outputBlob
)
....
....
string email = inputJson.email;
string profilePicUrl = inputJson.ProfilePicUrl;
string emailContent ;
....
....
emailContent = "Thank you <b>" + firstname + " " +
lastname +"</b> for your registration.<br><br>" +
"Below are the details that you have provided us<br>
<br>"+ "<b>First name:</b> " + firstname + "<br>" +
"<b>Last name:</b> " + lastname + "<br>" +
"<b>Email Address:</b> " + email + "<br>" +
"<b>Profile Url:</b> " + profilePicUrl + "<br><br>
<br>" + "Best Regards," + "<br>" + "Website Team";
message.AddContent(new
Content("text/html",emailContent));
....
....
outputBlob.WriteLine(emailContent);
- Run a test using the same request payload that we have used in the previous recipe.
- After running the test, the log file got created in the container named userregistrationemaillog:

推薦閱讀
- Embedded Linux Projects Using Yocto Project Cookbook
- Advanced Splunk
- FreeSWITCH 1.8
- Linux核心技術從小白到大牛
- C語言程序設計基礎與實驗指導
- Three.js開發(fā)指南:基于WebGL和HTML5在網(wǎng)頁上渲染3D圖形和動畫(原書第3版)
- MATLAB 2020 從入門到精通
- 軟件項目管理實用教程
- 用Python實現(xiàn)深度學習框架
- MongoDB權威指南(第3版)
- concrete5 Cookbook
- Gradle for Android
- Scala編程實戰(zhàn)(原書第2版)
- Kotlin編程實戰(zhàn):創(chuàng)建優(yōu)雅、富于表現(xiàn)力和高性能的JVM與Android應用程序
- 蘋果的產(chǎn)品設計之道:創(chuàng)建優(yōu)秀產(chǎn)品、服務和用戶體驗的七個原則