<?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 Dileepa Mabulage on Medium]]></title>
        <description><![CDATA[Stories by Dileepa Mabulage on Medium]]></description>
        <link>https://medium.com/@dileepa.mabulage?source=rss-bae452aa06e8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3r3zk0eihVPZIksDVGXBCQ.jpeg</url>
            <title>Stories by Dileepa Mabulage on Medium</title>
            <link>https://medium.com/@dileepa.mabulage?source=rss-bae452aa06e8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 21:56:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dileepa.mabulage/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[How to Create a Usability Research Question: A Practical Guide for Students]]></title>
            <link>https://medium.com/@dileepa.mabulage/how-to-create-a-usability-research-question-a-practical-guide-for-students-a27243f75e31?source=rss-bae452aa06e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/a27243f75e31</guid>
            <category><![CDATA[usability]]></category>
            <category><![CDATA[hypothesis-testing]]></category>
            <category><![CDATA[usability-testing]]></category>
            <category><![CDATA[ux-research]]></category>
            <category><![CDATA[research-question]]></category>
            <dc:creator><![CDATA[Dileepa Mabulage]]></dc:creator>
            <pubDate>Sun, 23 Nov 2025 11:53:48 GMT</pubDate>
            <atom:updated>2025-11-23T11:53:48.175Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4My0DXFO9d1cvRuO.jpg" /><figcaption><a href="https://researcher.life/blog/article/tips-identify-meaningful-research-question/">Research Questions</a></figcaption></figure><p>Creating a strong usability research question is one of the most important and most overlooked steps in UX evaluation. Before selecting metrics, building test materials, or recruiting participants, you must define <strong>what problem you are investigating</strong> and <strong>why it matters</strong>. A clear research question guides your entire usability study and ensures that the data you collect is meaningful, measurable, and tied to usability metrics.</p><p>This article walks you through how to identify a usability problem and transform it into a focused, testable research question.</p><h3>Types of Behavioural Research Questions</h3><p>Behavioural research questions aim to understand <strong>how users behave</strong>, why they behave in a certain way, and what factors influence their behaviour. In usability testing, these fall into <strong>three main categories</strong>:</p><ol><li><strong>Descriptive Research Questions</strong></li></ol><p><strong>Purpose:</strong> <em>Describe what is happening.</em><br> These questions focus on <strong>observing user behaviour</strong> without analysing relationships or causes.</p><p><strong>RQ: </strong>How does the user experience in playing games impact their touch-typing proficiency?</p><p><strong>2. Relational Research Questions</strong></p><p><strong>Purpose:</strong> <em>Examine relationships between variables.</em><br> These questions look for <strong>correlations </strong>whether two factors change together.</p><p><strong>RQ: </strong>What is the correlation between the user experience in playing games and touch-typing proficiency?</p><p><strong>3. Experimental (Causal) Research Questions</strong></p><p><strong>Purpose:</strong> <em>Determine whether one variable CAUSES changes in another.</em><br> These involve <strong>manipulating an independent variable</strong> and observing its effect on a dependent variable.</p><p><strong>RQ: </strong>How does manipulating the user experience in playing games impact touch-typing proficiency?</p><h3>Research Question</h3><p>A research question is a question that a study or research project aims to answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*kknxzn97LNNIcWEu3ZE6PA.png" /><figcaption>Self-Composed</figcaption></figure><p>A strong usability research question must outline several key aspects of the study. These include:</p><ol><li><strong>The Population</strong></li></ol><p>This describes who the study is about, the users to whom the experimental conditions will be applied.</p><ul><li><em>Novice users aged 18–25 using a mobile device</em></li><li><em>Experienced online shoppers</em></li></ul><p>2. <strong>Variables</strong></p><p>These include the <strong>independent variable</strong> (what you change) and the <strong>dependent variable</strong> (what you measure).</p><ul><li>Independent variable: <em>The factor you manipulate (design change, layout, feature, device, condition)</em></li><li>Dependent variable: <em>What you measure (task time, error rate, satisfaction score, clicks)</em></li></ul><p>3. <strong>The Problem</strong></p><p>This explains the usability issue or user difficulty that the research aims to investigate.</p><ul><li><em>Users struggle to locate the checkout button quickly.</em></li><li><em>High error rates occur during the form submission process.</em></li></ul><p>4. <strong>The Research Design</strong></p><p>This identifies <strong>how</strong> the study will be structured:</p><ul><li><strong>Descriptive</strong> (what is happening)</li><li><strong>Relational</strong> (are two factors related)</li><li><strong>Experimental</strong> (does X cause Y)</li></ul><p>An experimental design comparing two versions of a navigation bar</p><p>5. <strong>The Treatments or Conditions</strong></p><p>Refer to the different techniques, devices, or procedures that we want to compare.</p><ul><li>Treatment — independent variables (device type)</li><li>Conditions — laptop, mobile, desktop</li></ul><p>6. <strong>The Assignment Method</strong></p><p>The way in which the experimental units are assigned different treatments</p><ul><li>Between-Subjects Design (Different people test different conditions)</li><li>Within-Subjects Design (Same people test all conditions)</li></ul><h3>Forming a Good Research Question Using FINER</h3><p>The <strong>FINER</strong> framework helps you check if your research question is strong, meaningful, and possible to test in a real study.</p><p>FINER stands for:</p><ul><li><strong>F — Feasible</strong></li><li><strong>I — Interesting</strong></li><li><strong>N — Novel</strong></li><li><strong>E — Ethical</strong></li><li><strong>R — Relevant</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*dQIV4yZ4JLs7QS4U.png" /><figcaption><a href="https://scientific-publishing.webshop.elsevier.com/research-process/finer-research-framework/">Finer Framework</a></figcaption></figure><h3>Sample Research Questions</h3><p><strong>RQ</strong>: Does having a search bar improve the time it takes users to locate information on a website?</p><ul><li>Population — Users</li><li>Independent Variable — Presence of search bar (available, not-available)</li><li>Dependent Variable — Task completion time (seconds)</li><li>Research Design — Between-subjects design. Two different groups test one version each</li></ul><p><strong>RQ: </strong>Do users make fewer errors when completing a form using a redesigned version compared to the current version?</p><ul><li>Population — Users</li><li>Independent Variable — Form version (version A, Version B)</li><li>Dependent Variable — Number of errors made during completion</li><li>Research Design — Within-subjects design. The same users complete both forms.</li></ul><p><strong>RQ: </strong>Does user satisfaction differ between three different mobile app home screen layouts?</p><ul><li>Population — Users</li><li>Independent Variable — Home screen layout version (Layout A, Layout B, Layout C)</li><li>Dependent Variable — User satisfaction rating (1–7 Likert scale).</li><li>Research Design — Between-subjects design (3 groups) Each group uses one layout (ANOVA).</li></ul><p>A well-designed research question not only guides your study but also ensures that your findings lead to real improvements in the user experience. Start with a problem, link it to a usability metric, and let that question drive your evaluation process.</p><p>Good research begins with good questions.</p><p>Thank you…</p><h4>References</h4><p>Economou, D. (2024–2025). Usability Testing &amp; Evaluation — Lecture Notes (Week 4). School of Computer Science &amp; Engineering, University of Westminster. (Module: 6MMCS009W1)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a27243f75e31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generating User-Delegation SAS Tokens for Azure Storage Accounts with Managed Identity (App…]]></title>
            <link>https://medium.com/@dileepa.mabulage/generating-user-delegation-sas-tokens-for-azure-storage-accounts-with-managed-identity-app-46170c94b8e2?source=rss-bae452aa06e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/46170c94b8e2</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[managed-identity]]></category>
            <category><![CDATA[app-service]]></category>
            <category><![CDATA[storage-account]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Dileepa Mabulage]]></dc:creator>
            <pubDate>Sun, 16 Mar 2025 12:48:00 GMT</pubDate>
            <atom:updated>2025-03-16T12:48:00.318Z</atom:updated>
            <content:encoded><![CDATA[<h3>Generating User-Delegation SAS Tokens for Azure Storage Accounts with Managed Identity (App Service): A Keyless Approach to Enhanced Security</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*DIH7kfcgaex_l11p72VZbA.png" /></figure><p>When using <strong>key-based authorization</strong>, <strong>anyone</strong> who has the storage account key can access the data — there’s no way to track <strong>who</strong> accessed it or <strong>control</strong> their permissions effectively. This creates a security risk if the key is leaked or shared.</p><blockquote>This is secured with Microsoft Entra credentials and is supported for the Blob service only to:</blockquote><blockquote>Grant access to an existing container.</blockquote><blockquote>Grant access to create, use, and delete blobs.</blockquote><p><a href="https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-create-user-delegation-sas-javascript">Create a user delegation SAS with JavaScript - Azure Storage</a></p><h4>1. Create a Storage Account</h4><ol><li>Log in to the <a href="https://portal.azure.com/">Azure Portal</a>.</li><li>Navigate to <strong>Storage Accounts</strong> and click <strong>Create</strong>.</li><li>Configure the required settings, including:</li></ol><ul><li><strong>Subscription</strong>: Select your subscription.</li><li><strong>Resource Group</strong>: Choose an existing one or create a new one.</li><li><strong>Storage Account Name</strong>: Provide a unique name.</li><li><strong>Region</strong>: Select a preferred region.</li><li><strong>Redundancy</strong>: Choose based on your requirements.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bvlMBj-75RxGPXHLk5XpSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*CxEhARGcornJslmmUvud6Q.png" /></figure><p>Click <strong>Review + Create</strong> and then <strong>Create</strong>.</p><p>After deployment, check that <strong>Key Access is disabled</strong> for enhanced security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3THxmGXe6h3B4OMgKX4A9w.png" /></figure><p>Create a <strong>new container</strong> in the storage account to store blobs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tjhih3oVzuMczh8THzA21g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*PrmvTFseY1WUEk4r0Ne9mg.png" /></figure><h4>2. Create a App Service</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*n_oQu2lH_WXPf8CIvjf1iw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*ozMIJCn9VYL_Xc2_3FmpOw.png" /></figure><p>Enable <strong>Managed Identity</strong>:</p><ul><li>Go to the <strong>Identity</strong> tab in App Service.</li><li>Enable <strong>System Assigned Managed Identity</strong>.</li><li>Click <strong>Save</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*zbETsz4eFTsIWRMVl7VCpQ.png" /></figure><h4>3. Assign IAM Roles in Storage Account</h4><ol><li>Navigate to the <strong>Storage Account</strong> in the Azure Portal.</li><li>Go to <strong>Access Control (IAM)</strong> &gt; <strong>Add Role Assignment</strong>.</li><li>Assign <strong>Storage Blob Data Owner</strong> role to:</li></ol><ul><li>The App Service (managed identity).</li><li>Your Azure account (to allow viewing blobs inside the container).</li></ul><p>Click <strong>Save</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*rHs_hswr2O3dFiF4XqKLOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AXN1OMCxdb9SR8t4TJYCTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*snCc8peQXEz7EFDkbg71Ag.png" /></figure><h4>4. NodeJs Sample</h4><pre>const { DefaultAzureCredential } = require(&#39;@azure/identity&#39;);<br>const {<br>  BlobServiceClient,<br>  ContainerSASPermissions,<br>  generateBlobSASQueryParameters,<br>  SASProtocol,<br>  BlockBlobClient,<br>} = require(&#39;@azure/storage-blob&#39;);<br>const express = require(&#39;express&#39;);<br>const bodyParser = require(&#39;body-parser&#39;);<br>const fileUpload = require(&#39;express-fileupload&#39;);<br><br>const app = express();<br>app.use(express.json());<br>app.use(bodyParser.json());<br>app.use(bodyParser.urlencoded({ extended: true }));<br>app.use(fileUpload());<br><br>const STORAGE_ACCOUNT_NAME = &#39;mediuamtestst&#39;;<br>const BLOB_CONTAINER_NAME = &#39;test&#39;;<br><br>async function createContainerSas() {<br>  const TEN_MINUTES = 10 * 60 * 1000;<br>  const NOW = new Date();<br><br>  const TEN_MINUTES_BEFORE_NOW = new Date(NOW.valueOf() - TEN_MINUTES);<br>  const TEN_MINUTES_AFTER_NOW = new Date(NOW.valueOf() + TEN_MINUTES);<br><br>  const blobServiceClient = new BlobServiceClient(<br>    `https://${STORAGE_ACCOUNT_NAME}.blob.core.windows.net`,<br>    new DefaultAzureCredential()<br>  );<br><br>  const userDelegationKey = await blobServiceClient.getUserDelegationKey(<br>    TEN_MINUTES_BEFORE_NOW,<br>    TEN_MINUTES_AFTER_NOW<br>  );<br><br>  const sasToken = generateBlobSASQueryParameters(<br>    {<br>      containerName: BLOB_CONTAINER_NAME,<br>      permissions: ContainerSASPermissions.parse(&#39;racwd&#39;), // Read, Add, Create, Write, Delete<br>      protocol: SASProtocol.HttpsAndHttp,<br>      startsOn: TEN_MINUTES_BEFORE_NOW,<br>      expiresOn: TEN_MINUTES_AFTER_NOW,<br>    },<br>    userDelegationKey,<br>    STORAGE_ACCOUNT_NAME<br>  ).toString();<br><br>  return sasToken;<br>}<br><br>const generateBlobUploadUrl = async (blobName) =&gt; {<br>  const sasToken = await createContainerSas();<br>  return `https://${STORAGE_ACCOUNT_NAME}.blob.core.windows.net/${BLOB_CONTAINER_NAME}/${blobName}?${sasToken}`;<br>};<br><br>app.get(&#39;/api/sas&#39;, async (req, res) =&gt; {<br>  try {<br>    const sasToken = await createContainerSas();<br>    return res.json({ sasToken });<br>  } catch (error) {<br>    console.error(error);<br>    return res.status(500).send(error);<br>  }<br>});<br><br>app.get(&#39;/api/upload-url&#39;, async (req, res) =&gt; {<br>  try {<br>    const blobName = req.query.blobName;<br><br>    if (!blobName) {<br>      return res.status(400).send(&#39;Blob name is required&#39;);<br>    }<br><br>    const blobUploadUrl = await generateBlobUploadUrl(blobName);<br>    return res.json({ blobUploadUrl });<br>  } catch (error) {<br>    console.error(error);<br>    return res.status(500).send(error);<br>  }<br>});<br><br>app.post(&#39;/api/upload&#39;, async (req, res) =&gt; {<br>  try {<br>    const { url } = req.body;<br><br>    if (!url || !req.files) {<br>      return res.status(400).send(&#39;Url and file are required&#39;);<br>    }<br><br>    const blobService = new BlockBlobClient(url);<br><br>    const { file } = req.files;<br><br>    await blobService.uploadData(file.data);<br><br>    return res.status(200).send(&#39;File uploaded successfully&#39;);<br>  } catch (error) {<br>    console.error(error);<br>    return res.status(500).send(error);<br>  }<br>});<br><br>app.listen(process.env.PORT || 3000, () =&gt; {<br>  console.log(&#39;Server is running on port 3000&#39;);<br>});</pre><p><strong>Generating a SAS Token (</strong><strong>/api/sas):</strong></p><ul><li>The createContainerSas function generates a <strong>User Delegation SAS Token</strong> valid for <strong>10 minutes</strong>.</li><li>This allows temporary access to the blob container with <strong>read, add, create, write, and delete</strong> permissions.</li></ul><p><strong>Generating an Upload URL (</strong><strong>/api/upload-url):</strong></p><ul><li>Accepts a blobName (file name) as a query parameter.</li><li>Calls generateBlobUploadUrl(blobName) to create a <strong>pre-signed URL</strong> with SAS.</li><li>Returns the <strong>upload URL</strong>, allowing a client to upload a file directly.</li></ul><p><strong>Uploading a File (</strong><strong>/api/upload):</strong></p><ul><li>Accepts url (the pre-signed upload URL) and a file as part of the request.</li><li>Uses BlockBlobClient to upload the file to Azure Storage.</li><li>Returns a success message if the upload is completed.</li></ul><h4>5. Testing</h4><p><strong>Deploy the App to Azure App Service</strong>:</p><p><a href="https://learn.microsoft.com/en-us/azure/app-service/quickstart-nodejs?tabs=linux&amp;pivots=development-environment-vscode">Quickstart: Create a Node.js web app - Azure App Service</a></p><p>Navigate to <a href="https://yourapp.azurewebsites.net/api/sas">https://yourapp.azurewebsites.net/api/sas</a> to view the SAS Token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TNQWlCbTkC19VsIQCNZ4ig.png" /></figure><p><a href="https://learn.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas">Create a user delegation SAS - Azure Storage</a></p><p>Make a GET request to <a href="https://yourapp.azurewebsites.net/api/upload-url?blobName=sample.txt">https://yourapp.azurewebsites.net/api/upload-url?blobName=sample.txt</a> to get the upload URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FKepl2kpfgxAkByZUBxgQg.png" /></figure><p>Make a POST request to <a href="https://yourapp.azurewebsites.net/api/upload">https://yourapp.azurewebsites.net/api/upload</a> to upload a .txt blob.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kbldd4AQ4rlsgaRx1pE6Sg.png" /></figure><p>Check the uploaded file inside the Azure Blob Storage container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nnBaUTr_aYP5c7FU5Jq5LA.png" /></figure><p>By following these steps, you’ve successfully deployed a Node.js app to Azure App Service with managed identity and blob storage integration.</p><p>Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46170c94b8e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Azure Blob Trigger Functions(.NET)]]></title>
            <link>https://medium.com/@dileepa.mabulage/deploying-azure-blob-trigger-functions-net-2bc7635446eb?source=rss-bae452aa06e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bc7635446eb</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[service-principal]]></category>
            <category><![CDATA[function-app]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Dileepa Mabulage]]></dc:creator>
            <pubDate>Wed, 12 Mar 2025 04:19:18 GMT</pubDate>
            <atom:updated>2025-03-12T04:19:18.679Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploying Azure Blob Trigger Functions(.NET) Using Zip Push via GitHub Actions and Service Principal Authentication</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ke4xjPzZmP8aWqtk8DMStQ.jpeg" /></figure><p>In this article, we’ll walk through deploying an Azure Function App with a .NET Blob Trigger using Zip Push deployment via GitHub Actions. Additionally, we’ll cover how to authenticate using a Service Principal to streamline the deployment process, ensuring a secure and automated CI/CD pipeline for your Azure Functions. By the end of this guide, you’ll be able to deploy your functions to Azure with minimal manual intervention efficiently.</p><blockquote><strong>It is the default deployment (Zip deployment) technology in the </strong><a href="https://learn.microsoft.com/en-us/azure/azure-functions/consumption-plan"><strong>Consumption</strong></a><strong>, </strong><a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-premium-plan"><strong>Elastic Premium</strong></a><strong>, and </strong><a href="https://learn.microsoft.com/en-us/azure/azure-functions/dedicated-plan"><strong>Dedicated (App Service)</strong></a><strong> hosting plans. The </strong><a href="https://learn.microsoft.com/en-us/azure/azure-functions/flex-consumption-plan"><strong>Flex Consumption</strong></a><strong> plan does not support zip deployment.</strong></blockquote><p><a href="https://learn.microsoft.com/en-us/azure/azure-functions/deployment-zip-push">Zip push deployment for Azure Functions</a></p><h4>Step 1: Provision Azure Resources</h4><p>In this step, we’ll create an <strong>Azure Function App</strong> using the <strong>Consumption Plan</strong>, a <strong>Storage Account</strong> and an <strong>Application Insights</strong> instance for monitoring and log streaming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TAYVma04WCXwqG0Dcs7qtw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*xhvtRQ9JxWRNq2A69aQfrw.png" /></figure><p>In this setup, we’re using <strong>.NET</strong> as the runtime stack with <strong>version 8 (Isolated)</strong> on <strong>Linux</strong>.</p><p>After configuring these settings, click <strong>Next: Storage &gt;</strong>, then proceed to <strong>Review + Create</strong>.</p><p>This will automatically create the <strong>Function App, Storage Account,</strong> and an <strong>Application Insights</strong> instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*IOjk3Pq3QeJ_mBeucfDxoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CQGvsrwiIYmDsJ_huvZMZQ.png" /></figure><h4>Step 2: Create a Service Principle</h4><p>Navigate to the <strong>App Registrations</strong> section and select <strong>New Registration</strong>.</p><p>Enter a <strong>name</strong>, select <strong>Single Tenant</strong>, and create the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*KA-FT58D_yfxZDaApp5E8g.png" /></figure><p>Inside the app, go to <strong>Certificates &amp; Secrets</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*6fDccuAlHBAt0dnX3x-biA.png" /></figure><p>Create a new <strong>client secret</strong>, providing a <strong>name</strong> and <strong>expiration time</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E-Nun4SxprgF4EtTYwE6mw.png" /></figure><p>Copy the <strong>secret value</strong> and store it securely for later use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cpwpMV-P-1O2BWo0sC1EKA.png" /></figure><h4>Step 3: Attach Service Principle to Resource Group</h4><p>Navigate to the <strong>Role Assignments</strong> section of the <strong>Resource Group</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*Ub1utQpLwXOJ0lWdXvOojg.png" /></figure><p>Select the <strong>Contributor</strong> role from the <strong>privileged administrator roles</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*wTvtN3cSDPQkTNrlkm8dTg.png" /></figure><p>Choose <strong>Service Principal</strong> and add the <strong>App Registration</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*ScbWcFj7rqMTjUprFeJhOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k65uUQABImEh8KSgzbEuQQ.png" /></figure><p>Select and assign.</p><h4>Step 4: Create a Function App</h4><p><a href="https://github.com/dsmabulage/medium-azure-function-app">GitHub - dsmabulage/medium-azure-function-app</a></p><p>Create a Blob Trigger Function App using the <strong>Visual Studio</strong> template and push it to <strong>GitHub.</strong></p><p><a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-storage-blob-triggered-function">Create a function in Azure triggered by Blob storage</a></p><h4>Step 5: Resource Configuration</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KiGhKLle7jE-Hbhw6wFHHw.png" /></figure><p>This GitHub sample shows the blob path as <strong>test/{name}</strong>, which means this function triggers when the blob is uploaded to the <strong>test </strong>container. For that, we need to create a container inside the Storage account.</p><p>The function listens for changes in the <strong>test</strong> container of the Azure Storage account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yOKjMhBA4c0k3IPZhdX1CA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*LvHW3F35UYR4dDcyTUrBLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*etzWxjoUDLSenAumCVK2WQ.png" /></figure><p><strong>Connection String (</strong><strong>CONN_STRING)</strong></p><ul><li>The Connection parameter uses <strong>&quot;CONN_STRING&quot;</strong>, a <strong>placeholder</strong> for the actual storage account connection string.</li><li>This value must be <strong>added as an environment variable</strong> in the <strong>Function App settings</strong> under <strong>Application Configuration</strong>.</li><li>After updating the env variables, <strong>restart </strong>the function app.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xP-2bE9Nvq3lKh_dj7bb4g.png" /></figure><p>You can get this storage account connection string under the access keys of the storage account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VA0bkyheFzQ5W1mcoethvQ.png" /></figure><p>Add the connection string to the env variables of the function app.</p><p>Update this env variable in the function app and restart it.</p><p>Add yourself as <strong>Storage Blob Data Owner</strong> in the storage account. Otherwise, you won’t be able to upload the blobs into the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*5KGEhivhAyDzA9Zoq43naw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*VJ8_Y2jscT-6ajdYfttI-g.png" /></figure><p>Select your Azure account and assign the role.</p><h4>Step 6: GitHub Configuration</h4><p>According to the action configuration, you must add this repository secret to the GitHub repository. You can find this in the repository settings section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V6ga_WV6Ad7L6Nc00C1geA.png" /></figure><p>To authenticate and interact with Azure services, set up the following environment variables in your GitHub Action.</p><ol><li><strong>AZURE_CLIENT_ID</strong> → Retrieve this from the <strong>App Registration Overview</strong> section in <strong>Azure AD</strong>.</li><li><strong>AZURE_CLIENT_SECRET</strong> → Use the <strong>previously copied</strong> client secret from <strong>Certificates &amp; Secrets</strong> in the App Registration.</li><li><strong>AZURE_SUBSCRIPTION_ID</strong> → Find this in the <strong>Azure Portal</strong> under <strong>Subscriptions</strong>.</li><li><strong>AZURE_TENANT_ID</strong> → Get this from the <strong>App Registration Overview</strong> section.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k7HbPJdpxxksWw-GZXnMAQ.png" /></figure><ul><li><strong>AZURE_FUNCTIONAPP_NAME</strong> → Name of the <strong>Azure Function App</strong> (e.g., mediumfuncapp).</li><li><strong>AZURE_RESOURCE_GROUP</strong> → Name of the <strong>Resource Group</strong> where the Function App is deployed.</li></ul><h4>Step 7: Add YML File</h4><p>File Path in GitHub Repository:📂 <strong>.github/workflows/azure-functions-app-dotnet.yml</strong></p><pre>name: Deploy DotNet project to Azure Function App<br><br>on:<br>  push:<br>    branches: [&#39;main&#39;]<br><br>env:<br>  AZURE_FUNCTIONAPP_NAME: ${{ vars.AZURE_FUNCTIONAPP_NAME }}<br>  AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}<br>  AZURE_FUNCTIONAPP_PACKAGE_PATH: &#39;FunctionApp1&#39;<br>  DOTNET_VERSION: &#39;8.0.x&#39;<br>  AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}<br>  AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}<br>  AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}<br>  AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}<br><br>jobs:<br>  build-and-deploy:<br>    runs-on: ubuntu-latest<br>    environment: dev<br>    steps:<br>      - name: &#39;Checkout GitHub Action&#39;<br>        uses: actions/checkout@v4<br><br>      - name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment<br>        uses: actions/setup-dotnet@v4<br>        with:<br>          dotnet-version: ${{ env.DOTNET_VERSION }}<br><br>      - name: &#39;Resolve Project Dependencies Using Dotnet&#39;<br>        shell: bash<br>        run: |<br>          pushd &#39;./${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}&#39;<br>          dotnet build --configuration Release --output ./output<br>          popd<br><br>      - name: &#39;Upload Artifact&#39;<br>        uses: actions/upload-artifact@v4<br>        with:<br>          include-hidden-files: true<br>          name: &#39;FunctionApp1&#39;<br>          path: ${{ github.workspace }}/${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output/<br><br>      - name: &#39;Zip the Function App&#39;<br>        run: |<br>          pushd &#39;${{ github.workspace }}/${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output&#39;<br>          zip -r FunctionApp1.zip .<br>          popd<br><br>      - name: Azure login<br>        uses: azure/login@v2<br>        with:<br>          creds: &#39;{&quot;clientId&quot;:&quot;${{ env.AZURE_CLIENT_ID }}&quot;,&quot;clientSecret&quot;:&quot;${{ env.AZURE_CLIENT_SECRET }}&quot;,&quot;subscriptionId&quot;:&quot;${{ env.AZURE_SUBSCRIPTION_ID }}&quot;,&quot;tenantId&quot;:&quot;${{ env.AZURE_TENANT_ID }}&quot;}&#39;<br><br>      - name: &#39;Verify ZIP File Before Deployment&#39;<br>        run: ls -lh ${{ github.workspace }}/${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output<br><br>      - name: &#39;Deploy Function App&#39;<br>        run: |<br>          az functionapp config appsettings set \<br>            --name ${{ env.AZURE_FUNCTIONAPP_NAME }} \<br>            --resource-group ${{ env.AZURE_RESOURCE_GROUP }} \<br>            --settings SCM_DO_BUILD_DURING_DEPLOYMENT=true<br>            <br>          az functionapp deployment source config-zip \<br>            --resource-group ${{ env.AZURE_RESOURCE_GROUP }} \<br>            --name ${{ env.AZURE_FUNCTIONAPP_NAME }} \<br>            --src ${{ github.workspace }}/${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output/FunctionApp1.zip        <br><br><br>          az functionapp restart --name ${{ env.AZURE_FUNCTIONAPP_NAME }} \<br>            --resource-group ${{ env.AZURE_RESOURCE_GROUP }}</pre><p>This <strong>GitHub Actions workflow</strong> automates the deployment of an <strong>Azure Function App</strong> when changes are pushed to the main branch.</p><ol><li><strong>Checkout Code</strong> → Retrieves the latest code from GitHub.</li><li><strong>Setup .NET Environment</strong> → Installs .NET <strong>8.0.x</strong> for building the project.</li><li><strong>Build the Project</strong> → Compiles the function app in <strong>Release mode</strong>.</li><li><strong>Zip the Function App</strong> → Packages the app for deployment.</li><li><strong>Authenticate with Azure</strong> → Log in using <strong>Azure credentials</strong> stored in secrets.</li><li><strong>Deploy to Azure</strong> → Uploads and deploys the function app using <strong>ZIP deployment</strong>.</li></ol><h4>Step 8: Testing</h4><p>Create a commit to main branch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g6xzD7oc8l_y7HS7UUAFSg.png" /></figure><p>Now, you can see under <strong>Actions</strong> in GitHub that the deployment process has started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2elY63ypnwZyWlkwxqiMlA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LO9pWR3ZHwWNt_zvluqwfg.png" /></figure><p>Navigate to the function app and view the deployed function in the overview section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TUWSDASmMdt8aAzyPILA2w.png" /></figure><p>Open the log stream in the function app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QY0cFyIgbXi4hqT4mHk70Q.png" /></figure><p>Open the storage container in another tab and upload a file into the <strong>test </strong>container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m1iDViH5xGEjh7qx_NeTuQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ChGT4CxB76lfV5PbsZFUog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SUvp194KZWGxvVsXPkUeig.png" /></figure><p>Now you can see the logs in the stream confirming that the function app is working.</p><p>Your Azure Function App is being built and deployed automatically — <strong>fast, efficient, and seamless!</strong> 🚀</p><p><a href="https://github.com/dsmabulage/medium-azure-function-app">GitHub - dsmabulage/medium-azure-function-app</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bc7635446eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up HTTPS for a Local NestJS Server Using Caddy]]></title>
            <link>https://medium.com/@dileepa.mabulage/setting-up-https-for-a-local-nestjs-server-using-caddy-5dc7ce4ec317?source=rss-bae452aa06e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5dc7ce4ec317</guid>
            <category><![CDATA[caddy]]></category>
            <category><![CDATA[httpscertificate]]></category>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[caddy-server]]></category>
            <dc:creator><![CDATA[Dileepa Mabulage]]></dc:creator>
            <pubDate>Tue, 11 Feb 2025 07:48:31 GMT</pubDate>
            <atom:updated>2025-02-11T07:48:31.550Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jsR3XFnsO4umWL2kX4RdaA.png" /></figure><p>Need <strong>HTTPS</strong> for your local NestJS development environment? Caddy makes it simple! This guide walks you through setting up <strong>Caddy Server</strong> to automatically enable HTTPS for local development, making testing secure connections, authentication, and API calls easier.</p><blockquote>Caddy is a modern, extensible web server written in Go. It is known for its ease of use, automatic HTTPS, and dynamic configuration via its API. While commonly used as a web server or reverse proxy, Caddy can also serve various applications and long-running processes. It supports multiple configuration formats, including the user-friendly <strong>Caddyfile</strong> and JSON. Caddy is cross-platform and requires no external dependencies, making it a powerful and convenient choice for developers and system administrators.</blockquote><h4>Step 1: Download and Install Caddy</h4><ol><li>Navigate to <a href="https://caddyserver.com/download">Caddy’s official download page</a>.</li><li>Please select the appropriate package for your operating system and download it.</li><li>Follow the installation instructions specific to your OS.</li></ol><h4>Step 2: Verify Installation</h4><p>Once installed, open a terminal or command prompt and run the following command to confirm that Caddy is installed correctly:</p><p>This should return the installed Caddy version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*tr5iA26OKTw70R6HrkcIYw.png" /></figure><h4>Step 3: Set Up VS Code Integration (Optional but Recommended)</h4><p>If using <strong>Visual Studio Code</strong>, install the <strong>Caddyfile Support</strong> extension for improved readability and editing support.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*5Kcci_dMATR-H47CmGcPxA.png" /></figure><h4>Step 4: Create a Caddyfile</h4><p>In the root directory of your project, create a new file named <strong>Caddyfile</strong> (without any file extension).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*nhQPVjgYpSk6izI4s5RGMg.png" /></figure><h4>Step 5: Configure the Caddyfile</h4><p>Open the newly created <strong>Caddyfile</strong> and add the following configuration:</p><pre>https://localhost:3007 {<br>    reverse_proxy localhost:3000<br>    tls internal<br>}</pre><p>This <strong>Caddyfile</strong> configures Caddy as a local application’s reverse proxy. Here’s what each line does:</p><ol><li><strong>https://localhost:3007</strong> → This tells Caddy to listen on port <strong>3007</strong> using HTTPS.</li><li><strong>reverse_proxy localhost:3000</strong> → Requests to https://localhost:3007 are forwarded to <strong>localhost:3000</strong>, where the actual app runs.</li><li><strong>tls internal</strong> → Caddy will automatically generate and use a <strong>self-signed SSL certificate</strong> for local HTTPS.</li></ol><p>🔹 <strong>In simple terms:</strong><br> When you visit https://localhost:3007, Caddy securely forwards your request to localhost:3000, acting as a reverse proxy.</p><p>Why Are We Using localhost:3000 in the Caddyfile?</p><p>The reason we’re using <strong>localhost:3000</strong> is that the application we want to serve is already running on port <strong>3000</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*wL3ajVMqq1NcArlu7AYOmQ.png" /></figure><h3>6. Running the Application and Caddy Server</h3><p>Once the <strong>Caddyfile</strong> is set up correctly, follow these steps to start both your application and Caddy server:</p><h4>1. Start the Application</h4><p>If your application is built with <strong>Nest.js</strong>, it typically runs on <strong>localhost:3000</strong> during development. To start the app, run:</p><pre>npm run start:dev</pre><ul><li>This command will launch the application in <strong>development mode</strong> on port <strong>3000</strong>.</li><li>Ensure your application runs before starting Caddy, as Caddy will make proxy requests.</li></ul><h4>2. Start the Caddy Server</h4><p>Next, open a new terminal window and run:</p><pre>caddy run</pre><ul><li>This starts the <strong>Caddy server</strong>, which will listen on <a href="https://localhost:3007/"><strong>https://localhost:3007</strong></a> as per our <strong>Caddyfile</strong> configuration.</li><li>Caddy will act as a reverse proxy, forwarding traffic from <strong>port 3007</strong> to <strong>port 3000</strong>, where your app runs.</li></ul><h4>3. Access the Application via HTTPS</h4><p>Now, open your browser and navigate to:</p><pre>https://localhost:3007</pre><p>Since Caddy handles <strong>TLS internally</strong>, your application will be served securely over <strong>HTTPS</strong>, even in local development.</p><p>Now, you can test your application securely using HTTPS, thanks to <strong>Caddy’s reverse proxy and TLS handling</strong>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5dc7ce4ec317" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step-by-Step Guide: Generating an Access Token and Configuring OAuth in Postman for IFS Cloud]]></title>
            <link>https://medium.com/@dileepa.mabulage/step-by-step-guide-generating-an-access-token-and-configuring-oauth-in-postman-for-ifs-cloud-eec02e156f6a?source=rss-bae452aa06e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/eec02e156f6a</guid>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[oauth-token]]></category>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[oauth2-provider]]></category>
            <dc:creator><![CDATA[Dileepa Mabulage]]></dc:creator>
            <pubDate>Tue, 11 Feb 2025 05:40:28 GMT</pubDate>
            <atom:updated>2025-02-11T05:40:28.237Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZRoikxE_yLFtN710Y4KdbA.png" /></figure><p>IFS Cloud uses OAuth 2.0 for secure authentication and API access. Integrating IFS Cloud with Postman requires you to generate an access token and configure OAuth properly. This guide walks you through setting up OAuth in Postman, obtaining a token, and making authenticated API requests to IFS Cloud.</p><p>In this guide, we’ll walk through the process of:<br>✅ Creating an <strong>IAM Client</strong><br>✅ Finding the <strong>Authentication &amp; Token URLs</strong><br>✅ Configuring <strong>OAuth 2.0 in Postman</strong><br>✅ Generating and using an <strong>Access Token</strong></p><h3>1. Create an IAM Client</h3><p>Open <strong>IFS Cloud</strong> and search for <strong>IAM Client</strong> in the navigation pane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*5lCwmxNbhJqZHF6ov9rdfQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xCyOaQuY2zgksA0nhlyXHw.png" /></figure><p>Fill in the details for the new client</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y29K4Hz93b-xIy9sBrrkcQ.png" /></figure><p>Add redirect URI — <a href="https://oauth.pstmn.io/v1/callback">https://oauth.pstmn.io/v1/callback</a></p><p>(This is required for Postman to handle the OAuth flow.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RGdTChz_SjZmGbIl2v5zXA.png" /></figure><p>Click <strong>Create Client</strong> and view the newly created entry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q4iGpOL9C1ZMkmoV1Z_ZcA.png" /></figure><p>Navigate to the IAM Client Details page and select the created client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LDbcIGkYltpN8smqJBL5lw.png" /></figure><p>Copy Client ID and Secret — you’ll need these in Postman.</p><h3>2. Find Authentication and Token URLs</h3><p>Navigate to API Explorer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*zBV58AtLQsIyPzKzfMM2bg.png" /></figure><p>Select Any Projection and select the API Doc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*jhmTzcQQVQWVxwdwQ3mGyg.png" /></figure><p>Scroll down to find the <strong>OpenID Connect URL</strong> and open it in a new tab</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MjcUkLmL__BAXwjUAh8eiA.png" /></figure><p>From the JSON response, copy the following values:</p><ul><li><strong>authorization_endpoint</strong> (Used for authentication)</li><li><strong>token_endpoint</strong> (Used to get the access token)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*72SbQLol05fN1EVcL4h_Fg.png" /></figure><h3>3. Configure Postman</h3><p>Open <strong>Postman</strong> and create a <strong>new collection</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*6uYSLkhNLYTsCTCsGVqxdA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*LBzcSNTz466QR_qTI7A3Yw.png" /></figure><ul><li>Go to the <strong>Authorization</strong> tab.</li><li>Set the <strong>Auth Type</strong> to <strong>OAuth 2.0</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*28oHP_gX5kEpOsOSOeHctA.png" /></figure><p>Scroll down and click <strong>Edit Token Configuration</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*JDqsywZpCm4o6vulg_GMjQ.png" /></figure><p>Fill in the following details:</p><ul><li><strong>Token Name:</strong> Choose a name for easy reference.</li><li><strong>Grant Type:</strong> Authorization Code</li><li><strong>Callback URL:</strong> Select <strong>Authorize using the browser</strong></li><li><strong>Auth URL:</strong> Paste the authorization_endpoint copied earlier.</li><li><strong>Access Token URL:</strong> Paste the token_endpoint copied earlier.</li><li><strong>Client ID:</strong> Enter the <strong>Client ID</strong> from the IAM Client.</li><li><strong>Client Secret:</strong> Enter the <strong>Client Secret</strong> from the IAM Client.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*s5tOxperT5DHmqHdp0Cm0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*tsyk1Ajq3HfmE7FISAHWhw.png" /></figure><h3>4. Generate Token</h3><p>Scroll down and click <strong>Get New Access Token</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*OuKxBRpL_qBjMbpqcnSDZA.png" /></figure><ul><li>A new browser window will open, prompting you to <strong>sign in</strong>.</li><li>If prompted, allow popups in your browser.</li><li>After successful login, Postman will retrieve and display your <strong>Access Token</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*b36pew8OMvE-4DmgOM-RTA.png" /></figure><ol><li>Use this token in your API requests by adding it to the <strong>Authorization</strong> header:</li></ol><pre>Authorization: Bearer &lt;access_token&gt;</pre><p>Now you can authenticate and interact with IFS Cloud APIs using <strong>OAuth 2.0 in Postman</strong>! 🎉</p><p>💡 <strong>Pro Tip:</strong> Since access tokens expire, you may need to refresh or regenerate them periodically.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eec02e156f6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Effortlessly Import MSSQL Database to Azure: A Step-by-Step Guide with SqlPackage]]></title>
            <link>https://medium.com/@dileepa.mabulage/effortlessly-import-mssql-database-to-azure-a-step-by-step-guide-with-sqlpackage-31d2a969130e?source=rss-bae452aa06e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/31d2a969130e</guid>
            <category><![CDATA[import]]></category>
            <category><![CDATA[sqlpackage]]></category>
            <category><![CDATA[ms-sql-server]]></category>
            <category><![CDATA[import-export]]></category>
            <category><![CDATA[mssql]]></category>
            <dc:creator><![CDATA[Dileepa Mabulage]]></dc:creator>
            <pubDate>Sat, 21 Dec 2024 11:59:52 GMT</pubDate>
            <atom:updated>2024-12-21T11:59:52.914Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h5oBKuhb5GdL9n2kRhzkjg.png" /></figure><p>Importing SQL databases to Azure can seem complex, but tools like SqlPackage make the process straightforward. This guide shows you how to use a simple batch script to automate importing a .bacpac file into an existing Azure SQL Database, saving time and ensuring accuracy.</p><ol><li>Export the current Database to .bacpac file.</li></ol><p>Connect to the SQL server using <a href="https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver16">SQL server management studio</a>.</p><p>Select the Database and select Export Data-Tier Application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t21Y-sJI-4wwgg8rmuehaw.png" /></figure><p>Follow the steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ZhusreRHXambQ66WltNVw.png" /></figure><p>Set the file name and local directory path</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4ZPEQ-1NSDyb5izhkDdQw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aL-zbAnJ6ZozB-udECAWiw.png" /></figure><p>This will take some time….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cw-Kq5b6U5gGn4CzL3LOpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*smO55rjAEfxR4sLQLQNC7g.png" /></figure><p>2. Download and Install <a href="https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16">SqlPackage</a></p><p>You can use dotnet tool installation or .msi installation for Windows.</p><p>3. Import the .bacpac file to the new Database.</p><pre># Define variables<br>$SqlPackagePath = &quot;C:\Program Files\Microsoft SQL Server\160\DAC\bin\SqlPackage.exe&quot;<br>$BacpacFilePath = &quot;C:\test.bacpac&quot;<br>$TargetServer = &quot;test.database.windows.net&quot;<br>$TargetDatabase = &quot;test&quot;<br>$Username = &quot;test&quot;<br>$Password = &quot;test&quot;<br><br># Run the SqlPackage command<br>&amp; $SqlPackagePath /a:Import /sf:$BacpacFilePath /tsn:$TargetServer /tdn:$TargetDatabase /tu:$Username /tp:$Password</pre><p>Place this script in the same folder as the database export file, and incorporate the file’s location into the PowerShell script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hl9k9RpRLz-DVDgz4kvVww.png" /></figure><p>Update the variables with the appropriate values. The target database should be the new database where you plan to import the data from the .bacpac file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iJ2chH3UHv6fYNjeConXTg.png" /></figure><ul><li>Open PowerShell and navigate to the script’s location.</li><li>Run the script using:</li></ul><p>./deploy.ps1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lC9YQmnNDupNde51V8X_9w.png" /></figure><p>4. Verify the Import<br>Query the new database to confirm the presence of the imported data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cmMOk9bMUNkPmPCABHvVDw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31d2a969130e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VNET Data Gateway for Microsoft Power BI and SQL Server.]]></title>
            <link>https://medium.com/@dileepa.mabulage/vnet-data-gateway-for-microsoft-power-bi-and-sql-server-cdb46f1f5d80?source=rss-bae452aa06e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdb46f1f5d80</guid>
            <category><![CDATA[power-bi-step-by-step]]></category>
            <category><![CDATA[data-gateway]]></category>
            <category><![CDATA[power-bi-desktop]]></category>
            <category><![CDATA[vnet-integration]]></category>
            <category><![CDATA[sql-server]]></category>
            <dc:creator><![CDATA[Dileepa Mabulage]]></dc:creator>
            <pubDate>Thu, 22 Aug 2024 04:28:23 GMT</pubDate>
            <atom:updated>2024-08-22T04:29:07.856Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/984/0*krZZ853AuvCDt-5F" /><figcaption><a href="https://www.linkedin.com/pulse/issues-connection-between-power-bi-azure-sql-database-pachiappan-m/">https://www.linkedin.com/pulse/issues-connection-between-power-bi-azure-sql-database-pachiappan-m/</a></figcaption></figure><p>A <strong>Virtual Network (VNet) Data Gateway</strong> for Microsoft Power BI and SQL Server allows secure communication between Power BI and on-premises or virtual network data sources within Azure. This gateway acts as a bridge, enabling Power BI to connect to SQL Server databases without exposing them to the public internet.</p><p>#PowerBI #Azure #SQLServer #VNet #DataGateway #CloudSecurity #DataAnalytics #BI #MicrosoftAzure #SecureData #TechSolution #BusinessIntelligence #CloudComputing #AzureSQL #PowerBIDesktop</p><h3>1. Create PowerBI VNet Data Gateway</h3><p><a href="https://learn.microsoft.com/en-us/data-integration/vnet/create-data-gateways">Create virtual network (VNet) data gateways</a></p><p>Ensure you create the VNet within regions supported for VNet Data Gateways to avoid errors during creation, such as the <em>PowerBI Communication Error</em>.</p><pre>error occurred: Unable to create virtual network data gateway. PowerBI Communication Error</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*tnfQJttEusUmXuBlnRa8jA.png" /></figure><p>Additionally, ensure that you are assigned the <em>Network Contributor</em> role for the Azure subscription.</p><p>Navigate to that subscription in the left panel, select Access Control (IAM), and click View My Access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*3km4niehKBerHXFKDNdwkA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*11B3Pjj8G06q6JEUkFkgAw.png" /></figure><p>After creating the VNet Data Gateway</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2VQdTRhJz2a0ZCZvEGtzkQ.png" /></figure><h3>2. Create SQL Server</h3><p><a href="https://learn.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?view=azuresql&amp;tabs=azure-portal">Create a single database - Azure SQL Database</a></p><p>Next, create an Azure SQL Server. Ensure the VNet and SQL Server are in the same region to avoid connectivity issues.</p><h3>3. Populate SQL DB with Sample Data</h3><p><a href="https://learn.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?view=azuresql&amp;tabs=azure-portal#query-the-database">Create a single database - Azure SQL Database</a></p><p>Once your SQL Server is set up, populate the database with sample data. Follow these steps:</p><ol><li>In the Azure portal, navigate to the Query Editor.</li><li>Run the following SQL script to create a table and insert sample records:</li></ol><pre>-- Create the &#39;users&#39; table<br>CREATE TABLE users (<br>    id INT PRIMARY KEY IDENTITY(1,1),<br>    firstname NVARCHAR(50) NOT NULL,<br>    lastname NVARCHAR(50) NOT NULL<br>);<br><br>-- Insert 5 records into the &#39;users&#39; table<br>INSERT INTO users (firstname, lastname)<br>VALUES <br>    (&#39;John&#39;, &#39;Doe&#39;),<br>    (&#39;Jane&#39;, &#39;Smith&#39;),<br>    (&#39;Michael&#39;, &#39;Johnson&#39;),<br>    (&#39;Emily&#39;, &#39;Davis&#39;),<br>    (&#39;David&#39;, &#39;Brown&#39;);<br><br>-- Select the data to verify insertion<br>SELECT * FROM users;</pre><p>Now, you should see the inserted data displayed in the Query Editor.</p><h3>4. Create a Sample Report from PowerBI Desktop</h3><h4>Prerequisites</h4><ol><li><a href="https://www.microsoft.com/en-us/power-platform/products/power-bi/desktop">PowerBI Desktop</a></li><li>PowerBI Premium Licence</li></ol><h4>Steps</h4><ol><li>Open the PowerBI desktop and select SQL server as a data source.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*57LUzXs8Ho7DWjnxYluAcQ.png" /></figure><p>2. Add DB credentials and login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8mxyesDEBwA51RBEVud9dw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YO4RkMnyXflo9_slWLNWUA.png" /></figure><p>If you encounter an unauthorized access error due to an IP issue, add that IP address as an allowed firewall rule in SQL Server.</p><p>3. Select the user table and load the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tq-tSxs0zIe1nimeX0xqxA.png" /></figure><p>4. Select the table from the visualizations tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*QHoG0eTt53tzJfowOMFegg.png" /></figure><p>5. In the Data pane, choose a table and select firstname and lastname fields to view the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RbHLXIpZ4UUuY1eRUooKMA.png" /></figure><h3>5. Publish Report</h3><ol><li>Navigate to the <a href="https://app.powerbi.com/">PowerBI Service</a>.</li><li>Select workspaces from the left panel and create new workspace.</li><li>Add name, and under advanced settings, select licence mode as Premium per-user</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*DObAlpbf3UgMrAtzBouwsA.png" /></figure><p>4. Save the created report in PowerBI Desktop to your preferred location.</p><p>5. Publish the report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nF11-rFPN-hUbo2X8jiG3g.png" /></figure><p>6. Select the workspace created previously and publish the report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*GrgEVfFdnyWHSq-44JHsCw.png" /></figure><p>7. Once published, the report will be visible under the chosen workspace in Power BI Service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G5y5K8wzotzlB6DB6sh9jA.png" /></figure><h3>6. Create SubNet for SQL Server</h3><ol><li>Navigate to the VNet and create a new subnet sqlserver and save.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*kqQwQXiuKY9qMYzQjGwPRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qOeXgkxXHMVT3VoE2nDrTQ.png" /></figure><h3>7. Connect SQL Server to the SubNet</h3><ol><li>Navigate to the SQL Server and the Networking tab.</li><li>Select public access and selected networks.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*p--k4u0ModLkAcfAwJRDWQ.png" /></figure><p>3. Scroll down to virtual networks and add the Vnet rule.</p><p>Select the subnet that was created previously for the SQL server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*kcvYZjboLfTeGQwNQWrukw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*uIdpq93wF32x77BWz8vNCQ.png" /></figure><h3>8. Configure VNet in PowerBI Service</h3><ol><li>Select the semantic model from the published report and click on settings.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n2SV53XcFH0YO7a7XzGACw.png" /></figure><p>2. Under gateway and cloud connections, enable Use an On-premises or VNet data gateway and select the data gateway from the dropdown menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f01rIpGaKpfgERfyD_hWmA.png" /></figure><p>3. Apply.</p><h3>9. Test the VNet Data Gateway</h3><ol><li>Navigate to the DB query editor and insert another user.</li></ol><pre>-- Insert one record into the &#39;users&#39; table<br>INSERT INTO users (firstname, lastname)<br>VALUES (&#39;Check&#39;, &#39;User&#39;);<br><br>-- Select the data to verify the insertion<br>SELECT * FROM users;</pre><p>2. Remove all the firewall rules in the SQL server Networking section, which shows your client&#39;s IPv4 address and save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RJUXKtvbVOC5h_Otc29vOQ.png" /></figure><p>Navigate to the Query Editor again to confirm you no longer have access to the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4txS0IwFR4DqG4ok9CDfgQ.png" /></figure><p>3. In the PowerBI service, the same semantic model is used; click refresh now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*srm9Vn4EHBBy-WZk0bFDWw.png" /></figure><p>Otherwise, click the semantic report, and in the navbar, there is the refresh option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*NBO_0xk_-sEV2Qhk_VQfsQ.png" /></figure><p>4. Click the report above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KA6ewBRfzDMgrz8awOBiyw.png" /></figure><p>See, the newly added user is being populated in the table.</p><p>Following these steps, we’ve successfully built a secure solution that connects Power BI to SQL Server using a Virtual Network (VNet) Data Gateway. This setup ensures data remains protected within your Azure environment while enabling seamless access and reporting through Power BI.</p><p>Thank you…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdb46f1f5d80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a NestJS App to Azure App Service Using Azure DevOps (Classic Editor)]]></title>
            <link>https://medium.com/@dileepa.mabulage/deploying-a-nestjs-app-to-azure-app-service-using-azure-devops-classic-editor-bb3dd60fd381?source=rss-bae452aa06e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb3dd60fd381</guid>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[app-service]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[nestjs-tutorial]]></category>
            <dc:creator><![CDATA[Dileepa Mabulage]]></dc:creator>
            <pubDate>Thu, 27 Jun 2024 06:18:02 GMT</pubDate>
            <atom:updated>2024-06-27T06:18:02.989Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WXXyEjJCf2tZrYCB08W0TQ.png" /></figure><p>This will refer to the same NodeJs deployment with a few additional changes.</p><p>For the NodeJS deployment, refer to this <a href="https://medium.com/@dileepa.mabulage.edu/deploying-a-node-js-app-to-azure-app-service-using-azure-devops-classic-editor-274298445da8">Article</a>.</p><h3>1. Edit Build Pipeline.</h3><p>In the previous Nodejs Build pipeline, add a new agent job before the archive files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6dvYIxilAvvgd9390hUHPw.png" /></figure><p>Search for npm and add that Agent Job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*GOYaRtUhaduYIXP6CrMAmg.png" /></figure><p>Drag that agent job between the npm install and Archive files agent jobs and edit the configurations.</p><p><em>Display Name — npm build</em></p><p><em>Command — Custom</em></p><p><em>Command and arguments — </em><em>run-script build</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DxRRHWDEgABdi-PsJGZnwQ.png" /></figure><h3>2. Edit Release Pipeline</h3><p>In the release pipeline, select stage 1 and add the new startup command as npm run start:prod</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rxpoQGCIVo8AUmh_OJrLnw.png" /></figure><p><a href="https://github.com/dsmabulage/medium-nestjs-app-service-deploy-azure-devops">GitHub Repository</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb3dd60fd381" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Implement Role-Based Access Control(RBAC) Into React Application Using Azure]]></title>
            <link>https://medium.com/@dileepa.mabulage/how-to-implement-role-based-access-control-rbac-into-react-application-using-azure-3be401c24eb6?source=rss-bae452aa06e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3be401c24eb6</guid>
            <category><![CDATA[role-based-access-control]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[rbac]]></category>
            <dc:creator><![CDATA[Dileepa Mabulage]]></dc:creator>
            <pubDate>Wed, 26 Jun 2024 15:10:29 GMT</pubDate>
            <atom:updated>2024-06-26T15:10:29.555Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V6TsI0uerUGnsevZ.jpg" /></figure><h3>1. Create An App Registration</h3><p>In the Azure portal, App registration -&gt; Register an app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*yJYA4nR89ghb2UkwIoUX0A.png" /></figure><p>Add Name, Select Accounts in this organizational directory, and register the app.</p><h3>2. Create App Roles</h3><p>In the navigation blade, select App Roles And create app roles. I will go with the Admin and User app roles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0d710J4UR8deg9L0eA87Wg.png" /></figure><p>Admin Role Creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*wTx4LBOzXrDswiChWKhDiQ.png" /></figure><p>User Role Creation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*0KJcydesrhy4fXqVJAiP8A.png" /></figure><p>You can view the created app roles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*FTsl6bXlMOh4UOwha4Q7hw.png" /></figure><h3>3. Assign Roles To Users</h3><p>Navigate to the Enterprise Application section in the Azure AD. Under all applications, select the app that you created previously. Select Users and Groups from the side navigation blade.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a35iNvzc2s5ZkzJm2FGPDA.png" /></figure><p>Add users, select the user and the role for that user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*eCzjDqNgKwaUHgPu8yqsrA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*S9jrMlgiEC4W37Skmbw58Q.png" /></figure><p>Click Assign.</p><p>You will see the users that assign the roles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2SDG4sNP0zFLIRc7-cKe0Q.png" /></figure><h3>4. Add Authentication In-App Registration</h3><p>In-App Registration, Navigate to the Authentication tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ETaK0iMVKN0MGF8oQ9yA-Q.png" /></figure><p>Add Platform, Single-Page Application and add. http://localhost:3000 As the redirect URL. (You have to add your localhost react app URL)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*OIAC-LFcUm4vJKi-IAQqwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*AVYKIDcckpVGSk7EyT6y-Q.png" /></figure><h3>5. Configure the React App</h3><p>clone the repository and replace the values in the config/msalConfig.ts with the values from the app registration overview page client Id and the tenat Id .</p><p>.env</p><pre>VITE_CLIENT_ID=xxxxxxxxxxxxxxxxxxx<br>VITE_TENANT_ID=xxxxxxxxxxxxxxx</pre><h3>6. Testing</h3><p>In the dashboard page, click login; after that, you will see the roles assigned to the user. Store it in local storage or context and do the <a href="https://dev.to/iamandrewluca/private-route-in-react-router-v6-lg5">private route</a> in the react-router-dom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*Gq8jrDWD-PnFnSfD0dRPuw.png" /></figure><p><a href="https://github.com/dsmabulage/medium-azure-ad-rbac">GitHub Repository</a></p><p>Thank You.</p><p>Sources.</p><p><a href="https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-react-samples/typescript-sample">microsoft-authentication-library-for-js/samples/msal-react-samples/typescript-sample at dev · AzureAD/microsoft-authentication-library-for-js</a></p><p><a href="https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-react">https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-react</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3be401c24eb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Use Organization Office 365 Account as an SMTP Service (NodeJs Sample)]]></title>
            <link>https://medium.com/@dileepa.mabulage/how-to-use-organization-office-365-account-as-an-smtp-service-nodejs-sample-b962148845ee?source=rss-bae452aa06e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/b962148845ee</guid>
            <category><![CDATA[nodemailer]]></category>
            <category><![CDATA[smtp]]></category>
            <category><![CDATA[office-365]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Dileepa Mabulage]]></dc:creator>
            <pubDate>Wed, 26 Jun 2024 15:08:39 GMT</pubDate>
            <atom:updated>2024-06-26T15:08:39.046Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*46UFlkOaPDe4lEFM.png" /></figure><p>In <a href="https://admin.microsoft.com/">Azure Admin Portal</a>, navigate to the email account and assign the microsoft 365 business basic Licence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*dskxBI23oNWwionwTttFjw.png" /></figure><h3>NodeJs</h3><p>In .env file</p><pre>USER_EMAIL=&lt;user email in the Azure ad&gt; eg:- user@company.com<br>USER_PASSWORD=&lt;user account password&gt;</pre><pre>const express = require(&#39;express&#39;);<br>const nodemailer = require(&#39;nodemailer&#39;);<br><br>const app = express();<br>const PORT = process.env.PORT || 3000;<br>const userEmail = process.env.USER_EMAIL<br>const userPassword = process.env.USER_PASSWORD<br><br>app.get(&#39;/&#39;, async (req, res) =&gt; {<br>  const transporter = nodemailer.createTransport({<br>    host: &#39;smtp.office365.com&#39;,<br>    port: 587,<br>    secure: false,<br>    auth: {<br>      user: userEmail,<br>      pass: userPassword,<br>    },<br>    tls: {<br>      rejectUnauthorized: true,<br>    },<br>  });<br><br>  const mailOptions = {<br>    from: userEmail,<br>    to: &#39;another-account@company.com&#39;,<br>    subject: &#39;Test Email&#39;,<br>    text: &#39;This is a test email from Nodejs App&#39;,<br>  };<br><br>  try {<br>    const info = await transporter.sendMail(mailOptions);<br>    console.log(&#39;Email sent: &#39; + info.response);<br>    res.send(&#39;Email sent successfully&#39;);<br>  } catch (error) {<br>    console.log(&#39;Error occurred: &#39; + error);<br>    res.send(&#39;Error occurred while sending email&#39;);<br>  }<br>});<br><br>app.listen(PORT, () =&gt; {<br>  console.log(`Server is running on port ${PORT}`);<br>});</pre><p>You can also use these same credentials when creating API connections for logic apps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b962148845ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>