發表文章

目前顯示的是 3月, 2018的文章

Next steps on Azure

First, change the MQ to service bus. https://stackoverflow.com/questions/46775895/handling-azure-service-bus-queue-messages-with-azure-function https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus#trigger-sample With above I can stop continuous polling the queue. https://docs.microsoft.com/en-us/azure/service-bus-messaging/duplicate-detection With above to enable duplicate detection settings. Second, modify the SignalR...but I think I have to discuss with senpai first. https://docs.microsoft.com/en-us/aspnet/signalr/overview/deployment/using-signalr-with-azure-web-sites Third, log analytics on Azure. 

log4net for azure storage and smtp

https://www.nuget.org/packages/log4net.Appender.Azure https://github.com/stemarie/log4net.Azure The SmtpAppenderSection in  https://logging.apache.org/log4net/release/config-examples.html First problem, I have to add this assembly binding redirection manually. <dependentAssembly>     <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />     <bindingRedirect oldVersion="0.0.0.0-2.0.8.0" newVersion="2.0.8.0" /> </dependentAssembly> Second, originally I could get the log or mail. After some studied about these two log appenders, I found they all inherited the BufferingAppenderSkeleton. Logs will be stored in buffer unless it's full. Because I want to receive the mail as soon as possible, I add this section to SmtpAppender: <BufferSize = 0 />

Concurrent triggered job on Azure

https://github.com/Azure/azure-webjobs-sdk/wiki 應該早點看到這篇 SDK 的...先前只看了 關於 background jobs 的這份文件 ,沒有注意到 app service scale-out 與 concurrent 之間的關係。 當 app service plan 的 available instance count 足夠時,triggered job 可以 concurrent 的方式執行 multiple instances,反之則只能執行 single instance,其它同時呼叫的 request 會回傳 HTTP status code 409 (conflict)。 先前進行 POC 時,環境由自己設定,scale-out 什麼的都有啟用,所以沒遇到問題。現在要部署到正式環境,環境由 MIS 進行設定,他們沒啟用 scale-out,導致我需要 concurrent 執行的 triggered job 有一大堆失敗。 I should read this SDK first...but I only read this doc about background jobs before I designed my WebJobs. I have not noticed the relation between app service scale-out and concurrent. When we have available instance count in app service plan, triggered job could be executed multiple instances concurrently. On the contrary, it could be executed single instance, and other requests at the same time will get HTTP status code 409 (conflict). The environment was setting by myself when POC previously. I had not encountered problem be...