Moonglade.Email, is an Azure Function that originally relied on SMTP for sending emails. Microsoft implemented a change that prevents connections to both personal and enterprise Office 365 Outlook mailboxes. To ensure the email service continues functioning, I decided to integrate Azure Communication Services. In this blog post, I will explain how I implemented support for Azure Communication Services in the Moonglade.Email Azure Function.
Azure Function Isolated worker for .NET replaced its default Json Serializer from Newtonsoft.Json with System.Text.Json. This change caused certain behavior differences. In my case, I am not able to deserialize an Enum type from a string value. Let's see how to use JsonStringEnumConverter to fix it! …
When creating an Azure function from Azure portal. The function name seems to be fixed once you created it. There's no way from portal UI to change the function name. To rename a function, you could copy its code first, then delete and recreate it. But this is not the only way. Let's see how we can rename a function easily without deleting and recreating it. …
I have Azure VMs that require being accessed only from 3 IP addresses. Two of these IPs are static, the other is dynamic. Every time the dynamic IP changes, I must manually go to Azure portal and update NSG rules. Because this happens every few days, it makes me work 996. To solve this issue, I created Azure Function to automatically update the NSG rule with a simple HTTP request. …
My blog system "Moonglade" needs to send email notifications to blog owner when there are events like new comments, new pingbacks, and send email to readers when their comments are replied. I've been building my own infrastructure in the last few years. I will share the journey of how this email infrastructure evolved and the things I learnt. …
We typically use Azure Function to create APIs or scheduled jobs. For REST APIs that return JSON as response, it's extremely easy, but sometimes, we need another format besides JSON, like a file. Recently I have been working on a project that needs to generate Excel reports from Azure Function. I am using .NET 6.0, C# with Azure Function V4. Let's see how to do it. …
When creating Azure Function with Timer trigger, we usually write CRON expression in our function code. But when you need to dynamically adjust your timer based on business needs, you will have to update your code and redeploy the function. Let's see how we can remove the hard code CRON expression and put it into configuration that we can easily update on the Azure Portal without redeploy the code …
Some time ago, I successfully migrated an ASP.NET Core Web API project to the latest Azure Function V3, thereby taking advantage of the serverless features of the Azure platform to reduce operation and maintenance costs by 10 times. This article will introduce the key steps and practices in the migration process to help you migrate similar Web API projects.
Project background
This Web API …
VMs on the Microsoft Azure platform can be configured to automatically shut down by schedule. However, currently only VMs in the DevTest Lab service can be powered on automatically. Regular VMs have not been updated with the auto start capability. But still, we can take advantage of Azure Function V3 and PowerShell Core to start the VM by timed schedule.
The Idea
I have wrote a post 6 year ago …
Azure Functions is an event-driven serverless compute platform that can also solve complex orchestration problems. Build and debug locally without additional setup, deploy and operate at scale in the cloud, and integrate services using triggers and bindings. For me, Function can help me quickly develop some simple APIs, and I just need to write business code instead of building fundamental code …