<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Eman Hassan on Medium]]></title>
        <description><![CDATA[Stories by Eman Hassan on Medium]]></description>
        <link>https://medium.com/@emhassan?source=rss-6a837e727d6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k--RFh026pgjxsecTOkVZA.jpeg</url>
            <title>Stories by Eman Hassan on Medium</title>
            <link>https://medium.com/@emhassan?source=rss-6a837e727d6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:51:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emhassan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Attachment summarization using .NET, OpenAI API Assistant and Twilio SendGrid]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://emhassan.medium.com/attachment-summarization-using-net-openai-api-assistant-and-twilio-sendgrid-6e5360af810e?source=rss-6a837e727d6------2"><img src="https://cdn-images-1.medium.com/max/2600/0*EU8_Eyn78to7AY43" width="5184"></a></p><p class="medium-feed-snippet">Processing files is essential in many business domains. One of the common needs is summarization of text, and Generative AI has made this&#x2026;</p><p class="medium-feed-link"><a href="https://emhassan.medium.com/attachment-summarization-using-net-openai-api-assistant-and-twilio-sendgrid-6e5360af810e?source=rss-6a837e727d6------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://emhassan.medium.com/attachment-summarization-using-net-openai-api-assistant-and-twilio-sendgrid-6e5360af810e?source=rss-6a837e727d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e5360af810e</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[ai-assistant]]></category>
            <category><![CDATA[twilio]]></category>
            <dc:creator><![CDATA[Eman Hassan]]></dc:creator>
            <pubDate>Wed, 16 Jul 2025 18:23:06 GMT</pubDate>
            <atom:updated>2025-07-16T18:23:06.633Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Sensitive PII Information Detection in Email Sends using Azure AI, .NET and Twilio SendGrid]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://emhassan.medium.com/sensitive-pii-information-detection-in-email-sends-using-azure-ai-net-and-twilio-sendgrid-06c861583782?source=rss-6a837e727d6------2"><img src="https://cdn-images-1.medium.com/max/2600/0*cAC7takHa_bqyQKm" width="6000"></a></p><p class="medium-feed-snippet">Accidentally sharing sensitive data in automated or manual emails can lead to data leaks. In this post, you&#x2019;ll learn how to implement PII&#x2026;</p><p class="medium-feed-link"><a href="https://emhassan.medium.com/sensitive-pii-information-detection-in-email-sends-using-azure-ai-net-and-twilio-sendgrid-06c861583782?source=rss-6a837e727d6------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://emhassan.medium.com/sensitive-pii-information-detection-in-email-sends-using-azure-ai-net-and-twilio-sendgrid-06c861583782?source=rss-6a837e727d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/06c861583782</guid>
            <category><![CDATA[email]]></category>
            <category><![CDATA[pii]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[twilio]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Eman Hassan]]></dc:creator>
            <pubDate>Fri, 07 Feb 2025 02:37:35 GMT</pubDate>
            <atom:updated>2025-02-07T02:37:35.154Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Monitoring Email Delivery/Open Rates in .NET Using Twilio SendGrid Webhooks]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://emhassan.medium.com/monitoring-email-delivery-open-rates-in-net-using-twilio-sendgrid-webhooks-bdbec6fe46ab?source=rss-6a837e727d6------2"><img src="https://cdn-images-1.medium.com/max/2600/0*keRe8OVeH7coBcCK" width="4500"></a></p><p class="medium-feed-snippet">Communication through emails is a priority for almost every business. The ability to send outgoing emails is important. But it is equally&#x2026;</p><p class="medium-feed-link"><a href="https://emhassan.medium.com/monitoring-email-delivery-open-rates-in-net-using-twilio-sendgrid-webhooks-bdbec6fe46ab?source=rss-6a837e727d6------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://emhassan.medium.com/monitoring-email-delivery-open-rates-in-net-using-twilio-sendgrid-webhooks-bdbec6fe46ab?source=rss-6a837e727d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdbec6fe46ab</guid>
            <category><![CDATA[webhooks]]></category>
            <category><![CDATA[email-marketing]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[twilio]]></category>
            <dc:creator><![CDATA[Eman Hassan]]></dc:creator>
            <pubDate>Tue, 14 Jan 2025 22:35:54 GMT</pubDate>
            <atom:updated>2025-01-14T22:35:54.212Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Azure SQL Managed Instance Learning Courses]]></title>
            <link>https://emhassan.medium.com/azure-sql-managed-instance-learning-courses-d28622735855?source=rss-6a837e727d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d28622735855</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-sql-database]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[sql-server]]></category>
            <dc:creator><![CDATA[Eman Hassan]]></dc:creator>
            <pubDate>Tue, 19 Nov 2024 08:19:26 GMT</pubDate>
            <atom:updated>2024-11-19T08:19:26.243Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*51zbZc5D3_BEhjvj" /><figcaption>Photo by <a href="https://unsplash.com/@bitu2104?utm_source=medium&amp;utm_medium=referral">Tuyen Vo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Azure SQL Managed Instance is a fully managed database service provided by Microsoft Azure, designed to bridge the gap between traditional on-premises SQL Server environments and cloud-native database solutions. It offers the flexibility, performance, and scalability of the SQL Server database engine, along with the benefits of a managed service, such as automated patching, backups, and maintenance.</p><h4>Recently I have published courses on <a href="https://pluralsight.pxf.io/PO0GMX">Pluralsight</a> designed to guide you through:</h4><ul><li><a href="https://pluralsight.pxf.io/GKjDrE">The Case of Azure SQL Managed Instance</a> course: Making informed decisions about whether Azure SQL Managed Instance is the best option for your specific use case.</li><li><a href="https://pluralsight.pxf.io/6ybZmK">Planning and provisioning Azure SQL Managed Instance </a>course, complete with hands-on demonstrations.</li></ul><h4>Key Features of Azure SQL Managed Instance:</h4><ul><li><strong>Compatibility</strong>: High compatibility with on-premises SQL Server, enabling easier lift-and-shift migrations.</li><li><strong>Managed Infrastructure</strong>: Removes the need to manage virtual machines or hardware, as Microsoft handles the underlying infrastructure.</li><li><strong>Advanced Security</strong>: Features like Always Encrypted, Transparent Data Encryption (TDE), and network isolation through Virtual Network (VNet) integration.</li><li><strong>Built-in High Availability</strong>: Provides 99.99% uptime SLA with automatic failover and redundancy.</li><li><strong>Scalability</strong>: Supports scaling of compute and storage independently to meet workload demands.</li><li><strong>Native Support for SQL Server Tools</strong>: Works seamlessly with tools like SQL Server Management Studio (SSMS), SQL Server Data Tools (SSDT), and others.</li></ul><h4>Ideal for scenarios</h4><ul><li>Migrating existing SQL Server workloads to the cloud with minimal changes.</li><li>Modernizing applications with advanced features like in-memory technologies, JSON, and graph data processing.</li><li>Reducing operational overhead through managed services while maintaining control over the database engine.</li></ul><h4>Conclusion</h4><p>Azure SQL Managed Instance bridges the gap between traditional SQL Server environments and the modern cloud, offering the flexibility, scalability, and reliability needed for today’s demanding applications. Whether you’re considering migrating your on-premises database or optimizing a cloud-native solution, understanding its features and use cases is key to making the right decision.</p><p>If you’re ready to dive deeper, check out my courses on <a href="https://pluralsight.pxf.io/mOgdYe">Pluralsight</a>, where I provide hands-on guidance to help you evaluate, plan, and deploy Azure SQL Managed Instance effectively. With the right knowledge, you can unlock the full potential of this powerful managed database service.</p><p>Feel free to share your thoughts or questions in the comments below — I’d love to hear how you’re leveraging Azure SQL Managed Instance for your projects!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d28622735855" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a File Manager App with .NET, Azure Blob Containers and Twilio SendGrid]]></title>
            <link>https://emhassan.medium.com/build-a-file-manager-app-with-net-azure-blob-containers-and-twilio-sendgrid-85feb119a897?source=rss-6a837e727d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/85feb119a897</guid>
            <category><![CDATA[azure-storage]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <category><![CDATA[twilio]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Eman Hassan]]></dc:creator>
            <pubDate>Thu, 17 Oct 2024 19:38:58 GMT</pubDate>
            <atom:updated>2024-11-19T07:22:47.468Z</atom:updated>
            <content:encoded><![CDATA[<h3>Build a File Manager App with .NET, Azure Blob Containers and Twilio SendGrid</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MeYKL0tqhNlYhI_s" /><figcaption>Photo by <a href="https://unsplash.com/@wahidkhene?utm_source=medium&amp;utm_medium=referral">Wahid Khene</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>File management is one of the most common use cases in most modern applications, so it is important to learn how you can build simple file management features. In this tutorial, you’ll learn how to create a web-based File Manager application using .NET. This application will integrate Azure Blob Storage for file handling, and Twilio SendGrid for email notifications. By the end, you’ll have a functional app that allows users to upload, list, download, and delete files, with email notifications sent upon specific actions.</p><h4>Prerequisites</h4><p>In order to be successful in this tutorial, you will need the following:</p><ul><li><a href="https://signup.sendgrid.com/">A free Twilio SendGrid account</a></li><li><a href="https://visualstudio.microsoft.com/vs/community/">Visual Studio free Community Edition</a> or <a href="https://code.visualstudio.com/">Visual Studio Code</a></li><li><a href="https://azure.microsoft.com/en-us/pricing/purchase-options/azure-account">Free Azure account</a></li></ul><h4>Building the pp</h4><p>You will create a .NET web application that uploads and downloads files from an Azure Blob Container and sends email notifications when a file action occurs.</p><h4>Setting up the application</h4><p>If you are using Visual Studio Code, open terminal and run the following command to create your new project:</p><pre>dotnet new mvc -n FileManager<br>cd FileManager</pre><p>If you are using Visual Studio, click <strong>Create a new project. </strong>Search for asp.net mvc then select <strong>ASP.NET Core Web App (Model-View-Controller)</strong> as shown below. Click <strong>Next.</strong></p><figure><img alt="Create ASP.NET MVC web app" src="https://cdn-images-1.medium.com/max/1024/0*8hnatTaS2YVOuLZk" /></figure><p>Enter the name “FileManager” for your project, then click <strong>Next. </strong>Select the latest .NET version. Keep the rest as defaults, then click <strong>Create.</strong></p><figure><img alt="Select .NET version" src="https://cdn-images-1.medium.com/max/1024/0*1KSAuTfX--1SzgWc" /></figure><h4>Creating an Azure Blob storage account</h4><p>Sign in to the <a href="https://portal.azure.com/">Azure portal</a>, and click on <strong>Create a resource</strong> as shown below.</p><figure><img alt="Create Azure Resource" src="https://cdn-images-1.medium.com/max/1024/0*tYPIMQQyELg23vVo" /></figure><p>Search for “Storage account.” Select Microsoft’s storage account as shown below.</p><figure><img alt="Microsoft storage account" src="https://cdn-images-1.medium.com/max/1024/0*hHmIJLE-4Dck73o3" /></figure><p>Enter a name for your resource group and storage account. The name for your new storage account must be globally unique, but you can choose any name that fits the naming requirements in Azure. Keep the rest as defaults. Click <strong>Review + Create</strong> at the bottom, then click <strong>Create. </strong>It may take a few minutes for your new resource to deploy.</p><h4>Create a blob container</h4><p>Once your storage account has deployed successfully, access the storage account and navigate to <strong>Data Storage &gt; Containers. </strong>Click the plus sign at the top as shown below to add a new blob container.</p><figure><img alt="Add container" src="https://cdn-images-1.medium.com/max/1024/0*pK1O_yMQMz75T70f" /></figure><p>Navigate to <strong>Security + Networking &gt; Access keys.</strong> Look for <strong>Key1</strong>, and copy the Connection string. You will need this for your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c9S3yjlEwC0uTZE6" /></figure><h4>Integrating Azure Blob Storage into the .NET App</h4><p>If you are using Visual Studio Code, run the following command in the terminal to install the Azure Blob Storage package.</p><pre>dotnet add package Azure.Storage.Blobs</pre><p>If you are using Visual Studio, go to the top menu. Click on <strong>Tools &gt; NuGet Package Manager &gt; Manage NuGet Packages for Solution </strong>as shown below.</p><figure><img alt="NuGet package manager" src="https://cdn-images-1.medium.com/max/1024/0*v-YdXMELgP-gWqCk" /></figure><p>Search for “Azure.Storage.Blobs” and install it to the project.by clicking <strong>Install. </strong>Small pop ups will show to apply dependencies and accept licenses. Click <strong>Apply, </strong>then <strong>Accept </strong>to install the package.</p><figure><img alt="Install Azure Storage Blob" src="https://cdn-images-1.medium.com/max/1024/0*ZZLv3x7JHFy51837" /></figure><p>Open the file appSettings.json and add the connection string for the blob storage you created in Azure. Replace the placeholder with your connection string you copied earlier.</p><pre>&quot;ConnectionStrings&quot;: {<br>  &quot;AzureBlobStorage&quot;: &quot;Your_Azure_Storage_Connection_String&quot;</pre><h4>Create a service to access your blob storage container</h4><p>In Visual Studio, right click the project then click <strong>Add &gt; New Folder. </strong>Add a folder named <em>Services. Ri</em>ght click the <em>Services </em>folder and click <strong>Add &gt; Class</strong>. Name your new class <em>BlobService.cs.</em></p><p>Add the following code to the BlobService class for handling upload, list, download and delete operations with the Azure Blob Storage. Be sure the value in _containerName matches the name you gave your blob container.</p><pre>using Azure.Storage.Blobs;<br>using Azure.Storage.Blobs.Models;<br><br>public class BlobService<br>{<br>    private readonly BlobServiceClient _blobServiceClient;<br>    private readonly string _containerName = &quot;filesblob&quot;;<br><br>    public BlobService(IConfiguration configuration)<br>    {<br>        _blobServiceClient = new BlobServiceClient(configuration.GetConnectionString(&quot;AzureBlobStorage&quot;));<br>    }<br><br>    public async Task UploadFileAsync(IFormFile file)<br>    {<br>        var containerClient = _blobServiceClient.GetBlobContainerClient(_containerName);<br>        var blobClient = containerClient.GetBlobClient(file.FileName);<br><br>        using (var stream = file.OpenReadStream())<br>        {<br>            await blobClient.UploadAsync(stream, new BlobHttpHeaders { ContentType = file.ContentType });<br>        }<br>    }<br><br>    public async Task&lt;List&lt;string&gt;&gt; ListFilesAsync()<br>    {<br>        var containerClient = _blobServiceClient.GetBlobContainerClient(_containerName);<br>        var items = new List&lt;string&gt;();<br><br>        await foreach (BlobItem blobItem in containerClient.GetBlobsAsync())<br>        {<br>            items.Add(blobItem.Name);<br>        }<br><br>        return items;<br>    }<br><br>    public async Task&lt;Stream&gt; DownloadFileAsync(string fileName)<br>    {<br>        var containerClient = _blobServiceClient.GetBlobContainerClient(_containerName);<br>        var blobClient = containerClient.GetBlobClient(fileName);<br>        var response = await blobClient.DownloadAsync();<br>        return response.Value.Content;<br>    }<br><br>    public async Task DeleteFileAsync(string fileName)<br>    {<br>        var containerClient = _blobServiceClient.GetBlobContainerClient(_containerName);<br>        var blobClient = containerClient.GetBlobClient(fileName);<br>        await blobClient.DeleteIfExistsAsync();<br>    }<br>}</pre><p>Register the BlobService in the Program.cs file by adding the following code under the first two lines of code in the file.</p><pre>builder.Services.AddSingleton&lt;BlobService&gt;();</pre><h4>Setting Up Twilio SendGrid</h4><p>There are a few more mandatory steps you’ll need to complete in your Twilio SendGrid’s account:</p><ol><li>Verifying your Email</li><li><a href="https://docs.sendgrid.com/ui/account-and-settings/two-factor-authentication?_gl=1*16gl37p*_ga*NjIyNjMzMTQxLjE2NTI4MDk5ODM.*_ga_RRP8K4M4F3*MTcwODAxMTE1My45MzUuMS4xNzA4MDExNjkyLjAuMC4w">Setting up 2-Factor Authentication</a></li><li><a href="https://docs.sendgrid.com/ui/account-and-settings/how-to-set-up-domain-authentication?_gl=1*mlky0h*_ga*NjIyNjMzMTQxLjE2NTI4MDk5ODM.*_ga_RRP8K4M4F3*MTcwODAxMTE1My45MzUuMS4xNzA4MDExNjkyLjAuMC4w">Verifying your Domain</a></li></ol><p>Once you’ve completed the above steps, you’ll need to <a href="https://app.sendgrid.com/settings/api_keys?_gl=1*1h02m08*_ga*NjIyNjMzMTQxLjE2NTI4MDk5ODM.*_ga_RRP8K4M4F3*MTcwODAxMTE1My45MzUuMS4xNzA4MDExODExLjAuMC4w">create a new API Key</a> with restricted access. On the Restricted Access tab, be sure your API Key is set to allow Email Sending access. Give your API’s key a name, and click <strong>Create + View.</strong> Keep this key somewhere safe as you will need it in the subsequent steps, and SendGrid will not show it again.</p><p>Add the API key, sender email and sender name in your <em>appSettings.json</em> file as shown below. and Replace the placeholders with your actual API key and verified sender information.</p><pre> &quot;SendGrid&quot;: {<br>   &quot;ApiKey&quot;: &quot;Your_SendGrid_API_Key&quot;,<br>   &quot;SenderEmail&quot;: &quot;your_verified_sender_email@example.com&quot;,<br>   &quot;SenderName&quot;: &quot;Your Name&quot;</pre><h4>Integrating Twilio SendGrid into the .NET App</h4><p>If you are using Visual Studio Code, run the following command in the terminal to install the SendGrid package.</p><pre>dotnet add package SendGrid</pre><p>If you are using Visual Studio, open the NuGet Package Manager and install “SendGrid.” Apply and accept dependencies and license when prompted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L-xgQH1F_P0llvxd" /></figure><p>In the <em>Services </em>folder, add a new class called <em>EmailService.cs. </em>Replace the code in this file with the following code.</p><pre>using SendGrid;<br>using SendGrid.Helpers.Mail;<br><br><br>public class EmailService<br>{<br>    private readonly string _apiKey;<br>    private readonly string _senderEmail;<br>    private readonly string _senderName;<br><br><br>    public EmailService(IConfiguration configuration)<br>    {<br>        _apiKey = configuration[&quot;SendGrid:ApiKey&quot;];<br>        _senderEmail = configuration[&quot;SendGrid:SenderEmail&quot;];<br>        _senderName = configuration[&quot;SendGrid:SenderName&quot;];<br>    }<br><br><br>    public async Task SendEmailAsync(string recipientEmail, string subject, string message)<br>    {<br>        var client = new SendGridClient(_apiKey);<br>        var from = new EmailAddress(_senderEmail, _senderName);<br>        var to = new EmailAddress(recipientEmail);<br>        var msg = MailHelper.CreateSingleEmail(from, to, subject, message, message);<br>        await client.SendEmailAsync(msg);<br>    }<br>}</pre><p>Register the EmailService by adding the following code to the Program.cs file under the top 3 lines of code.</p><pre>builder.Services.AddSingleton&lt;EmailService&gt;();</pre><h4>Building the File Manager UI</h4><p>Right click the <strong>Controller </strong>folder then click <strong>Add &gt; Controller &gt; MVC Controller — Empty. </strong>Give your new file the name <em>FilesController.cs. </em>Replace the code with the following code adding the index page action and the file operations actions. Replace recipient@example.com with the email address you want to send notifications to. You will have to do this for both the upload and delete tasks in the code.</p><pre>using Microsoft.AspNetCore.Mvc;<br><br>public class FilesController : Controller<br>{<br>    private readonly BlobService _blobService;<br>    private readonly EmailService _emailService;<br><br>    public FilesController(BlobService blobService, EmailService emailService)<br>    {<br>        _blobService = blobService;<br>        _emailService = emailService;<br>    }<br><br>    public async Task&lt;IActionResult&gt; Index()<br>    {<br>        var files = await _blobService.ListFilesAsync();<br>        return View(files);<br>    }<br><br>    [HttpPost]<br>    public async Task&lt;IActionResult&gt; Upload(IFormFile file)<br>    {<br>        if (file != null)<br>        {<br>            await _blobService.UploadFileAsync(file);<br><br>            // Send email notification<br>            await _emailService.SendEmailAsync(<br>                &quot;recipient@example.com&quot;,<br>                &quot;File Uploaded&quot;,<br>                $&quot;File {file.FileName} has been uploaded.&quot;);<br><br>            return RedirectToAction(&quot;Index&quot;);<br>        }<br>        return View(&quot;Index&quot;);<br>    }<br><br>    public async Task&lt;IActionResult&gt; Download(string fileName)<br>    {<br>        var stream = await _blobService.DownloadFileAsync(fileName);<br>        return File(stream, &quot;application/octet-stream&quot;, fileName);<br>    }<br><br>    public async Task&lt;IActionResult&gt; Delete(string fileName)<br>    {<br>        await _blobService.DeleteFileAsync(fileName);<br><br>        // Send email notification<br>        await _emailService.SendEmailAsync(<br>            &quot;recipient@example.com&quot;,<br>            &quot;File Deleted&quot;,<br>            $&quot;File {fileName} has been deleted.&quot;);<br><br>        return RedirectToAction(&quot;Index&quot;);<br>    }<br>}</pre><h4>Create UI Views</h4><p>In the <em>Views </em>folder, create a new folder named <em>Files. </em>Right click the <em>Files </em>folder, then click <strong>Add &gt; View &gt; Empty view. </strong>Name your file <em>Index.cshtml, </em>then replace the code with the following code:</p><pre>@model List&lt;string&gt;<br><br>&lt;h2&gt;File Manager&lt;/h2&gt;<br><br>&lt;form asp-action=&quot;Upload&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;<br>    &lt;input type=&quot;file&quot; name=&quot;file&quot; /&gt;<br>    &lt;button type=&quot;submit&quot;&gt;Upload&lt;/button&gt;<br>&lt;/form&gt;<br><br>&lt;table&gt;<br>    &lt;thead&gt;<br>        &lt;tr&gt;<br>            &lt;th&gt;File Name&lt;/th&gt;<br>            &lt;th&gt;Actions&lt;/th&gt;<br>        &lt;/tr&gt;<br>    &lt;/thead&gt;<br>    &lt;tbody&gt;<br>        @foreach (var fileName in Model)<br>        {<br>            &lt;tr&gt;<br>                &lt;td&gt;@fileName&lt;/td&gt;<br>                &lt;td&gt;<br>                    &lt;a asp-action=&quot;Download&quot; asp-route-fileName=&quot;@fileName&quot;&gt;Download&lt;/a&gt; |<br>                    &lt;a asp-action=&quot;Delete&quot; asp-route-fileName=&quot;@fileName&quot;&gt;Delete&lt;/a&gt;<br>                &lt;/td&gt;<br>            &lt;/tr&gt;<br>        }<br>    &lt;/tbody&gt;<br>&lt;/table&gt;</pre><p>In <em>Program.cs </em>find the app.MapControllerRoute code. Replace it with the following code to configure the default page to the file manager&#39;s page.</p><pre>app.MapControllerRoute(<br>    name: &quot;default&quot;,<br>    pattern: &quot;{controller=Files}/{action=Index}/{id?}&quot;);</pre><h4>Testing the C# application</h4><p>If you are using Visual Studio Code, run the following command in the terminal to run the application then navigate to the localhost specified in the run output.</p><pre>dotnet run</pre><p>If you are using Visual Studio, run the application by clicking on the green play button in the top of the Visual Studio window as shown below.</p><figure><img alt="Run the application" src="https://cdn-images-1.medium.com/max/1024/0*NdU44NFoj0ms-4UW" /></figure><p>Then browse the localhost port shown in the popup debug window. You will see a web interface that allows you to upload and download files from Azure.</p><figure><img alt="Debugging window" src="https://cdn-images-1.medium.com/max/690/0*psL93hiBSTPfh3eU" /></figure><p>Try uploading and downloading files, then check to see if you received an email.</p><figure><img alt="File manager UI" src="https://cdn-images-1.medium.com/max/896/0*v4enJOQr6cRCwsSS" /></figure><blockquote>Keep in mind that, when you publish this application, anyone browsing the app can see and access the uploaded files unless you implement security like authentication and user access profiles.</blockquote><p>Check the email specified in your code. The email you receive should look like the one shown below.</p><figure><img alt="File manager notification" src="https://cdn-images-1.medium.com/max/762/0*rRtZw0FT2yEXQgWK" /></figure><h4>Extending your C# SendGrid application</h4><p>You’ve successfully built a File Manager application using .NET, integrated with Azure Blob Storage for file handling and Twilio SendGrid for email notifications. This application serves as a solid foundation for more complex file management systems, and you can extend it by adding features like user authentication, file sharing, and more.</p><p>If you want to continue to build out this application, here are a few options to consider:</p><ul><li>Enhance Security: Implement authentication and authorization.</li><li>Add Logging: Use logging frameworks to track application behavior.</li><li>Improve UI: Enhance the user interface with Bootstrap or other CSS frameworks.</li><li>Handle Errors: Add proper error handling and validation.</li></ul><p>You can find the entire code for the finished application <a href="https://github.com/EmanH5/FileManager">here</a>.</p><p>Explore more .NET, Azure and Twilio stories</p><ul><li><a href="https://towardsdev.com/how-to-use-the-no-code-azure-developer-portal-to-showcase-your-apis-to-customers-1974023beabe">How to Use the No-Code Azure Developer Portal to Showcase Your APIs to Customers</a></li><li><a href="https://emhassan.medium.com/build-app-authentication-with-net-auth0-and-twilio-sendgrid-7285646059f6">Build App Authentication with .NET, Auth0 and Twilio SendGrid</a></li><li><a href="https://towardsdev.com/apply-rate-limits-on-azure-functions-apis-using-api-management-service-2a06da1e1484">Apply Rate Limits on Azure Functions APIs Using API Management Service</a></li></ul><p><em>Originally published at </em><a href="https://www.twilio.com/en-us/blog/file-manager-app-dot-net-azure-blob-twilio-sendgrid"><em>https://www.twilio.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85feb119a897" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Unlock up to $150k in Credits with Microsoft for Startups Founders Hub]]></title>
            <link>https://emhassan.medium.com/how-to-unlock-up-to-150k-in-credits-with-microsoft-for-startups-founders-hub-ea055436235d?source=rss-6a837e727d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea055436235d</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[startupş]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[accelerator]]></category>
            <category><![CDATA[founders]]></category>
            <dc:creator><![CDATA[Eman Hassan]]></dc:creator>
            <pubDate>Sat, 05 Oct 2024 07:33:54 GMT</pubDate>
            <atom:updated>2024-10-06T06:54:07.976Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*557Fd0AB8hBfuA7A" /><figcaption>Photo by <a href="https://unsplash.com/@jdiegoph?utm_source=medium&amp;utm_medium=referral">Diego PH</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The <strong>Microsoft for Startups Founders Hub</strong> has been a game-changer for my early stage businesses, <a href="https://regexmy.com/">RegexMy</a> which provides a set of AI tools for text and files processing including regexes, translation and summarization and also for <a href="https://advocatek.com/">Advocatek.com</a>, which is also a part of RegexMy focusing on consultation and developer advocacy services. Through this program, I’ve learned a lot and gained incredible opportunities to explore a wide array of Microsoft services. Additionally, the program offers benefits and deals from other vendors, which I’ll delve into throughout this post.</p><p>If you have an app or digital service idea with the potential to drive profit, you can leverage this excellent accelerator program by Microsoft! The application process is straightforward, and reviews typically take just a couple of business days.</p><p>In this post, you will learn:</p><ol><li><strong>How to ensure your idea aligns with Microsoft’s criteria.</strong></li><li><strong>What to expect once you’re accepted.</strong></li><li><strong>An exploration of the benefits unlocked at the Founders Hub.</strong></li></ol><h4>1. Ensuring Your Idea Aligns with Microsoft’s Criteria</h4><p>Before applying, it’s essential to make sure your startup meets the eligibility requirements:</p><ul><li><strong>Innovative Tech Solution</strong>: Your idea should present an innovative solution in the tech industry, addressing a clear market need.</li><li><strong>Early-Stage Startup</strong>: Typically, startups with less than $10 million in annual revenue are eligible.</li><li><strong>Not Solely a Service Provider</strong>: While consulting elements are acceptable, the core offering should be a scalable product or solution.</li><li><strong>No Prior Funding Required</strong>: You don’t need to have received prior funding to qualify.</li><li><strong>Legal Requirements</strong>: While not mandatory at the application stage, having a registered business entity may be necessary to access certain benefits.</li></ul><p>During the application process, you’ll be asked to choose the stage that best describes your startup’s current state.</p><ul><li><strong>Concept design </strong>— You’re at the very beginning of your startup journey. You’re refining your idea and validating your solution by talking to potential users and industry experts.</li><li><strong>Prototyping</strong> — You have already gone through some idea validation and are now beginning to build a wireframe or a prototype to continue user testing.</li><li><strong>Building MVP</strong> — You know your solution has value and you’re developing a minimally viable product (MVP). Your MVP should be more advanced than your prototype and have enough features planned to make it a functioning solution for potential customers.</li><li><strong>MVP in market</strong> — You have already launched your MVP. You’re focused on shipping features and still working on acquiring paying customers.</li><li><strong>Established market </strong>— You have a mature product in the market and have a base of paying customers. You’re ready to focus on scaling your company.</li></ul><p>In my experience, The key things I did to get accepted was:</p><ul><li>I created a simple demo video with a PPT presentation explaining my idea</li><li>I explained how I am already using Microsoft Azure in building my product</li></ul><figure><img alt="Microsoft’s timeline" src="https://cdn-images-1.medium.com/max/699/1*MArFOPhjdwyHnwQN1pwT1w.png" /><figcaption>Microsoft’s application timeline</figcaption></figure><h4>2. What to Expect When Accepted</h4><p>Once accepted into the Microsoft for Startups Founders Hub, you can look forward to:</p><p><strong>Azure Credits Up to $150,000</strong></p><ul><li><strong>Flexible Credit Tiers</strong>: Credits are allocated based on your startup’s stage and growth, ensuring you have the resources you need when you need them.</li><li><strong>Access to Over 200 Azure Services</strong>: Leverage cloud services ranging from AI and machine learning to analytics and DevOps.</li></ul><figure><img alt="Credit Tiers" src="https://cdn-images-1.medium.com/max/798/1*qavV4g3-Gevx2oaQOtMjEw.png" /><figcaption>Credit tiers</figcaption></figure><p><strong>Development Tools and Platforms</strong></p><ul><li><strong>GitHub Enterprise</strong>: Receive up to a year of free access to GitHub Enterprise, enhancing your development workflow.</li><li><strong>Microsoft 365 and Power Platform</strong>: Utilize productivity tools and business applications to streamline operations.</li><li><strong>Visual Studio Enterprise</strong>: Get access to a comprehensive suite of developer tools.</li></ul><p><strong>Technical and Business Support</strong></p><ul><li><strong>Technical Advisory Sessions</strong>: Connect with Microsoft experts for guidance on architecture, scalability, and best practices.</li><li><strong>Mentorship Opportunities</strong>: Gain insights from seasoned entrepreneurs and industry leaders.</li><li><strong>Go-To-Market Support</strong>: Benefit from resources that help you bring your product to market effectively.</li></ul><p><strong>Marketplace Exposure</strong></p><ul><li><strong>Microsoft Commercial Marketplace</strong>: List your solution to reach millions of customers globally.</li></ul><h4>3. Exploring the Unlocked Benefits at the Founders Hub</h4><p>Beyond Microsoft’s offerings, the Founders Hub provides additional perks:</p><p><strong>Partner Benefits</strong></p><ul><li><strong>Access to Services from Leading Vendors</strong>: Enjoy discounts and credits from partners like:</li><li><strong>OpenAI</strong>: Get credits to integrate advanced AI capabilities.</li><li><strong>LinkedIn</strong>: Utilize marketing solutions to expand your reach.</li><li><strong>Bubble</strong>: Accelerate development with no-code tools.</li></ul><p><strong>Learning and Development Resources</strong></p><ul><li><strong>Microsoft Learn</strong>: Access a wealth of training materials and certifications.</li><li><strong>Webinars and Workshops</strong>: Participate in events covering a range of topics from technical deep-dives to business strategy.</li></ul><p><strong>Community and Networking</strong></p><ul><li><strong>Connect with Other Founders</strong>: Engage with a community of like-minded entrepreneurs.</li><li><strong>Events and Meetups</strong>: Attend exclusive events to network and collaborate.</li></ul><h4>Important links</h4><ul><li><strong>Ready to get started?</strong> Visit the <a href="https://startups.microsoft.com/">Microsoft for Startups Founders Hub</a> website and apply.</li><li>Browse the benefits you get in each level <a href="https://partner.microsoft.com/en-us/partnership/founders-hub-benefits-guide">https://partner.microsoft.com/en-us/partnership/founders-hub-benefits-guide</a></li><li>More details about the levels <a href="https://startups.microsoft.com/blog/credit-levels/">https://startups.microsoft.com/blog/credit-levels/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea055436235d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use the No-Code Azure Developer Portal to Showcase Your APIs to Customers]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://towardsdev.com/how-to-use-the-no-code-azure-developer-portal-to-showcase-your-apis-to-customers-1974023beabe?source=rss-6a837e727d6------2"><img src="https://cdn-images-1.medium.com/max/2600/0*TrF3rMlScsSoUawG" width="5184"></a></p><p class="medium-feed-snippet">Handling API subscriptions and providing users with a portal to manage their accounts and access profiles is essential when offering APIs&#x2026;</p><p class="medium-feed-link"><a href="https://towardsdev.com/how-to-use-the-no-code-azure-developer-portal-to-showcase-your-apis-to-customers-1974023beabe?source=rss-6a837e727d6------2">Continue reading on Towards Dev »</a></p></div>]]></description>
            <link>https://towardsdev.com/how-to-use-the-no-code-azure-developer-portal-to-showcase-your-apis-to-customers-1974023beabe?source=rss-6a837e727d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1974023beabe</guid>
            <category><![CDATA[api-management]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[microsoft-azure]]></category>
            <dc:creator><![CDATA[Eman Hassan]]></dc:creator>
            <pubDate>Thu, 12 Sep 2024 08:04:50 GMT</pubDate>
            <atom:updated>2024-09-13T14:47:11.741Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Avoid Falling into the Auto-Renewal Trap]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://emhassan.medium.com/avoid-falling-into-the-auto-renewal-trap-8cbae224832d?source=rss-6a837e727d6------2"><img src="https://cdn-images-1.medium.com/max/2600/0*nLpKqkSu3GTkJsTq" width="5448"></a></p><p class="medium-feed-snippet">When you subscribe to an online service or tool, you&#x2019;re often presented with an option for auto-renewal. This feature, once something you&#x2026;</p><p class="medium-feed-link"><a href="https://emhassan.medium.com/avoid-falling-into-the-auto-renewal-trap-8cbae224832d?source=rss-6a837e727d6------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://emhassan.medium.com/avoid-falling-into-the-auto-renewal-trap-8cbae224832d?source=rss-6a837e727d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cbae224832d</guid>
            <category><![CDATA[budget-friendly]]></category>
            <category><![CDATA[online-business]]></category>
            <category><![CDATA[services]]></category>
            <category><![CDATA[automation-software]]></category>
            <category><![CDATA[subscription]]></category>
            <dc:creator><![CDATA[Eman Hassan]]></dc:creator>
            <pubDate>Tue, 03 Sep 2024 19:26:43 GMT</pubDate>
            <atom:updated>2024-09-03T19:26:43.703Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Every Saturday: Sharing Stories from The Tales of a Down-Leveled Developer for free on my Substack]]></title>
            <link>https://emhassan.medium.com/every-saturday-sharing-stories-from-the-tales-of-a-down-leveled-developer-for-free-on-my-substack-6be2e653074e?source=rss-6a837e727d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6be2e653074e</guid>
            <category><![CDATA[big-tech]]></category>
            <category><![CDATA[tech-culture]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Eman Hassan]]></dc:creator>
            <pubDate>Fri, 30 Aug 2024 06:17:53 GMT</pubDate>
            <atom:updated>2024-08-30T06:17:53.186Z</atom:updated>
            <content:encoded><![CDATA[<h3>Every Saturday on Substack: Sharing Stories from The Tales of a Down-Leveled Developer</h3><p>I’m excited to announce that I’ll be publishing a story each week for my <a href="https://emanhassan.substack.com/">Substack</a> free subscribers from my <a href="https://emhassan.gumroad.com/l/tngvu/o0v3epm">e-book The Tales of A Down-leveled Developer — Misadventures In The World Of Tech</a>. These stories are a good read, offering relatable experiences with a touch of sarcasm and dark comedy about life in the tech industry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UNYLbXzg6hQj7rM0.jpeg" /></figure><p>Through these tales, I aim to shed light on some of the cultural and work environment issues that many of us face. My hope is that by highlighting these challenges, those with the power to make changes within their teams or companies can take action to prevent them from happening.</p><p>I invite you to enjoy these stories and share your feedback!</p><blockquote>Subscribe <a href="https://emanhassan.substack.com/">here</a> for free to my Substack to read the stories and get notified every Saturday!</blockquote><p>As you dive in, I encourage you to read the preface — it’s crucial because it explains the reasons behind these stories and the thought process that went into writing them.</p><p>Enjoy the read and stay tuned for the first story on Saturday!</p><p><strong>Preface</strong></p><p>Welcome to the Misadventures of the Tech World, a collection of short stories exploring the humorous, ironic, and surreal experiences of working in technology.</p><p>Over my years as an engineer, I’ve witnessed countless situations that left me disheartened instances where speaking up would often backfire, or where no one seemed to listen. Unfortunately, these stories aren’t unique to me; I’ve seen my colleagues endure similar experiences, and many other over social communities. It’s a harsh reality, especially for software engineers facing unfair layoffs, PIPs, down-leveling, overlooked promotions, and so much more.</p><p>To channel this frustration, I began writing short stories that capture these situations, blending them with a touch of sarcasm and unexpected twists to keep things entertaining. What started as a form of release has now turned into a collection of stories, which I’ve gathered into an e-book.</p><p>Some of you might find these stories relatable, while others — especially managers — might feel a bit triggered (but please, don’t take it personally). There are many incredible managers and tech professionals out there, but this e-book is about shedding light on the darker side, all with a bit of humor and a dash of sarcasm. So, grab a cup of coffee, relax, and enjoy the stories.</p><p>I’d love to hear your thoughts and would greatly appreciate your support. There’s plenty more where these stories came from, and I’m already working on the next edition!</p><p>These stories’ ideas, flows, challenges and context are entirely my own creation. As English is my second language, I’ve used AI to help refine the grammar, tone, flow and some twists to the narratives, as well as to generate the accompanying image illustrations. Enjoy the journey and remember — sometimes the best way to navigate the madness is to embrace it with a smile.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6be2e653074e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build App Authentication with .NET, Auth0 and Twilio SendGrid]]></title>
            <link>https://emhassan.medium.com/build-app-authentication-with-net-auth0-and-twilio-sendgrid-7285646059f6?source=rss-6a837e727d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7285646059f6</guid>
            <category><![CDATA[auth0]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Eman Hassan]]></dc:creator>
            <pubDate>Sun, 25 Aug 2024 05:59:32 GMT</pubDate>
            <atom:updated>2024-08-25T06:09:28.861Z</atom:updated>
            <content:encoded><![CDATA[<h3>Build App Authentication with .NET, Auth0 and Twilio SendGrid</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EU6FUtrW0QV_SuEj" /><figcaption>Photo by <a href="https://unsplash.com/@flyd2069?utm_source=medium&amp;utm_medium=referral">FlyD</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Authentication is essential for almost every application, but it can feel complicated and overwhelming to implement securely. Luckily, tools like Auth0 make it easier by handling the authentication process for you. In this post, you’ll learn how to create a .NET Core MVC web application with Auth0 authentication and Twilio SendGrid email notifications for user registration.</p><h4>Prerequisites</h4><p>In order to be successful in this tutorial, you will need the following:</p><ul><li><a href="https://signup.sendgrid.com/">A free Twilio SendGrid account</a></li><li><a href="https://visualstudio.microsoft.com/vs/community/">Visual Studio free Community Edition</a></li><li><a href="https://auth0.com/signup">Free Auth0 account</a></li></ul><h4>Building the app</h4><p>Open Visual Studio. Click on <strong>Create a new project,</strong> then search for asp.net core web app. Click on <strong>ASP.NET Core Web App (Model-View-Controller).</strong> If there are multiple matching projects, be sure you select the project using the C# code base.Click <strong>Next.</strong></p><figure><img alt="Create ASP.NET Core MVC Web App" src="https://cdn-images-1.medium.com/max/1024/0*jxm6Tz4JCypwhsOC" /></figure><p>Add a name to your project and click <strong>Next</strong>. Select your .NET version, and set the Authentication type to <strong>None</strong>. Keep the rest of the defaults and click <strong>Create.</strong></p><figure><img alt="Choose .net framework" src="https://cdn-images-1.medium.com/max/974/0*V3XM578S9Gmiov7B" /></figure><p>You will see the project created with a working MVC web app. If you try to run it, you will see a starting home page. You can learn more about MVC <a href="https://learn.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/overview/asp-net-mvc-overview">here</a>.</p><h4>Install Aut0 .NET SDK</h4><p>In the top menu, click <strong>Tools &gt; NuGet Package Manager &gt; Manage NuGet Packages for Solution.</strong></p><figure><img alt="open package manager" src="https://cdn-images-1.medium.com/max/936/0*0gfloLZ4GZo0zRNu" /></figure><p>Using the search bar and the Browse tab, browse for <strong>Auth0.AspNetCore.Authentication</strong>. Install it to the project as shown below. A popup will show up to apply dependencies and accept licenses. Click <strong>Apply, </strong>then <strong>Accept, </strong>to proceed.</p><figure><img alt="Install auth0 SDK" src="https://cdn-images-1.medium.com/max/1024/0*LdQ0ZnmNoGErk7Fr" /></figure><h4>Configure Auth0 application</h4><p>Log in to your account at auth0.com. From the Auth0 dashboard, go to <strong>Applications </strong>&gt; <strong>Applications </strong>&gt; <strong>Create Application</strong>. Choose a name for your application. Select <strong>Regular Web Applications</strong> and click <strong>Create</strong>.</p><p>Select the settings tab for your application and review the <strong>Domain</strong>, <strong>Client ID</strong> and <strong>Client Secret</strong> for the application. You will use these later to connect to the application from the MVC application in Visual Studio.</p><figure><img alt="Explore app settings" src="https://cdn-images-1.medium.com/max/1024/0*dFhPV_JjeyCX7M0M" /></figure><p>Then scroll down to the <strong>Application URIs </strong>section and add the following URLs to allow the connection between your localhost web app and the Auth0 application and authentication flow.</p><ul><li>Allowed Callback URLs: <a href="https://localhost:7601/callback">https://localhost:7601/callback</a></li><li>Allowed Logout URLs: <a href="https://localhost:7601/">https://localhost:7601/</a></li><li>Allowed Web Origins: <a href="https://localhost:7601/">https://localhost:7601</a></li></ul><p>Be sure to click Save Changes before you continue.</p><blockquote>Note that the port number of the localhost might change depending on which port Visual Studio used when you run the MVC application locally. Make sure you fix the port number in Auth0 settings if it shows up differently from what is listed above.</blockquote><h4>Configure SendGrid in Auth0 Dashboard</h4><p>Before you can start sending user registration emails to the users, there are a few more mandatory steps you’ll need to complete in your SendGrid account:</p><ol><li><a href="https://www.twilio.com/docs/sendgrid/ui/sending-email/sender-verification">Verifying your Email</a></li><li><a href="https://docs.sendgrid.com/ui/account-and-settings/two-factor-authentication?_gl=1*16gl37p*_ga*NjIyNjMzMTQxLjE2NTI4MDk5ODM.*_ga_RRP8K4M4F3*MTcwODAxMTE1My45MzUuMS4xNzA4MDExNjkyLjAuMC4w">Setting up 2-Factor Authentication</a></li><li><a href="https://docs.sendgrid.com/ui/account-and-settings/how-to-set-up-domain-authentication?_gl=1*mlky0h*_ga*NjIyNjMzMTQxLjE2NTI4MDk5ODM.*_ga_RRP8K4M4F3*MTcwODAxMTE1My45MzUuMS4xNzA4MDExNjkyLjAuMC4w">Verifying your Domain</a></li></ol><p>Once you’ve completed the above steps, you’ll need to <a href="https://app.sendgrid.com/settings/api_keys?_gl=1*1h02m08*_ga*NjIyNjMzMTQxLjE2NTI4MDk5ODM.*_ga_RRP8K4M4F3*MTcwODAxMTE1My45MzUuMS4xNzA4MDExODExLjAuMC4w">create a new API Key</a>. Keep this key somewhere safe as you will need it in the Auth0 dashboard.</p><p>Go to Auth0 dashboard and in the left navigation, click <strong>Branding &gt; Email Provider. T</strong>hen, make sure you enable the option to <strong>Use my own email provider. </strong>Choose <strong>SendGrid</strong> from the providers list as shown below.</p><figure><img alt="Select email provider" src="https://cdn-images-1.medium.com/max/1024/0*RaZ0YnnVHDS_yvjs" /></figure><p>Scroll down the page and you will be able to add your SendGrid API key and your SendGrid verified from email.</p><figure><img alt="SendGrid Settings" src="https://cdn-images-1.medium.com/max/1024/0*fmkaMiOh0Pzo4N1p" /></figure><h4>Configure your MVC application</h4><p>Go back to Visual Studio and open the <em>appsettings.json</em> file. Replace the code in that file with the code below. Replace the placeholder values with the corresponding Domain, Client ID and Client Secret from your Auth0.</p><pre>{<br>  &quot;Auth0&quot;: {<br>    &quot;Domain&quot;: &quot;YOUR_AUTH0_DOMAIN&quot;,<br>    &quot;ClientId&quot;: &quot;YOUR_AUTH0_CLIENT_ID&quot;,<br>    &quot;ClientSecret&quot;: &quot;YOUR_AUTH0_CLIENT_SECRET&quot;<br>  },<br>  &quot;Logging&quot;: {<br>    &quot;LogLevel&quot;: {<br>      &quot;Default&quot;: &quot;Information&quot;,<br>      &quot;Microsoft&quot;: &quot;Warning&quot;,<br>      &quot;Microsoft.Hosting.Lifetime&quot;: &quot;Information&quot;<br>    }<br>  },<br>  &quot;AllowedHosts&quot;: &quot;*&quot;<br>}</pre><p>Open the <em>program.cs </em>file, and replace the code in the file with the following code. This includes adding the function AddAuth0WebAppAuthentication, which is responsible for loading Auth0 with your Auth0 application credentials.</p><pre>using Auth0.AspNetCore.Authentication;<br><br><br>var builder = WebApplication.CreateBuilder(args);<br><br><br>// Configure Auth0<br>builder.Services.AddAuth0WebAppAuthentication(options =&gt;<br>{<br>    options.Domain = builder.Configuration[&quot;Auth0:Domain&quot;];<br>    options.ClientId = builder.Configuration[&quot;Auth0:ClientId&quot;];<br>    options.ClientSecret = builder.Configuration[&quot;Auth0:ClientSecret&quot;];<br>    options.Scope = &quot;openid profile email&quot;;<br>});<br>// Add services to the container.<br>builder.Services.AddControllersWithViews();<br><br><br>var app = builder.Build();<br><br><br><br><br>// Configure the HTTP request pipeline.<br>if (!app.Environment.IsDevelopment())<br>{<br>    app.UseExceptionHandler(&quot;/Home/Error&quot;);<br>    // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.<br>    app.UseHsts();<br>}<br><br><br>app.UseHttpsRedirection();<br>app.UseStaticFiles();<br><br><br>app.UseRouting();<br><br><br>app.UseAuthorization();<br><br><br>app.MapControllerRoute(<br>    name: &quot;default&quot;,<br>    pattern: &quot;{controller=Home}/{action=Index}/{id?}&quot;);<br><br><br>app.Run();</pre><p>Right click the <strong>Controllers </strong>folder, then click <strong>Add &gt; Controller. </strong>Select <strong>MVC Controller — Empty </strong>and click <strong>Add.</strong></p><figure><img alt="Choose empty controller" src="https://cdn-images-1.medium.com/max/1024/0*5wqRvI1buRKmnClo" /></figure><p>Name your controller as AccountController.cs. Replace the following code in your controller:</p><pre>using Auth0.AspNetCore.Authentication;<br>using Microsoft.AspNetCore.Authentication.Cookies;<br>using Microsoft.AspNetCore.Authentication;<br>using Microsoft.AspNetCore.Mvc;<br><br>namespace ASPNetCore_MVC_WebAPP.Controllers<br>{<br>    public class AccountController : Controller<br>    {<br>        public async Task Login(string returnUrl = &quot;/&quot;)<br>        {<br>            await HttpContext.ChallengeAsync(Auth0Constants.AuthenticationScheme, new AuthenticationProperties<br>            {<br>                RedirectUri = returnUrl<br>            });<br>        }<br><br>        public async Task Logout()<br>        {<br>            await HttpContext.SignOutAsync(Auth0Constants.AuthenticationScheme, new AuthenticationProperties<br>            {<br>                RedirectUri = Url.Action(&quot;Index&quot;, &quot;Home&quot;)<br>            });<br>            await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);<br>        }<br>    }<br>}</pre><p>Now you need to add <strong>Login/Logout </strong>links to your MVC application’s layout header. Go to the <em>Views</em>folder then click on <em>Shared</em>, then open <em>_Layout.cshtml</em> <strong>. </strong>Replace the code in this file with the following code to include the nav items for <strong>Login </strong>and <strong>Logout.</strong></p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;utf-8&quot; /&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;<br>    &lt;title&gt;@ViewData[&quot;Title&quot;] - ASPNetCore_MVC_WebAPP&lt;/title&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;~/lib/bootstrap/dist/css/bootstrap.min.css&quot; /&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;~/css/site.css&quot; asp-append-version=&quot;true&quot; /&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;~/ASPNetCore_MVC_WebAPP.styles.css&quot; asp-append-version=&quot;true&quot; /&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;header&gt;<br>        &lt;nav class=&quot;navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3&quot;&gt;<br>            &lt;div class=&quot;container-fluid&quot;&gt;<br>                &lt;a class=&quot;navbar-brand&quot; asp-area=&quot;&quot; asp-controller=&quot;Home&quot; asp-action=&quot;Index&quot;&gt;ASPNetCore_MVC_WebAPP&lt;/a&gt;<br>                &lt;button class=&quot;navbar-toggler&quot; type=&quot;button&quot; data-bs-toggle=&quot;collapse&quot; data-bs-target=&quot;.navbar-collapse&quot; aria-controls=&quot;navbarSupportedContent&quot;<br>                        aria-expanded=&quot;false&quot; aria-label=&quot;Toggle navigation&quot;&gt;<br>                    &lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt;<br>                &lt;/button&gt;<br>                &lt;div class=&quot;navbar-collapse collapse d-sm-inline-flex justify-content-between&quot;&gt;<br>                    &lt;ul class=&quot;navbar-nav flex-grow-1&quot;&gt;<br>                        &lt;li class=&quot;nav-item&quot;&gt;<br>                            &lt;a class=&quot;nav-link text-dark&quot; asp-area=&quot;&quot; asp-controller=&quot;Home&quot; asp-action=&quot;Index&quot;&gt;Home&lt;/a&gt;<br>                        &lt;/li&gt;<br>                        &lt;li class=&quot;nav-item&quot;&gt;<br>                            &lt;a class=&quot;nav-link text-dark&quot; asp-area=&quot;&quot; asp-controller=&quot;Home&quot; asp-action=&quot;Privacy&quot;&gt;Privacy&lt;/a&gt;<br>                        &lt;/li&gt;<br>                        @if (User.Identity.IsAuthenticated)<br>                        {<br>                            &lt;li&gt;&lt;a class=&quot;nav-link text-dark&quot; asp-controller=&quot;Account&quot; asp-action=&quot;Logout&quot;&gt;Logout&lt;/a&gt;&lt;/li&gt;<br>                        }<br>                        else<br>                        {<br>                            &lt;li&gt;&lt;a class=&quot;nav-link text-dark&quot; asp-controller=&quot;Account&quot; asp-action=&quot;Login&quot;&gt;Login&lt;/a&gt;&lt;/li&gt;<br>                        }<br><br>                    &lt;/ul&gt;<br>                &lt;/div&gt;<br>            &lt;/div&gt;<br>        &lt;/nav&gt;<br>    &lt;/header&gt;<br>    &lt;div class=&quot;container&quot;&gt;<br>        &lt;main role=&quot;main&quot; class=&quot;pb-3&quot;&gt;<br>            @RenderBody()<br>        &lt;/main&gt;<br>    &lt;/div&gt;<br><br>    &lt;footer class=&quot;border-top footer text-muted&quot;&gt;<br>        &lt;div class=&quot;container&quot;&gt;<br>            &amp;copy; 2024 - ASPNetCore_MVC_WebAPP - &lt;a asp-area=&quot;&quot; asp-controller=&quot;Home&quot; asp-action=&quot;Privacy&quot;&gt;Privacy&lt;/a&gt;<br>        &lt;/div&gt;<br>    &lt;/footer&gt;<br>    &lt;script src=&quot;~/lib/jquery/dist/jquery.min.js&quot;&gt;&lt;/script&gt;<br>    &lt;script src=&quot;~/lib/bootstrap/dist/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;<br>    &lt;script src=&quot;~/js/site.js&quot; asp-append-version=&quot;true&quot;&gt;&lt;/script&gt;<br>    @await RenderSectionAsync(&quot;Scripts&quot;, required: false)<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h4>Run the application</h4><p>Now your application has authentication configured. You can run the application in Visual Studio by clicking on the run button on the top toolbar as shown below.</p><figure><img alt="Start the application" src="https://cdn-images-1.medium.com/max/1024/0*3pVRTOkHIwZibMJr" /></figure><p>A console window will appear with the localhost url the application is running on. Make sure to revise it and match it with the URLs you have configured in Auth0.</p><figure><img alt="Console window" src="https://cdn-images-1.medium.com/max/1024/0*f-l8i67qCxWK9yDt" /></figure><p>Then browse to the localhost URL and you will see the web app showing up as shown below. You can then click <strong>Login.</strong></p><figure><img alt="Application run" src="https://cdn-images-1.medium.com/max/1024/0*eZnDic40ZONfKEyr" /></figure><p>The login action will redirect you to the Auth0 generated login page. Here, you can register as a new user and login to the app.</p><figure><img alt="auth0 login page" src="https://cdn-images-1.medium.com/max/851/0*SGvYiWiE_lRQYYIu" /></figure><p>When signup and login are successful, it will redirect back to your application. When you are already logged in, the <strong>Login </strong>button will now show as <strong>Logout</strong> as shown below.</p><figure><img alt="Logout button" src="https://cdn-images-1.medium.com/max/1024/0*XJa3q8qoQXcsLVGz" /></figure><p>You can then secure any action page in the controllers of the MVC app with the annotation [Authorize] above the function if you want to have a page accessible to only logged in users.</p><h4>Navigate registered users on Auth0</h4><p>To see all your registered users, go back to the Auth0 dashboard and click on <strong>User Management &gt; Users. </strong>From here,you will be able to see the list of all users registered to your application.</p><figure><img alt="Users list" src="https://cdn-images-1.medium.com/max/1024/0*1N4dvOQmNgbD2mr7" /></figure><p>Registered users will have a welcome email sent to their inbox with Auth0’s default template.</p><blockquote>You can customize the email templates in Auth0 by navigating to <strong>Branding &gt; Email Templates.</strong></blockquote><h4>Customize your Auth0 Application</h4><p>It is a good idea to extend your application through customization. You can start on Auth0’s login page by adding your logo. Customize how it looks by clicking on <strong>Branding &gt; Universal login</strong> in the left navigation bar in the Auth0 dashboard. When you are ready to publish your application to a custom domain, you will be able to have the login page tied to your custom domain through the configuration in <strong>Branding &gt; Custom domains.</strong></p><h4>What’s next for Auth0 Applications?</h4><p>At the conclusion of this tutorial, you will have acquired the skill sets to set up and utilize Twilio SendGrid APIs, and to create, configure and run ASP.NET Core MVC web applications with Auth0 authentication.</p><p>For more advanced customization for your Auth0 application, like implementing certain login or user registration events, you can explore <a href="https://auth0.com/docs/customize/actions">Auth0 Actions</a>. Actions can allow you to customize the authentication flow according to your application’s needs.</p><p>You can find the full code for this tutorial <a href="https://github.com/EmanH5/ASPNETCoreMVCAPP">here</a>.</p><p><em>Originally published at </em><a href="https://www.twilio.com/en-us/blog/app-authentication-dot-net-core-auth0-twilio-sendgrid"><em>https://www.twilio.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7285646059f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>