<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: YogitaKadam14</title>
    <description>The latest articles on Forem by YogitaKadam14 (@yogitakadam14).</description>
    <link>https://forem.com/yogitakadam14</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F776170%2Fcc1fde8b-6fa4-4a4c-bf0c-a2b3450a9f6b.jpg</url>
      <title>Forem: YogitaKadam14</title>
      <link>https://forem.com/yogitakadam14</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/yogitakadam14"/>
    <language>en</language>
    <item>
      <title>🚀 CI/CD Pipelines &amp; YAML Best Practices</title>
      <dc:creator>YogitaKadam14</dc:creator>
      <pubDate>Fri, 13 Feb 2026 14:11:37 +0000</pubDate>
      <link>https://forem.com/yogitakadam14/cicd-pipelines-yaml-best-practices-1de7</link>
      <guid>https://forem.com/yogitakadam14/cicd-pipelines-yaml-best-practices-1de7</guid>
      <description>&lt;p&gt;&lt;strong&gt;Lessons Learned from Real-World Azure + Bitbucket Deployments&lt;/strong&gt;&lt;br&gt;
Designing CI/CD pipelines feels straightforward…&lt;br&gt;
until your builds become inconsistent, deployments start failing, and environment management turns messy.&lt;/p&gt;

&lt;p&gt;After working extensively with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bitbucket Pipelines&lt;/li&gt;
&lt;li&gt;Azure App Service (Linux)&lt;/li&gt;
&lt;li&gt;Node.js backends&lt;/li&gt;
&lt;li&gt;React / Angular frontends&lt;/li&gt;
&lt;li&gt;Monorepos&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…I’ve gathered practical lessons that saved hours of debugging and prevented production issues.&lt;/p&gt;

&lt;p&gt;This post focuses on real-world patterns, not textbook theory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧱 1️⃣ Deterministic Builds Are Non-Negotiable&lt;/strong&gt;&lt;br&gt;
One of the most common CI/CD mistakes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;❌ Why this is risky in pipelines&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can modify package-lock.json&lt;/li&gt;
&lt;li&gt;Non-reproducible builds&lt;/li&gt;
&lt;li&gt;“Works locally, fails in CI”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;✅ Best Practice&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm ci
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For deployment bundles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm ci --omit=dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✔ Benefits&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enforces lockfile&lt;/li&gt;
&lt;li&gt;Faster installs&lt;/li&gt;
&lt;li&gt;Reproducible builds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;📦 2️⃣ Don’t Ship Dev Dependencies to Production&lt;/strong&gt;&lt;br&gt;
Early pipelines often bundle everything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node_modules/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;❌ Consequences&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bloated artifacts&lt;/li&gt;
&lt;li&gt;Slower deployments&lt;/li&gt;
&lt;li&gt;Higher memory usage&lt;/li&gt;
&lt;li&gt;Cold start delays&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;✅ Better Strategy&lt;/strong&gt;&lt;br&gt;
Reinstall only production dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm ci --omit=dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✔ Result&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Smaller ZIP&lt;/li&gt;
&lt;li&gt;Faster startup&lt;/li&gt;
&lt;li&gt;Cleaner runtime&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;⚛ 3️⃣ Frontend Configuration: The Silent Problem&lt;/strong&gt;&lt;br&gt;
For React / Angular / Vite apps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Environment variables become hardcoded into JS bundles&lt;br&gt;
&lt;strong&gt;❌ Symptoms&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Azure App Settings changes do nothing&lt;/li&gt;
&lt;li&gt;Rebuild required per environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;✅ Scalable Solution → Runtime Config&lt;/strong&gt;&lt;br&gt;
Create an env.js file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__env&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;API_URL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://api.example.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Load before the app bundle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"/env.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Access in React:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;apiUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__env&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;API_URL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✔ Advantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build once, deploy anywhere&lt;/li&gt;
&lt;li&gt;No rebuild per environment&lt;/li&gt;
&lt;li&gt;Easy config updates&lt;/li&gt;
&lt;li&gt;Customer-specific deployments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🔐 4️⃣ Frontend Secrets? They Don’t Exist.&lt;/strong&gt;&lt;br&gt;
Important reality:&lt;br&gt;
❌ You cannot truly hide secrets in frontend apps&lt;br&gt;
Anything delivered to the browser can be inspected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🚨 Never expose&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API keys&lt;/li&gt;
&lt;li&gt;DB credentials&lt;/li&gt;
&lt;li&gt;Client secrets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;✅ Correct Architecture&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Frontend → Backend → Third-party
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Secrets live only in:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backend&lt;/li&gt;
&lt;li&gt;Azure App Settings&lt;/li&gt;
&lt;li&gt;Key Vault&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🌱 5️⃣ One YAML vs Multiple YAML Files&lt;/strong&gt;&lt;br&gt;
As projects grow:&lt;br&gt;
👉 Should we create separate YAML per branch?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;❌ Why this becomes painful&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pipeline drift&lt;/li&gt;
&lt;li&gt;Duplication&lt;/li&gt;
&lt;li&gt;Maintenance overhead&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;✅ Recommended&lt;/strong&gt;&lt;br&gt;
Use one common YAML with branch logic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;dev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;main&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🔁 6️⃣ Repeated Steps? Use YAML Anchors&lt;/strong&gt;&lt;br&gt;
Avoid copy-paste pipelines.&lt;br&gt;
&lt;strong&gt;✅ Use Anchors&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;definitions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nl"&gt;&amp;amp;build_step&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reuse:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;*build_step&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✔ Benefits&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cleaner YAML&lt;/li&gt;
&lt;li&gt;Easier updates&lt;/li&gt;
&lt;li&gt;Less duplication&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;☁️ 7️⃣ Azure Deployment: Pipe vs CLI&lt;/strong&gt;&lt;br&gt;
Two popular approaches:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ Atlassian Azure Pipe (Preferred)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;pipe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;atlassian/azure-web-apps-deploy&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✔ Why it’s great&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimal scripting&lt;/li&gt;
&lt;li&gt;Cleaner pipelines&lt;/li&gt;
&lt;li&gt;Fewer failure points&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🧰 Azure CLI (Use When Needed)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slot swaps&lt;/li&gt;
&lt;li&gt;Infra provisioning&lt;/li&gt;
&lt;li&gt;Advanced automation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;❌ Avoid installing CLI manually&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl InstallAzureCLIDeb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Use Azure CLI image instead&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mcr.microsoft.com/azure-cli&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🚨 8️⃣ Dangerous Commands to Avoid (Unless Justified)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;az resource update ... allow=true&lt;/span&gt;
&lt;span class="s"&gt;PORT=8080 hardcoding&lt;/span&gt;
&lt;span class="s"&gt;sleep 30 hacks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Only acceptable when&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Legacy constraints&lt;/li&gt;
&lt;li&gt;Debugging scenarios&lt;/li&gt;
&lt;li&gt;Platform requirements&lt;/li&gt;
&lt;li&gt;Always document the reason.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🔐 9️⃣ Repository vs Deployment Variables&lt;/strong&gt;&lt;br&gt;
Misusing variables causes many CI/CD issues.&lt;br&gt;
✅ Repository Variables&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shared config&lt;/li&gt;
&lt;li&gt;Build constants&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NODE_VERSION&lt;/li&gt;
&lt;li&gt;LINT_FLAGS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;✅ Deployment Variables&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Use for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Environment-specific values&lt;/li&gt;
&lt;li&gt;Secrets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API_URL&lt;/li&gt;
&lt;li&gt;Azure credentials&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🏆 Final Takeaways&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✅ Pipelines must be deterministic&lt;br&gt;
✅ Use npm ci, not npm install&lt;br&gt;
✅ Install prod dependencies only&lt;br&gt;
✅ Artifacts should be environment-agnostic&lt;br&gt;
✅ Never store secrets in frontend&lt;br&gt;
✅ Prefer runtime config for SPAs&lt;br&gt;
✅ Use one YAML with branch logic&lt;br&gt;
✅ Use YAML anchors to avoid duplication&lt;br&gt;
✅ Prefer deployment pipes over complex scripts&lt;br&gt;
✅ Use Azure CLI only when flexibility required&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🏆 Conclusion: CI/CD is Easy… Until It Isn’t&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Setting up a pipeline that “works” is not difficult.&lt;/p&gt;

&lt;p&gt;But designing a pipeline that is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deterministic&lt;/li&gt;
&lt;li&gt;Environment-agnostic&lt;/li&gt;
&lt;li&gt;Secure&lt;/li&gt;
&lt;li&gt;Scalable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Easy to maintain&lt;br&gt;
👉 requires deliberate engineering decisions.&lt;/p&gt;

&lt;p&gt;Small shortcuts like:&lt;br&gt;
❌ Using npm install&lt;br&gt;
❌ Embedding secrets in frontend&lt;br&gt;
❌ Duplicating YAML per branch&lt;br&gt;
❌ Shipping devDependencies&lt;br&gt;
…may work initially but create serious friction as projects scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔥 Final Thought&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your CI/CD pipeline is not just automation…&lt;br&gt;
👉 It is part of your system architecture.&lt;br&gt;
Treat it with the same care as application code.&lt;/p&gt;

</description>
      <category>cicd</category>
      <category>azure</category>
      <category>bitbucket</category>
      <category>yam</category>
    </item>
    <item>
      <title>Deploying a Node.js Application on Azure Using Bitbucket CI/CD Pipelines</title>
      <dc:creator>YogitaKadam14</dc:creator>
      <pubDate>Fri, 28 Feb 2025 08:52:05 +0000</pubDate>
      <link>https://forem.com/yogitakadam14/deploying-a-nodejs-application-on-azure-using-bitbucket-cicd-pipelines-483o</link>
      <guid>https://forem.com/yogitakadam14/deploying-a-nodejs-application-on-azure-using-bitbucket-cicd-pipelines-483o</guid>
      <description>&lt;p&gt;In today's fast-paced software world, delivering updates quickly and reliably is crucial. Traditional deployment methods were slow, error-prone, and inconsistent, leading to frustrated developers and unhappy users. This is where CI/CD (Continuous Integration &amp;amp; Continuous Deployment) comes in a game changing approach that automates testing and deployment, ensuring smooth and efficient software delivery.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why We Use CI/CD?&lt;/strong&gt;&lt;br&gt;
Traditional software deployment had challenges like:&lt;br&gt;
❌ Manual Errors – Deployments were prone to mistakes.&lt;br&gt;
⏳ Slow Releases – Weeks/months to deliver updates.&lt;br&gt;
🔄 Inconsistent Environments – "Works on my machine" issues.&lt;br&gt;
🚧 Difficult Rollbacks – Fixing bugs took too long.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How CI/CD Solves These Issues&lt;/strong&gt;&lt;br&gt;
✅ Automation – Code is tested &amp;amp; deployed without manual intervention.&lt;br&gt;
⚡ Speed – Continuous updates, no waiting for big releases.&lt;br&gt;
🔍 Consistency – Same environment for dev, test &amp;amp; production.&lt;br&gt;
🔄 Quick Rollbacks – Issues? Revert to the last stable version easily.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-Life Example&lt;/strong&gt;&lt;br&gt;
Imagine an E-commerce App during Black Friday. A bug in the checkout process could mean huge revenue loss. With CI/CD:&lt;br&gt;
🚀 Developers push a quick fix → ✅ Automated tests run → 🌍 Fix is deployed instantly without downtime → 💰 Sales continue smoothly!&lt;/p&gt;

&lt;p&gt;In this blog, we'll explore how to implement a CI/CD pipeline using Bitbucket, automating deployments to Azure App Service to ensure seamless and hassle-free software delivery. 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What We'll Cover in This Blog&lt;/strong&gt;&lt;br&gt;
In this guide, we’ll walk through setting up a CI/CD pipeline using Bitbucket Pipelines to deploy a Node.js application to Azure App Service.&lt;/p&gt;

&lt;p&gt;🔹 Configuring the Azure Environment&lt;br&gt;
🔹 Setting Up Bitbucket Pipelines&lt;br&gt;
🔹 Deploying a Node.js App Automatically&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An Azure App Service has already been created.&lt;/li&gt;
&lt;li&gt;Your Node.js application is hosted in a Bitbucket repository.&lt;/li&gt;
&lt;li&gt;Basic knowledge of Azure and Bitbucket Pipelines.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Configure the Azure Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Enable SCM Basic Auth Publishing Credentials&lt;/strong&gt;&lt;br&gt;
Go to your Azure App Service settings and enable SCM Basic Auth Publishing Credentials.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frdafstp0snposnve4shl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frdafstp0snposnve4shl.png" alt="App Service setting" width="800" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Create an Azure App Registration:&lt;/strong&gt;&lt;br&gt;
To securely deploy your app, create an Azure App Registration to generate credentials for authentication.&lt;/p&gt;

&lt;p&gt;🔹 Navigate to Azure Portal and search for App registrations.&lt;br&gt;
🔹 Click New Registration and provide a name for your app.&lt;br&gt;
🔹 Generate a Client Secret under "Certificates &amp;amp; Secrets".&lt;br&gt;
🔹 Note down the Application (Client) ID, Directory (Tenant) ID, and Client Secret Value for later use.&lt;/p&gt;

&lt;p&gt;Refer to the snapshots below for details:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs5aevau3gp1prv412pxz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs5aevau3gp1prv412pxz.png" alt="App Registration" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzahvszkok7eo4n83ht1t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzahvszkok7eo4n83ht1t.png" alt="App Registration Client Secret" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Assign the App registration as a contributor to the App Service.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffn111672s2gmibh1z7hm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffn111672s2gmibh1z7hm.png" alt="IAM Setting" width="800" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Set Up Bitbucket Pipelines&lt;/strong&gt;&lt;br&gt;
Create a bitbucket-pipelines.yml File: Add the following YAML configuration file to the root of your Bitbucket repository. This file defines the CI/CD pipeline for your Node.js app&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Bitbucket Pipeline for deploying a Node.js app to Azure App Service.&lt;/span&gt;
&lt;span class="c1"&gt;# This workflow runs build and security scans before deployment.&lt;/span&gt;
&lt;span class="c1"&gt;# Environment variables: AZURE_APP_ID, AZURE_PASSWORD, AZURE_TENANT_ID, AZURE_RESOURCE_GROUP, AZURE_APP_NAME.&lt;/span&gt;
&lt;span class="c1"&gt;# For advanced cases, please, follow examples from the pipe's README https://bitbucket.org/microsoft/azure-web-apps-deploy/src/1.0.3/README.md&lt;/span&gt;


&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;node:18&lt;/span&gt;
&lt;span class="na"&gt;pipelines&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;parallel&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install&lt;/span&gt;
          &lt;span class="na"&gt;caches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;node&lt;/span&gt;
          &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;npm install&lt;/span&gt;
  &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;master&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;parallel&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build&lt;/span&gt;
            &lt;span class="na"&gt;caches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;node&lt;/span&gt;
            &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;            
              &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;npm run build&lt;/span&gt;              
              &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;apt update &amp;amp;&amp;amp; apt install zip&lt;/span&gt;
            &lt;span class="c1"&gt;# Create a zip file with the build output&lt;/span&gt;
              &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;zip -r app-$BITBUCKET_BUILD_NUMBER.zip build package.json package-lock.json&lt;/span&gt;
            &lt;span class="na"&gt;artifacts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*.zip"&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Security Scan&lt;/span&gt;
            &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="c1"&gt;# Run a security scan for sensitive data.&lt;/span&gt;
              &lt;span class="c1"&gt;# See more security tools at https://bitbucket.org/product/features/pipelines/integrations?&amp;amp;category=security&lt;/span&gt;
              &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;pipe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;atlassian/git-secrets-scan:0.5.1&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy to Production&lt;/span&gt;          
          &lt;span class="na"&gt;deployment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Production&lt;/span&gt;
          &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;pipe&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;atlassian/azure-web-apps-deploy:1.0.1&lt;/span&gt;
              &lt;span class="na"&gt;variables&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;AZURE_APP_ID&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$AZURE_APP_ID&lt;/span&gt;
                &lt;span class="na"&gt;AZURE_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$AZURE_PASSWORD&lt;/span&gt;
                &lt;span class="na"&gt;AZURE_TENANT_ID&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$AZURE_TENANT_ID&lt;/span&gt;
                &lt;span class="na"&gt;AZURE_RESOURCE_GROUP&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$AZURE_RESOURCE_GROUP&lt;/span&gt;
                &lt;span class="na"&gt;AZURE_APP_NAME&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$AZURE_APP_NAME&lt;/span&gt;
                &lt;span class="na"&gt;ZIP_FILE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app-$BITBUCKET_BUILD_NUMBER.zip&lt;/span&gt;        
                &lt;span class="na"&gt;DEBUG&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;true'&lt;/span&gt;    

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📝 Note:&lt;br&gt;
DEBUG: 'true' enables detailed error logging to help diagnose deployment issues. Once your pipeline is stable and running smoothly, you can remove this variable to reduce unnecessary log output.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Update the package.json File&lt;/strong&gt;&lt;br&gt;
Ensure your package.json includes the correct build script and paths:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TestAPI"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"This is Test API"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"main"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"server.ts"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node build/dist/server.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"echo &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;Error: no test specified&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt; &amp;amp;&amp;amp; exit 1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"tsc -p ."&lt;/span&gt;&lt;span class="w"&gt; 
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Configure Environment Variables in Bitbucket&lt;/strong&gt;&lt;br&gt;
To securely pass Azure credentials to Bitbucket Pipelines:&lt;/p&gt;

&lt;p&gt;🔹 Go to your Bitbucket repository.&lt;br&gt;
🔹 Navigate to Repository settings → Repository variables.&lt;br&gt;
🔹 Add the following variables:   &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AZURE_APP_ID: Application (Client) ID&lt;/li&gt;
&lt;li&gt;AZURE_PASSWORD: Client Secret Value&lt;/li&gt;
&lt;li&gt;AZURE_TENANT_ID: Directory (Tenant) ID.&lt;/li&gt;
&lt;li&gt;AZURE_RESOURCE_GROUP: Name of the Azure resource group&lt;/li&gt;
&lt;li&gt;AZURE_APP_NAME: Name of your Azure App Service&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Commit and Push Changes&lt;/strong&gt;&lt;br&gt;
Once you've configured everything, commit and push your code to Bitbucket.&lt;br&gt;
Bitbucket Pipelines will automatically trigger the build and deploy process, ensuring your application is deployed to Azure App Service without manual intervention.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
By following these steps, you've successfully set up a &lt;strong&gt;fully automated CI/CD pipeline&lt;/strong&gt; for deploying a Node.js application from Bitbucket to Azure App Service.&lt;/p&gt;

&lt;p&gt;✅ Automated Builds &amp;amp; Deployments&lt;br&gt;
✅ Secure Authentication with Azure&lt;br&gt;
✅ Seamless Integration &amp;amp; Fast Releases&lt;/p&gt;

&lt;p&gt;With this setup, your application deployment becomes faster, more reliable, and hassle-free! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next Steps&lt;/strong&gt;🚀&lt;br&gt;
Now that your CI/CD pipeline is up and running, here’s how you can further enhance it:&lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;Add Unit &amp;amp; Integration Tests&lt;/strong&gt; – Improve code quality by running automated tests before deployment.&lt;br&gt;
🔹 &lt;strong&gt;Implement Staging &amp;amp; Production Environments&lt;/strong&gt; – Deploy to a staging environment first, test, and then promote to production.&lt;br&gt;
🔹 &lt;strong&gt;Enable Deployment Monitoring &amp;amp; Alerts&lt;/strong&gt; – Use Azure Monitor or Application Insights to track deployments and get notified of failures.&lt;br&gt;
🔹 &lt;strong&gt;Optimize Performance &amp;amp; Security&lt;/strong&gt; – Perform performance profiling and security audits to keep your app fast and secure.&lt;br&gt;
🔹 &lt;strong&gt;Containerize Your App with Docker&lt;/strong&gt; – Consider deploying using Docker and Kubernetes for scalability.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Practical Approaches to Accurate Project Estimation</title>
      <dc:creator>YogitaKadam14</dc:creator>
      <pubDate>Fri, 13 Dec 2024 08:52:58 +0000</pubDate>
      <link>https://forem.com/yogitakadam14/practical-approaches-to-accurate-project-estimation-377d</link>
      <guid>https://forem.com/yogitakadam14/practical-approaches-to-accurate-project-estimation-377d</guid>
      <description>&lt;p&gt;Accurate project estimation is essential for project planning, resource allocation, and managing stakeholder expectations. Yet, developers often encounter challenges when estimating tasks due to overlooked factors or assumptions like, "This is a small change—it won’t take long." This mindset often leads to underestimated timelines, unexpected roadblocks, and missed deadlines.&lt;/p&gt;

&lt;p&gt;For instance, a developer might estimate 2 hours for a minor UI change but forget about essential tasks like code reviews, testing, deployment, or addressing dependencies. These oversights can quickly snowball, affecting the overall project timeline.&lt;/p&gt;

&lt;p&gt;This guide aims to help developers, product managers, and stakeholders anticipate common pitfalls and adopt practical strategies for more accurate and realistic project estimates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Requirement Understanding:&lt;/strong&gt; Start with a Detailed Requirement Breakdown&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Start by breaking down project requirements into smaller, manageable components. Understanding every detail will make it easier to assign accurate estimates to each part.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; For a user authentication feature, you could separate tasks into backend API, frontend form, validation, error handling, and testing.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; The more granular you get with tasks, the easier it becomes to estimate each one accurately.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Project Design and Flow Diagrams:&lt;/strong&gt; Visualize Task Sequences and Dependencies&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Design diagrams and flow diagrams help illustrate the project’s structure, reveal dependencies, and map out task flows. Visualizing complex projects aids in spotting interdependencies and sequences, making estimation more accurate.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; For a user authentication system, a flow diagram could illustrate steps from login to logout, while a design diagram can highlight backend services, frontend components, and database interactions.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Tools like Lucidchart or Draw.io are useful for creating diagrams that clarify project design and execution flow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Research and Learning Time&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Include time for learning new technologies, tools, or languages involved in the project. Research might be needed for specific modules or third-party libraries.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; If using a new database like MongoDB, add time for understanding basic operations, querying, and best practices.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Include a small buffer for unanticipated learning challenges, particularly with less familiar tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Task Dependencies:&lt;/strong&gt; Identify and Allocate Time Accordingly&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Recognize dependencies between tasks to avoid project delays or bottlenecks. Sometimes, development tasks depend on others being completed first, which can affect timelines.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; Frontend development of a feature may depend on backend API readiness. If backend work takes two weeks, add buffer time for frontend work to avoid delays.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Clearly mapping out dependencies helps with task sequencing and ensures time is allocated for dependencies properly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Testing and Debugging Time&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Testing is essential but often underestimated. Factor in time for unit testing, integration testing, and debugging.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; If building a feature takes two days, consider adding another day for testing and bug fixes.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Bugs are inevitable; overestimate debugging time rather than assuming a bug-free process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Include Code Reviews and Team Meetings&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Account for the time spent on code reviews and team discussions, which are critical for quality and alignment.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; A 30-minute code review may stretch if significant feedback requires follow-up changes.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Add 1-2 hours per task for review and consider meeting times based on team structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Third-Party Integrations&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Integrations, particularly with third-party tools, can have hidden complexities. Estimate additional time for integration setup, testing, and error handling.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; If integrating with a payment gateway, consider time for API documentation review, sandbox testing, and error-handling implementation.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Look up integration documentation and forums in advance to gauge potential issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Responsive Design Adjustments&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Allocate time for testing and adjusting layouts and components across various devices and screen sizes.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; For a new web interface, add time for adjusting and testing on different mobile and tablet views.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Responsive design typically requires additional CSS adjustments and testing, so be proactive with time allocation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Plan for Unexpected Issues (Buffer Time)&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Use a buffer to handle unforeseen issues that might arise during development or testing.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; If a task is estimated to take 10 hours, add a 1-2 hour buffer for unexpected challenges.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; A 10-20% buffer based on project complexity is ideal, especially for tasks involving new technologies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. Team Feedback: Review Estimates&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Review estimates with teammates or stakeholders to ensure completeness and identify any missing factors.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; After initial estimation, consult with a senior team member who might identify overlooked dependencies.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Fresh perspectives often reveal hidden challenges or opportunities to refine estimates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. Deployment and Access Management&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Allocate time for deployment configurations, testing, and setting up access control in production environments.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; For production deployment, estimate time for server setup, access control, and verifying that deployment is successful.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Post-deployment checks and multi-environment setups (e.g., QA, staging) can require additional time, so include this in estimates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. Code Repository Setup and Access&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Factor in time for initial repository setup, branching, and access permissions.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; Setting up a new project repository on GitHub might involve branch protections, team permissions, and CI/CD configurations.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Streamlined setup here avoids access issues and supports smoother collaboration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. Documentation&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; Documentation is essential for project continuity and should be included in the estimate.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; After completing a feature, allow time for updating API documentation or user guides.&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Allocate 1-2 hours for documentation per feature to prevent rushed or incomplete documentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14. Estimating Bug Fixes in an Existing Application (Especially When Unfamiliar)&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Approach:&lt;/strong&gt; When working with an unfamiliar codebase, plan carefully to avoid breaking existing functionality. Allocate time for bug investigation, cautious fixes, and regression testing.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt; If fixing a bug in an authentication module, allocate time to trace dependencies and ensure no new issues arise in user profiles or session handling.&lt;br&gt;
&lt;strong&gt;Tips:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Analyze the Bug Thoroughly:&lt;/strong&gt; Start by replicating the bug in a safe environment. Analyze logs or error traces to understand the root cause.&lt;br&gt;
Study Code Dependencies: Trace related services or components. Note dependencies to avoid breaking other areas.&lt;br&gt;
&lt;strong&gt;Estimate Investigation Time:&lt;/strong&gt; Time for code exploration might exceed actual fix time in an unfamiliar codebase. Estimate 1-2 hours based on complexity.&lt;br&gt;
Incremental Fixes and Testing: Apply fixes incrementally, testing each change. Prioritize minimal effective fixes to reduce unintended side effects.&lt;br&gt;
&lt;strong&gt;Buffer for Rollbacks:&lt;/strong&gt; Sometimes, initial fixes may need rollbacks or adjustments. Plan time for testing and refinement across all affected modules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick Reference:&lt;/strong&gt; Estimation Checklist&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Requirement Understanding&lt;/li&gt;
&lt;li&gt;Project Design and Flow Diagrams&lt;/li&gt;
&lt;li&gt;Research and Learning&lt;/li&gt;
&lt;li&gt;Task Dependencies&lt;/li&gt;
&lt;li&gt;Testing and Debugging&lt;/li&gt;
&lt;li&gt;Code Reviews and Meetings&lt;/li&gt;
&lt;li&gt;Third-Party Integrations&lt;/li&gt;
&lt;li&gt;Responsive Design Adjustments&lt;/li&gt;
&lt;li&gt;Buffer for Unexpected Issues&lt;/li&gt;
&lt;li&gt;Team Feedback&lt;/li&gt;
&lt;li&gt;Deployment and Access Management&lt;/li&gt;
&lt;li&gt;Code Repository Setup and Access&lt;/li&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;li&gt;Estimating Bug Fixes in an Existing Application&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Key Takeaways for Developers&lt;/strong&gt; &lt;br&gt;
Estimation is about preparation, not perfection. Use this checklist to anticipate potential challenges and cover all necessary tasks—from detailed breakdowns to bug fixes in legacy code.&lt;/p&gt;

&lt;p&gt;By taking the time to understand requirements, account for dependencies, and include buffers for unexpected issues, developers can deliver on time while minimizing stress.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; Start small, learn from experience, and refine your process.&lt;/p&gt;

</description>
      <category>estimation</category>
      <category>freshers</category>
      <category>development</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>5 Steps to Secure Passwordless Azure SQL Connections Using Node.js</title>
      <dc:creator>YogitaKadam14</dc:creator>
      <pubDate>Mon, 12 Aug 2024 11:31:16 +0000</pubDate>
      <link>https://forem.com/yogitakadam14/5-steps-to-secure-passwordless-azure-sql-connections-using-nodejs-59ki</link>
      <guid>https://forem.com/yogitakadam14/5-steps-to-secure-passwordless-azure-sql-connections-using-nodejs-59ki</guid>
      <description>&lt;p&gt;Passwordless Authentication for Azure SQL Using Microsoft Entra ID&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
In today’s digital landscape, traditional password-based security systems are increasingly vulnerable to cyberattacks and data breaches. Passwords often serve as the weakest link in cybersecurity, exposing users to risks such as phishing, credential stuffing, and brute force attacks. To address these vulnerabilities, organizations are adopting passwordless authentication. This modern approach eliminates the need for passwords, significantly enhancing security by removing common password-related threats. Additionally, it simplifies the user experience by removing the need to remember complex passwords, thereby reducing the administrative burden of password management and improving overall system efficiency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Azure SQL Authentication Options&lt;/u&gt;&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Traditional Methods:&lt;/strong&gt;&lt;br&gt;
Typically, we connect to Azure SQL using usernames and passwords. While these can be stored securely, they are still vulnerable to phishing, hacking, and other cyberattacks.&lt;br&gt;
&lt;strong&gt;Passwordless Authentication:&lt;/strong&gt;&lt;br&gt;
Azure SQL allows passwordless connections through Microsoft Entra ID (formerly Azure Active Directory), reducing the reliance on passwords and leveraging secure tokens and identities instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Benefits of Passwordless Authentication&lt;/u&gt;:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Security:&lt;/strong&gt; Reduces the risk of phishing, brute force attacks, and credential stuffing by eliminating passwords.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved Compliance:&lt;/strong&gt; Meets the requirements of various security regulations, such as GDPR and CCPA, which emphasize reducing password-related vulnerabilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streamlined User Experience:&lt;/strong&gt; Simplifies the login process, making it easier for users to access resources without managing complex passwords.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Setting Up Microsoft Entra ID for Passwordless Access:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Microsoft Entra ID?:&lt;/strong&gt; It is Microsoft's cloud-based identity and access management service. It controls access to resources like Azure SQL, ensuring that only authorized users can connect.&lt;br&gt;
&lt;strong&gt;How to Set It Up:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1.&lt;/strong&gt; Ensure your Azure account is linked with Microsoft Entra ID.&lt;br&gt;
&lt;strong&gt;2.&lt;/strong&gt; Set up the necessary roles and permissions in Microsoft Entra ID to allow access to your Azure SQL databases.&lt;br&gt;
&lt;strong&gt;3.&lt;/strong&gt; Enable passwordless authentication methods in  Microsoft Entra ID, such as multi-factor authentication (MFA).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Prerequisites:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Before setting up passwordless authentication, ensure you have:&lt;/li&gt;
&lt;li&gt;An Azure subscription with the appropriate permissions.&lt;/li&gt;
&lt;li&gt;A linked Microsoft Entra ID account.&lt;/li&gt;
&lt;li&gt;Managed identities enabled for your Azure services (if required).&lt;/li&gt;
&lt;li&gt;Visual Studio Code and the necessary Azure extensions installed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;High-level steps are used to connect to Azure SQL Database using passwordless connections&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Create an Azure Group &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Add Members&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3oigbgwtfkfd326o8t78.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3oigbgwtfkfd326o8t78.png" alt="AddMembersInGroup" width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add Owners&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnewtmkvrj1clocd0n6jc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnewtmkvrj1clocd0n6jc.png" alt="AddOwnersInGroup" width="800" height="528"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt;Configured SQL Server for authentication with Microsoft Entra ID&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsgate6ta4cccvtvykj68.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsgate6ta4cccvtvykj68.png" alt="MicrosoftEntraIDSetting" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enable the option:&lt;/strong&gt; Allow Azure services and resources to access this selected server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4jz00cidaex1g0fu00xo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4jz00cidaex1g0fu00xo.png" alt="NetworkSetting" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Configure System Identity for the Backend App Service&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvss70c7syv8zga2p8xth.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvss70c7syv8zga2p8xth.png" alt="SystemIdentity" width="796" height="888"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Create a SQL database User for the Identity and Assign Roles&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="nv"&gt;"system-assigned-identity-name"&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;EXTERNAL&lt;/span&gt; &lt;span class="n"&gt;PROVIDER&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;ROLE&lt;/span&gt; &lt;span class="n"&gt;db_owner&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="n"&gt;MEMBER&lt;/span&gt; &lt;span class="nv"&gt;"system-assigned-identity-name"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
&lt;span class="c1"&gt;---OR&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;ROLE&lt;/span&gt; &lt;span class="n"&gt;db_datareader&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="n"&gt;MEMBER&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;system&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;assigned&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;identity&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;ROLE&lt;/span&gt; &lt;span class="n"&gt;db_datawriter&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="n"&gt;MEMBER&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;system&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;assigned&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;identity&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;ROLE&lt;/span&gt; &lt;span class="n"&gt;db_ddladmin&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="n"&gt;MEMBER&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;system&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;assigned&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;identity&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Configure Your Database Connection for Passwordless Authentication&lt;br&gt;
In Visual Studio Code, create a config.js file. Add the following mssql configuration code to enable passwordless authentication for your connection to Azure SQL Database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Set &lt;code&gt;DB_AUTH_TYPE&lt;/code&gt; to &lt;code&gt;'azure-active-directory-default'&lt;/code&gt; for passwordless authentication.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;
&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="c1"&gt;// Load environment variables from .env file&lt;/span&gt;
&lt;span class="kr"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;development&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;dbConnectionString&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;dialect&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mssql&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DB_HOST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;//Update   &lt;/span&gt;
            &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DB_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;//Update&lt;/span&gt;
            &lt;span class="na"&gt;dialectOptions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;authentication&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DB_AUTH_TYPE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;//Update&lt;/span&gt;
                &lt;span class="p"&gt;},&lt;/span&gt;
                &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="na"&gt;encrypt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;trustServerCertificate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="c1"&gt;//Update &lt;/span&gt;
                    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;requestTimeout&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SEQUELIZE_TIMEOUT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;max&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;min&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;acquire&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SEQUELIZE_TIMEOUT&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                &lt;span class="na"&gt;idle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the code to connect to Azure SQL Database using sequelize in Node.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;use strict&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;path&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Sequelize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sequelize&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;basename&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;basename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__filename&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;env&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;development&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/../config/config&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;

&lt;span class="kr"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sequelizeConnect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

                &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dbConnectionString&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dbConnectionString&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

                &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sequelize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;Sequelize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="c1"&gt;//passing the dbConnectionConfig to the sequelize instance&lt;/span&gt;
                &lt;span class="nx"&gt;sequelize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Sequelize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dbConnectionString&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;
                    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readdirSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;basename&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.ts&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                    &lt;span class="p"&gt;});&lt;/span&gt;

                &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;))(&lt;/span&gt;&lt;span class="nx"&gt;sequelize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Sequelize&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DataTypes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                    &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;

                &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;modelName&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;modelName&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;associate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;modelName&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;associate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                    &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="p"&gt;});&lt;/span&gt;

                &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sequelize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sequelize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Sequelize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Sequelize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The tedious package, which is used for connecting to SQL Server from Node.js, supports passwordless authentication starting from version 13.0.0. This version introduced support for Azure Active Directory (AAD) authentication, which includes passwordless authentication methods.&lt;/p&gt;

&lt;p&gt;To use passwordless authentication with tedious, make sure you have at least version 13.0.0 or later installed. You can update your tedious package by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;tedious@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Running Locally:&lt;/strong&gt; Setup with Visual Studio Code&lt;br&gt;
&lt;a href="https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli" rel="noopener noreferrer"&gt;Install Azure CLI on Windows&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftrevsldonen5bu7akub3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftrevsldonen5bu7akub3.png" alt="DownloadAzureCLI" width="698" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install Azure Account Extension&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffd1p2uiodxpubk9dbpf7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffd1p2uiodxpubk9dbpf7.png" alt="AzureAccountExtension" width="800" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run the Command to log In&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;u&gt;Security Best Practices:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conditional Access Policies:&lt;/strong&gt; Implement conditional access policies in Microsoft Entra ID to add another layer of security, ensuring that only trusted devices and users can access your Azure SQL databases.&lt;br&gt;
&lt;strong&gt;Enable Logging and Monitoring:&lt;/strong&gt; Regularly monitor authentication events in Microsoft Entra ID to detect unusual activity and respond promptly to potential security threats. Additionally, enable auditing in Azure SQL Database to track access and changes effectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Use Cases:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;High Compliance Industries:&lt;/strong&gt;&lt;br&gt;
Passwordless authentication is particularly beneficial in industries with strict compliance requirements, such as finance, healthcare, and government, where data protection is paramount. In these sectors, reducing the reliance on passwords helps minimize risks associated with data breaches and ensures compliance with regulatory standards.&lt;br&gt;
&lt;strong&gt;Large User Bases:&lt;/strong&gt;&lt;br&gt;
Applications with large user bases can benefit from the streamlined login process. For instance, if an employee leaves the organization, the need to change and update passwords across multiple systems is eliminated, reducing administrative overhead and minimizing disruptions. This reduces support requests related to password resetting and enhances overall user satisfaction and security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Troubleshooting Tips:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Issues:&lt;/strong&gt; If you encounter connection failures, ensure that the correct roles and permissions are set in Microsoft Entra ID. Also, verify that the managed identity is properly configured and that the SQL Server settings allow Azure services to connect.&lt;br&gt;
&lt;strong&gt;Diagnostic Tools:&lt;/strong&gt; Utilize Azure's diagnostic tools, such as SQL Server logs and Azure Monitor, to troubleshoot and resolve issues quickly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Further Reading and Resources:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/entra/fundamentals/" rel="noopener noreferrer"&gt;Microsoft Entra ID Documentation&lt;/a&gt;&lt;br&gt;
&lt;a href="https://learn.microsoft.com/en-us/azure/azure-sql/database/security-best-practice?view=azuresql" rel="noopener noreferrer"&gt;Azure SQL Database Security Best Practices&lt;/a&gt;&lt;br&gt;
&lt;a href="https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/tutorial-windows-managed-identities-vm-access?pivots=identity-windows-mi-vm-access-data-lake" rel="noopener noreferrer"&gt;Using Managed Identities with Azure SQL&lt;/a&gt;&lt;br&gt;
&lt;a href="https://learn.microsoft.com/en-us/azure/developer/intro/passwordless-overview" rel="noopener noreferrer"&gt;Passwordless connections for Azure services&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Conclusion:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Passwordless authentication with Microsoft Entra ID offers a robust, secure, and user-friendly way to connect to Azure SQL databases. By following the steps outlined above and adhering to best practices, you can significantly reduce security risks and improve the efficiency of your system.&lt;/p&gt;

&lt;p&gt;Start implementing passwordless authentication today to enhance your system’s security and streamline user access.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>node</category>
      <category>tedious</category>
      <category>sqlserver</category>
    </item>
    <item>
      <title>Shared Access Signature</title>
      <dc:creator>YogitaKadam14</dc:creator>
      <pubDate>Mon, 29 Apr 2024 08:07:01 +0000</pubDate>
      <link>https://forem.com/yogitakadam14/shared-access-signature-1gl4</link>
      <guid>https://forem.com/yogitakadam14/shared-access-signature-1gl4</guid>
      <description>&lt;p&gt;A shared access signature (SAS) is a URI that grants restricted access rights to Azure Storage resources. You can provide a shared access signature to clients that you want to grant delegate access to certain storage account resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of shared access signatures:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;User delegation SAS&lt;/strong&gt;: A user delegation SAS applies to Blob storage only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service SAS&lt;/strong&gt;: A service SAS delegates access to a resource in many of the Azure Storage services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Account SAS&lt;/strong&gt;: An account SAS delegates access to resources in one or more of the storage services.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;When to implement shared access signatures&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A common scenario where SAS is useful is a service where users read and write their data to their storage account.&lt;/li&gt;
&lt;li&gt;When you copy a blob to another blob that resides in a different storage account, you must use an SAS to authorize access to the source blob. You can optionally use a SAS to authorize access to the destination blob as well.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How shared access signatures work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SAS provides temporary, limited access to Azure Storage resources by granting specific permissions and duration through a generated token, ensuring secure and controlled sharing without exposing sensitive credentials.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Secure Data Sharing&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;br&gt;
A company needs to securely share confidential documents stored in Azure Blob Storage with external partners for a limited time.&lt;/p&gt;

&lt;p&gt;The settings below are configured on Azure Storage to restrict access for anonymous users from accessing the storage directly from the public network without a SAS (Shared Access Signature).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwin2n23227bd6x5zptxm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwin2n23227bd6x5zptxm.png" alt="Azure Storage Setting to not allow public access "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgqudhw85k506fjychexp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgqudhw85k506fjychexp.png" alt="Azure Storage Setting to not allow public access while creation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The most flexible and secure way to use a service or account SAS is to associate the SAS tokens with a stored access policy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node js sample code to generate SAS URI&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;BlobServiceClient&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@azure/storage-blob&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;azureStorage&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;azure-storage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;  &lt;span class="nf"&gt;generateSASURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;         
    &lt;span class="c1"&gt;//read the file name received from the client &lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="na"&gt;blobName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;blobName&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="na"&gt;containerName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;containerName&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="na"&gt;sasUrlExpiryInMinutes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sasUrlExpiryInMinutes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  
      &lt;span class="c1"&gt;//Best practice: create time limits&lt;/span&gt;
      &lt;span class="c1"&gt;//const MINUTES:number = sasUrlExpiryInMinutes;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;NOW&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  
      &lt;span class="c1"&gt;// Best practice: set the start time a little before the current time to &lt;/span&gt;
      &lt;span class="c1"&gt;// make sure any clock issues are avoided    &lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MINUTES_BEFORE_NOW&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;NOW&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;valueOf&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;sasUrlExpiryInMinutes&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MINUTES_AFTER_NOW&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;NOW&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;valueOf&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;sasUrlExpiryInMinutes&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 

      &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;sharedAccessPolicy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;AccessPolicy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;Permissions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;r&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;MINUTES_BEFORE_NOW&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;Expiry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;MINUTES_AFTER_NOWv&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="na"&gt;conStr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;AZURE_STORAGE_CONNECTION_STRING&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;blobService&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="nx"&gt;azureStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createBlobService&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nx"&gt;conStr&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;sasToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;blobService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generateSharedAccessSignature&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;containerName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;blobName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sharedAccessPolicy&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;sasUrl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;blobService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;containerName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;blobName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;sasToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//shared access signature URL&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;blobService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;containerName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;blobName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;//Normal URL   &lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sasUrl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;sasUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;url&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error generating SAS URL, method- GenerateSASURL&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error generating SAS URL, method- GenerateSASURL&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;stack&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;




&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;SAS Configuration:&lt;/strong&gt;&lt;br&gt;
Define a shared access policy object specifying the permissions (Permissions), start time (Start), and expiry time (Expiry) for the SAS token.&lt;br&gt;
&lt;strong&gt;Azure Blob Service Setup:&lt;/strong&gt;&lt;br&gt;
Retrieve the Azure Storage connection string from environment variables.&lt;br&gt;
Create an Azure Blob Service client using the connection string.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foxugsdj8ibfh8xipphfn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foxugsdj8ibfh8xipphfn.png" alt="Azure Storage Connection String "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Generate SAS Token:&lt;/strong&gt;&lt;br&gt;
Generate a shared access signature (SAS) token for the specified container and blob using the shared access policy.&lt;br&gt;
&lt;strong&gt;Generate URLs:&lt;/strong&gt;&lt;br&gt;
Generate URLs for accessing the blob: one with the SAS token appended (sasUrl) and one without (url).&lt;/p&gt;

&lt;p&gt;SAS URL comprises two components: The first part is the URI to the resource you wish to access. The second part is a SAS token, which you've generated to authorize access to that resource.&lt;/p&gt;

&lt;p&gt;You can split the URI from the SAS token within a single URI like this:&lt;br&gt;
&lt;strong&gt;URI&lt;/strong&gt;: &lt;a href="https://medicalrecords.blob.core.windows.net/patient-images/patient-116139-nq8z7f.jpg" rel="noopener noreferrer"&gt;https://medicalrecords.blob.core.windows.net/patient-images/patient-116139-nq8z7f.jpg&lt;/a&gt;?&lt;br&gt;
&lt;strong&gt;SAS token&lt;/strong&gt;: sp=r&amp;amp;st=2020-01-20T11:42:32Z&amp;amp;se=2020-01-20T19:42:32Z&amp;amp;spr=https&amp;amp;sv=2019-02-02&amp;amp;sr=b&amp;amp;sig=SrW1HZ5Nb6MbRzTbXCaPm%2BJiSEn15tC91Y4umMPwVZs%3D&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sp=r&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Controls the access rights. The values can be &lt;code&gt;a&lt;/code&gt; for add, &lt;code&gt;c&lt;/code&gt; for create, &lt;code&gt;d&lt;/code&gt; for delete, &lt;code&gt;l&lt;/code&gt; for list, &lt;code&gt;r&lt;/code&gt; for read, or &lt;code&gt;w&lt;/code&gt; for write. This example is read only. The example &lt;code&gt;sp=acdlrw&lt;/code&gt; grants all the available rights.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;st=2020-01-20T11:42:32Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The date and time when access starts.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;se=2020-01-20T19:42:32Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The date and time when access ends. This example grants eight hours of access.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sv=2019-02-02&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The version of the storage API to use.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sr=b&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The kind of storage being accessed. In this example, b is for blob.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sig=SrW1HZ5Nb6MbRzTbXCaPm%2BJiSEn15tC91Y4umMPwVZs%3D&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The cryptographic signature.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For more details, refer to &lt;a href="https://learn.microsoft.com/en-us/training/modules/implement-shared-access-signatures/" rel="noopener noreferrer"&gt;Implement shared access signatures&lt;br&gt;
&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Top 10 Best Practices for Shared Access Signatures (SAS) in Azure Storage&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Least Privilege:&lt;/strong&gt; Grant only necessary permissions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Short Expiry:&lt;/strong&gt; Set short token expiry times.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Renewal and Rotation:&lt;/strong&gt; Regularly renew and rotate tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restricted Scope:&lt;/strong&gt; Limit tokens to specific resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secure Transmission:&lt;/strong&gt; Transmit tokens securely over HTTPS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitoring and Logging:&lt;/strong&gt; Monitor token usage and log activities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Revocation Mechanism:&lt;/strong&gt; Have a way to revoke tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stored Access Policies:&lt;/strong&gt; Use stored policies for centralized management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token Scope Awareness:&lt;/strong&gt; Educate users about token scope.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regular Security Audits:&lt;/strong&gt; Conduct periodic security audits&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In conclusion, shared access signatures (SAS) in Azure Storage offers controlled access to resources, empowering users to manage permissions effectively. Understanding the different types of SAS and leveraging associated access policies ensures secure data sharing. The provided Node.js sample demonstrates SAS URL generation for secure blob access, enhancing data protection in Azure Storage.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>security</category>
      <category>signature</category>
      <category>shared</category>
    </item>
    <item>
      <title>Exception Handling in Node.js Applications using log4js</title>
      <dc:creator>YogitaKadam14</dc:creator>
      <pubDate>Fri, 02 Jun 2023 04:57:57 +0000</pubDate>
      <link>https://forem.com/yogitakadam14/exception-handling-in-nodejs-applications-using-log4js-37gf</link>
      <guid>https://forem.com/yogitakadam14/exception-handling-in-nodejs-applications-using-log4js-37gf</guid>
      <description>&lt;p&gt;Exception handling plays a crucial role in ensuring the stability and reliability of Node.js applications. By effectively handling exceptions, developers can identify and address errors, improve debugging, and provide a smoother user experience. In this blog post, we will explore how to handle exceptions in a Node.js application using the popular logging library, log4js with customized configurations.&lt;/p&gt;

&lt;p&gt;When logging messages, it is important to easily identify the log level, such as whether it is an error, warning, or information.&lt;/p&gt;

&lt;p&gt;To use the Log4Js package, follow these basic steps:&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;1.Install the package by running the following command:&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;log4js&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can find more information about the Log4js package on the &lt;a href="https://www.npmjs.com/package/log4js" rel="noopener noreferrer"&gt;npmjs.com&lt;/a&gt; website.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;2.Create a new file called logger.ts and add the following code:&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Description: This file contains the logger configuration and custom logger functions&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getLogger&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;configure&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;log4js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;//configure logger&lt;/span&gt;
&lt;span class="c1"&gt;//type of appenders: console, file, dateFile, logLevelFilter, multiFile, stdout, stderr, cluster, log4js&lt;/span&gt;
&lt;span class="c1"&gt;//level of appenders: all, trace, debug, info, warn, error, fatal, mark, off&lt;/span&gt;
&lt;span class="nf"&gt;configure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;appenders&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;          
            &lt;span class="na"&gt;console&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;console&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="na"&gt;categories&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;appenders&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;console&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                &lt;span class="na"&gt;level&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;all&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;//get logger&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;logger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getLogger&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;//custom error logger&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;errorLogger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;responseErrorMessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Function Name: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; \n Message: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;responseErrorMessage&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; \n Stack: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;//custom info logger&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;infoLogger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;infoMessage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Function Name: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; Message: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;infoMessage&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;//custom warning logger&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;warnLogger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;warnMessage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;warn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Function Name: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; Warning: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;warnMessage&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;    

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;errorLogger&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;infoLogger&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;warnLogger&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code sets up a logger configuration and defines three custom logger functions: errorLogger, infoLogger, and warnLogger. Here's a breakdown of the code:&lt;/p&gt;

&lt;p&gt;• The code imports the getLogger and configure functions from the 'log4js' library.&lt;br&gt;
• The configure function is called to set up the logger configuration. In this configuration, a single appender of type "console" is defined&lt;br&gt;
• The logger configuration specifies that all log events should be appended to the console appender.&lt;br&gt;
• The &lt;strong&gt;getLogger&lt;/strong&gt; function is called to retrieve a logger instance&lt;br&gt;
• The &lt;strong&gt;errorLogger&lt;/strong&gt; function takes an &lt;strong&gt;Error object&lt;/strong&gt; and a &lt;strong&gt;functionName&lt;/strong&gt; string as parameters. It logs an error message, including the function name, error message, and stack trace.&lt;br&gt;
• The &lt;strong&gt;infoLogger&lt;/strong&gt; function takes an &lt;strong&gt;infoMessage&lt;/strong&gt; string and a &lt;strong&gt;functionName&lt;/strong&gt; string as parameters. It logs an info message, including the function name and info message.&lt;br&gt;
• The &lt;strong&gt;warnLogger&lt;/strong&gt; function takes a &lt;strong&gt;warnMessage&lt;/strong&gt; string and a &lt;strong&gt;functionName&lt;/strong&gt; string as parameters. It logs a warning message, including the function name and warning message&lt;br&gt;
• Finally, the code exports an object containing the three custom logger functions: errorLogger, infoLogger, and warnLogger.&lt;/p&gt;

&lt;p&gt;Overall, this code sets up a logging configuration using the log4js library and provides custom logger functions for logging errors, info messages, and warnings with additional context information like function names.&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;strong&gt;3.Use the logger in your function. Here is an example using logger.ts:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;It logs various messages at different stages of execution using a custom logger object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;models&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../models&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;logger&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../log/logger&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getContact&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;infoLogger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;getContact&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="na"&gt;contactDetails&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;
                 &lt;span class="na"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
                 &lt;span class="na"&gt;LastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                 &lt;span class="na"&gt;MiddleName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                 &lt;span class="na"&gt;FirstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                 &lt;span class="na"&gt;ContactNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                 &lt;span class="na"&gt;Email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;}[]};&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;contactnumber&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contactnumber&lt;/span&gt;
        &lt;span class="nx"&gt;contactDetails&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Contact&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findAndCountAll&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;

            &lt;span class="na"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="c1"&gt;//limit: max,    &lt;/span&gt;
            &lt;span class="na"&gt;attributes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;           
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;LastName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;MiddleName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;FirstName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;            
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ContactNumber&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="na"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;IsActive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="na"&gt;ContactNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;contactnumber&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;contactDetails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;infoLogger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;No data found&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;getContact&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;warnLogger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s2"&gt;`No data found for contact number: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;contactnumber&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;getContact&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;204&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;No data found&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;contactDetails&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

        &lt;span class="nx"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;errorLogger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;getContact&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`An unexpected error occurred. &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;4.Below is the expected output in various scenarios:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;• When the data not found:&lt;/strong&gt;&lt;br&gt;
Logging level: Info&lt;br&gt;
Color: &lt;strong&gt;Green&lt;/strong&gt;&lt;br&gt;
Output:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3gkcrzbhz4defrp7zxzb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3gkcrzbhz4defrp7zxzb.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;• When an unexpected error occurs (catch block):&lt;/strong&gt;&lt;br&gt;
Logging level: Error&lt;br&gt;
Color: &lt;strong&gt;Red&lt;/strong&gt;&lt;br&gt;
Output:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdwwii0o4kkemv5d15r2u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdwwii0o4kkemv5d15r2u.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;• When a warning message is logged:&lt;/strong&gt;&lt;br&gt;
Logging level: Warning&lt;br&gt;
Color: &lt;strong&gt;Yellow&lt;/strong&gt;&lt;br&gt;
Output:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg09eb4nzcfp8xv79ackf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg09eb4nzcfp8xv79ackf.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
To review logs on Azure, you can refer to the article &lt;a href="https://dev.to/yogitakadam14/exception-handling-logging-and-notifications-in-azure-app-services-a-comprehensive-guide-45g5"&gt;Exception Handling, Logging, and Notifications in Azure App Services: A Comprehensive Guide&lt;/a&gt; for detailed instructions.&lt;/p&gt;

&lt;p&gt;By following best practices and leveraging the power of log4js, developers can enhance their Node.js applications' overall quality and maintainability. Furthermore, the comprehensive guide on exception handling, logging, and notifications in Azure App Services provides valuable insights for managing logs in Azure environments. With these practices in place, developers can build robust and resilient Node.js applications that meet the highest standards of stability and reliability.&lt;/p&gt;

</description>
      <category>node</category>
      <category>api</category>
      <category>errors</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Exception Handling, Logging, and Notifications in Azure App Services: A Comprehensive Guide</title>
      <dc:creator>YogitaKadam14</dc:creator>
      <pubDate>Fri, 31 Mar 2023 07:09:53 +0000</pubDate>
      <link>https://forem.com/yogitakadam14/exception-handling-logging-and-notifications-in-azure-app-services-a-comprehensive-guide-45g5</link>
      <guid>https://forem.com/yogitakadam14/exception-handling-logging-and-notifications-in-azure-app-services-a-comprehensive-guide-45g5</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt; &lt;br&gt;
Azure App Services are cloud-based applications that enable developers to build, deploy, and manage applications on the cloud. As with any application, it is important to have the proper exception handling, logging, and notification practices in place to ensure the application runs smoothly and any issues can be quickly identified and resolved. In this blog post, we will discuss the best practices for exception handling, logging, and notifications for Azure App Services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Exception Handling&lt;/strong&gt; &lt;br&gt;
Exception handling is one of the most important aspects of application development. It is important to properly handle exceptions to ensure the application runs smoothly and any unexpected errors can be quickly identified and resolved. When developing Azure App Services, it is important to use the Azure Application Insights feature to track and monitor application exceptions. This feature provides insight into application performance, errors, and exceptions and can help pinpoint the root cause of any issues. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2d5liilnixy4a6w0kw4d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2d5liilnixy4a6w0kw4d.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logging&lt;/strong&gt;&lt;br&gt;
Logging is an essential practice when developing applications, as it can provide valuable insight into how the application is performing and any potential issues that may arise. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Log Stream&lt;/strong&gt;&lt;br&gt;
Log Stream is a feature in Azure Monitor that allows users to quickly view and analyse log data from multiple sources in real-time. It allows users to quickly search and analyse log data, identify trends, and take action on any issues. Log Stream can help with troubleshooting, performance optimization, and security monitoring.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Diagnostics Settings&lt;/strong&gt;&lt;br&gt;
When developing Azure App Services, it is important to use the Azure Diagnostics feature to log application events, errors, and exceptions. This feature provides detailed logging.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select the App Service from the list of services.&lt;/li&gt;
&lt;li&gt;Select the Diagnostic Settings option from the left navigation pane.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9icoxwxot76jirnbxus6.png" alt="Image description"&gt; &lt;/li&gt;
&lt;li&gt;Configure the settings including the type of logging and the frequency of logging.&lt;/li&gt;
&lt;li&gt;Configure the type of metrics that should be collected, the metrics that should be collected, and the metrics that should be used to trigger alerts.&lt;/li&gt;
&lt;li&gt;Configure the retention period for the collected data and the type of data that should be stored in the log files.&lt;/li&gt;
&lt;li&gt;Azure Storage account is for Archive logs for audit, offline analysis or backup. Compared to using Azure Monitor Logs or a Log Analytics workspace, Storage is less expensive, and logs can be kept there indefinitely&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmkbh4iz2ub033mzcj8pf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmkbh4iz2ub033mzcj8pf.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Azure Application Insights&lt;/strong&gt;&lt;br&gt;
Azure Application Insights is a great tool for tracking and monitoring your application. It can provide detailed information about errors and exceptions, as well as performance metrics and other useful information.&lt;/p&gt;

&lt;p&gt;For example, you can use Application Insights to monitor the performance of your web application. You can track the number of requests and response times, as well as the performance of individual requests. You can also track exceptions and errors, and get detailed information about when and where they occur.&lt;/p&gt;

&lt;p&gt;Additionally, you can use Application Insights to monitor the performance of your backend services, such as databases and queues. You can track the number of requests and response times, as well as the performance of individual requests. You can also track exceptions and errors, and get detailed information about when and where they occur.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7oiptgta3n733qlr6zpj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7oiptgta3n733qlr6zpj.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxs91tah0i3ijrdxz86u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxs91tah0i3ijrdxz86u.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alerts &amp;amp; Notifications&lt;/strong&gt;&lt;br&gt;
Alerts are typically sent out in response to a specific trigger, such as a critical system error.&lt;/p&gt;

&lt;p&gt;Notifications are messages sent to one or more users to notify them that an alert has been created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk37ladu41gl3czq35qrl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk37ladu41gl3czq35qrl.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
For more details please refer &lt;a href="https://perituza.com/blog/azure-app-service-monitoring-and-alerts/" rel="noopener noreferrer"&gt;Azure app service monitoring and alerts&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Exception handling, logging, alerts and notifications are essential to the reliable operation of Azure App Services. With the right configuration and setup, these are the features can ensure that your services are operating efficiently and securely. This comprehensive guide provides an overview of each of these features, as well as basic instructions on how to configure them. With this guide, you'll be able to make sure that your Azure App Services are running smoothly and securely.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>appservice</category>
      <category>exceptionhandling</category>
      <category>node</category>
    </item>
    <item>
      <title>3rd Party Cookies</title>
      <dc:creator>YogitaKadam14</dc:creator>
      <pubDate>Sat, 31 Dec 2022 02:31:30 +0000</pubDate>
      <link>https://forem.com/yogitakadam14/3rd-party-cookies-25ke</link>
      <guid>https://forem.com/yogitakadam14/3rd-party-cookies-25ke</guid>
      <description>&lt;p&gt;I am writing this blog because came across a scenario where I was using the social Login Microsoft, Google, and LinkedIn using passport strategy, and these Log-In doesn’t work when 3rd party cookies are disabled, and each browser has different settings to enable 3rd party cookies ref. &lt;a href="https://help.joinhoney.com/article/290-what-if-i-want-to-log-into-honey-with-google-but-have-3rd-party-cookies-disabled"&gt;Browser settings to enable 3rd party cookies&lt;/a&gt;. Below, I have listed a few points which I thought we should know about the 3rd party cookies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's first understand what is cookies.&lt;/strong&gt;&lt;br&gt;
At their most basic, cookies are small files that websites send to your browser. They then track and monitor the sites you visit and your browsing activity on these pages. Retailers might use cookies to remember what items you've put in your online shopping cart, while news sites might use them to remember what stories you've clicked on in the past. Other sites might use cookies to remember your login information so that it automatically pops up when you visit the site’s log-in page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Third Party Cookies?&lt;/strong&gt;&lt;br&gt;
Third-party cookies are cookies that are set by a website other than the one you are currently on. In my case, want to disable the social login button options when Third-party cookies are disabled and enabled social login buttons when cookies are enabled. Handled it using the code. Please, ref. &lt;a href="https://chamith.medium.com/react-hook-to-check-third-party-cookies-enabled-in-the-browser-e542ce73fff3"&gt;First-party vs Third-party Cookies&lt;/a&gt; for more details&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why we required Third party cookies?&lt;/strong&gt;&lt;br&gt;
Third-party cookies are usually used to analyze your web activity. Since a third-party cookie is mainly interested in user behavior, it keeps track of the user’s internet activity. Once it recognizes you, it can store your browsing history. It is considered an effective way of targeted and personalized marketing.&lt;/p&gt;

&lt;p&gt;The most common third-party entities are advertisers, marketers, and social media platforms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Are third-party cookies safe?&lt;/strong&gt;&lt;br&gt;
Cookies are not necessarily a bad thing. The code behind them will not infect your computer, install adware or malware on your device, or alter your devices.&lt;/p&gt;

&lt;p&gt;But you might not like the fact that third-party cookies track your online browsing. These cookies allow websites to track your activity even if you’re not using their sites. If you think that is an invasion of your online privacy, then you might want to disable cookies. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Should you enable or disable third-party cookies?&lt;/strong&gt;&lt;br&gt;
When you visit any website, it will store at least one cookie — a first-party cookie — on your browser. This cookie remembers your basic activity on the site.&lt;br&gt;
Most sites store third-party cookies on your browser, too. If you want to keep social media companies, advertisers, and other website operators from tracking your online browsing, these are the cookies to disable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits of Third-Party Cookies&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Convenience&lt;/strong&gt; is a major one. A cookie that follows a user around the internet can allow them to take advantage of pre-filled address information on order forms, for instance. Websites can also get your location and serve you the most relevant information for your area.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Personalization&lt;/strong&gt; is another major benefit. How would you get related videos on YouTube or related products on Amazon if your interests and browsing history couldn’t follow you around the web? People enjoy seeing things they have an interest in, and third-party cookies are the reason they can do so.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Relevant&lt;/strong&gt; ads are an important aspect of these browser cookies. It’s not helpful for either a business or a consumer if the ads being shown have nothing to do with their needs, wants, or desires. It’s a waste of company money and it wastes the prospect's time as well.&lt;/p&gt;

&lt;p&gt;With cookies, you can ensure that a person is seeing offers that are the most relevant to their life and goals. That’s a win-win. Most consumers agree – if they must see ads, they’d rather see relevant ones. 90% of consumers say that irrelevant messages from companies are annoying.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drawbacks of Using Browser Cookies&lt;/strong&gt;&lt;br&gt;
The biggest problem that consumers have with third-party cookies is related to cookies and privacy: they feel their privacy is being invaded. How can cookies invade privacy? Cookies allow companies to track every website visited, marketers collect a lot of data about each person. This can be very uncomfortable for consumers, especially since this data can be accessed by almost anyone.&lt;/p&gt;

&lt;p&gt;Even the cookies that allow for personalization aren’t without risk. There are security problems in some of the software that can allow outside parties to access name, address, and even credit card information if it’s stored in the browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
In the end, it’s important to use Third-Party cookies sensibly.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Best practices for Node.js</title>
      <dc:creator>YogitaKadam14</dc:creator>
      <pubDate>Thu, 06 Oct 2022 07:08:59 +0000</pubDate>
      <link>https://forem.com/yogitakadam14/best-practices-for-nodejs-2n85</link>
      <guid>https://forem.com/yogitakadam14/best-practices-for-nodejs-2n85</guid>
      <description>&lt;p&gt;In this article I will cover best practices for writing Node.js&lt;/p&gt;

&lt;p&gt;NodeJS has become tremendously popular and is one of the most popular runtime environments for web servers. It is an open source, a cross-platform runtime environment for developing server-side applications, or more precisely, code that run on a server.&lt;br&gt;
Node.js is an asynchronous event-driven JavaScript runtime and is the most effective when building scalable network applications. Node.js is free of locks, so there's no chance to deadlock any process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project structure&lt;/strong&gt;&lt;br&gt;
Everything has to have its place in our application, and a folder is the perfect place to group common elements. In particular, we want to define a very important separation&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1nj0v5bxmyp2fj7b2ndy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1nj0v5bxmyp2fj7b2ndy.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use HTTP Methods &amp;amp; API Routes&lt;/strong&gt;&lt;br&gt;
Use HTTP Status Codes Correctly&lt;br&gt;
If something goes wrong while serving a request, you must set the correct status code for that in the response:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;2xx, if everything was okay,&lt;/li&gt;
&lt;li&gt;3xx, if the resource was moved,&lt;/li&gt;
&lt;li&gt;4xx, if the request cannot be fulfilled because of a client error (like requesting a resource that does not exist),&lt;/li&gt;
&lt;li&gt;5xx, if something went wrong on the API side (like an exception happened).
If you are using Express, setting the status code is as easy as res.status(500).send({error: 'Internal server error happened'}). Similarly with Restify: res.status(201)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Use camelCase&lt;/strong&gt;&lt;br&gt;
It is recommended to use lowerCamelCase when naming constants, variables, and functions and UpperCamelCase (capital first letter as well) when naming classes.&lt;br&gt;
This is universally accepted conventions and developers across the globe can easily identify and differentiate objects and classes when using this naming convention.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Environment Variables&lt;/strong&gt;&lt;br&gt;
A .env file is a plain text document. It should be placed in the root of your project. You specify key value pairs, and you can write single line comments using #. Here is an example how a .env file looks like:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4uq01k6d8t19akblhcm4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4uq01k6d8t19akblhcm4.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Avoid callbacks - Use async-await&lt;/strong&gt;&lt;br&gt;
We can avoid the callback hell with the help of Promises. Promises in javascript are a way to handle asynchronous operations in Node.js. It allows us to return a value from an asynchronous function like synchronous functions. When we return something from an asynchronous method it returns a promise which can be used to consume the final value when it is available in the future with the help of then() method or await inside of async functions&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Avoid Anonymous Functions&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Named function can be re-used over an order again in other parts of the project as well and this reduces code redundancy.&lt;/li&gt;
&lt;li&gt;If you find a bug in the code that creates an order, you fix that bug only in once place i.e. postOrderTasks() method and it will reflect in all places - saves time.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Use Refactoring of API calls&lt;/strong&gt;&lt;br&gt;
Refer Link: &lt;a href="https://dev.to/angha_ramdohokar_0b6505c2/refactoring-of-api-calls-28o7"&gt;Refactoring of API calls&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Confirm that your app restarts automatically&lt;/strong&gt;&lt;br&gt;
A dependency mistake can bring down your app even if you use the best error handling standards in development. Instead, use a process manager to ensure that the app recovers gracefully from a runtime fault or when the server fails.&lt;br&gt;
Aside from that, there is another case in which you must restart your program. And that situation is if the entire service that you are running fails. In this instance, you want your program to continue as soon as possible. You can also utilize PM2 Keymetrics to manage your process.&lt;a href="https://www.bing.com/videos/search?q=PM2+Keymetrics&amp;amp;&amp;amp;view=detail&amp;amp;mid=FD376CD2B3C70AE7EA11FD376CD2B3C70AE7EA11&amp;amp;&amp;amp;FORM=VRDGAR&amp;amp;ru=%2Fvideos%2Fsearch%3Fq%3DPM2%2BKeymetrics%26FORM%3DVDRESM" rel="noopener noreferrer"&gt;Ref. PM2 Keymetrics&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make use of Gzip compression&lt;/strong&gt;&lt;br&gt;
The server can use Gzip compression to compress the response before transmitting it to a web browser, reducing time lag and latency. This is one of the top NodeJS best practices in 2022-23.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Making the Server Restart Automatically After Updating a File&lt;/strong&gt;&lt;br&gt;
Every time when we make changes to the code, we have to restart the server to reflect those changes.&lt;br&gt;
To avoid having to restart the server manually, let's install nodemon, an npm package that automatically restarts the server when changes are made to a file.&lt;br&gt;
&lt;code&gt;npm install -g nodemon&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Const Over Let, Do Not Use Var&lt;/strong&gt;&lt;br&gt;
Before ES6, the var keyword was used to declare a variable in JavaScript&lt;br&gt;
Variables declared using the var keyword are either globally or functionally scoped, they do not support block-level scope. This means that if a variable is defined in a loop or in an if statement it can be accessed outside the block and accidentally redefined leading to a buggy program. As a general rule, you should avoid using the var keyword.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Error Handling&lt;/strong&gt;&lt;br&gt;
To handle error in node.js we should know some key concepts like callback functions, Asynchronous functions like a promise, and async-await, try.. catch block, throw keyword, error object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Add comments&lt;/strong&gt;&lt;br&gt;
A comment is a description of a program about how it works in a simple readable format. These are usually used at places where some additional clarity needs to be provided to the developer who is reading through the code. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application testing&lt;/strong&gt;&lt;br&gt;
Implementing code quality testing at any project stage is never too late. Begin small and straightforward.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a Proper API Documentation&lt;/strong&gt;&lt;br&gt;
The following open-source projects can help you with creating documentation for your APIs:&lt;br&gt;
&lt;a href="https://apiblueprint.org/" rel="noopener noreferrer"&gt;APIBluePrint&lt;/a&gt;&lt;br&gt;
&lt;a href="https://swagger.io/" rel="noopener noreferrer"&gt;Swagger&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this article, I have listed the best practices for Node.js development. These practices helps you to write better code for the Node.js app. You can use a combination of best Node.js practices. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>express</category>
      <category>api</category>
    </item>
    <item>
      <title>WordPress Plugin</title>
      <dc:creator>YogitaKadam14</dc:creator>
      <pubDate>Tue, 05 Jul 2022 07:00:07 +0000</pubDate>
      <link>https://forem.com/yogitakadam14/wordpress-plugin-1e84</link>
      <guid>https://forem.com/yogitakadam14/wordpress-plugin-1e84</guid>
      <description>&lt;p&gt;If we search WordPress plugin in google, we find that there are lots of free plugins available in the market. You can even create your own custom WordPress plugins. In this blog I will show you how to create a simple WordPress plugin, and how to begin your WordPress plugin development journey.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do we require to create our own plugins?&lt;/strong&gt;&lt;br&gt;
Creating your own instruments and effects is surely the best way to get a completely custom sound. WordPress plugins allow you to add custom features and offer a powerful way to add unique functionality to your website.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is a WordPress Plugin?&lt;/strong&gt;&lt;br&gt;
WordPress plugins are like apps for your WordPress website. Just like apps on your phone, you can install plugins in WordPress to add new features.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simple steps to create WordPress plugin&lt;/strong&gt;&lt;br&gt;
Before starting the development of a plugin, you should have the WordPress setup on your local environment or access to your site via FTP. Here I have created the plugin which will execute at the page load to display message. You can install WordPress on your local system using &lt;a href="https://localwp.com/"&gt;this link&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Navigate to the WordPress plugins folder. It is almost always located at /wp-content/plugins&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2NwPhXE7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/logu1h30p1sg2metfnyk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2NwPhXE7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/logu1h30p1sg2metfnyk.png" alt="Image description" width="800" height="144"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new folder for your plugin with name my-first-plugin&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6Bt8W0jp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s9npaaws1h38h03zofgy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6Bt8W0jp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s9npaaws1h38h03zofgy.png" alt="Image description" width="800" height="153"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create the main PHP file for your plugin.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KXaS4XAG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tebrgfp9x58w2cvsd00p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KXaS4XAG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tebrgfp9x58w2cvsd00p.png" alt="Image description" width="800" height="144"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Setup your plugin's information&lt;br&gt;
You will need to open that PHP file with your editor.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--s8TOlihj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckwwwk2tok3nd0xhlvj6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--s8TOlihj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckwwwk2tok3nd0xhlvj6.png" alt="Image description" width="800" height="341"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Program Your Plugin to add functions &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--25eaFGtb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ijfs7wj24ack9ok6f91u.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--25eaFGtb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ijfs7wj24ack9ok6f91u.PNG" alt="Image description" width="800" height="496"&gt;&lt;/a&gt;&lt;br&gt;
This code hooks into “the_content” action that fires when WordPress renders the post content for your site. When that action fires, WordPress will call our “my_content_text” function that is defined below the “add_action” call.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Activate Plugin: Click on activate plugin&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---Gh9lNT2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p6blb09ew7ersu4cn0mw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---Gh9lNT2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p6blb09ew7ersu4cn0mw.png" alt="Image description" width="800" height="612"&gt;&lt;/a&gt; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Browse WordPress site&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ofZlDT3c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mco898393k5g3qj3qg2i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ofZlDT3c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mco898393k5g3qj3qg2i.png" alt="Image description" width="800" height="506"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For more details you can visit &lt;a href="https://developer.wordpress.org/plugins/"&gt;this link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts on WordPress Plugin Development&lt;/strong&gt;&lt;br&gt;
There are tons and tons of things you can do with plugins and almost as many ways you can create them. In this tutorial on WordPress plugin development, we explored how you can create a simple plugin from scratch. &lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>plugin</category>
      <category>php</category>
      <category>beginners</category>
    </item>
    <item>
      <title>My first deployment on Azure</title>
      <dc:creator>YogitaKadam14</dc:creator>
      <pubDate>Tue, 04 Jan 2022 14:11:44 +0000</pubDate>
      <link>https://forem.com/yogitakadam14/my-first-deployment-on-azure-afd</link>
      <guid>https://forem.com/yogitakadam14/my-first-deployment-on-azure-afd</guid>
      <description>&lt;p&gt;To deploy your application on the Azure &lt;br&gt;
You should have a Microsoft Azure Account. You can get a free account for one month.&lt;br&gt;
Refer below link to create Azure account:&lt;br&gt;
&lt;a href="https://azure.microsoft.com/en-us/free/" rel="noopener noreferrer"&gt;Azure Account&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Azure offers a number of ways to host your application code. The term compute refers to the hosting model for the computing resources that your application runs on. &lt;/p&gt;

&lt;p&gt;If you want to deploy your application on the managed platform by selecting the runtime, An App Service is the right choice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which service should you choose?&lt;/strong&gt;&lt;br&gt;
 Azure Virtual Machine, which is considered as IaaS (Infrastructure as a Service) and the other one is Azure App Service, which is a PaaS (Platform as a Service). We will discuss which service is better for different use-cases, and what are the differences between these two services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Azure Virtual Machine&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F333162as33qxcponxhwx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F333162as33qxcponxhwx.png" alt="Infrastructure as a Service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Azure App Service&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwl4kjn0zjc26cidsdhoa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwl4kjn0zjc26cidsdhoa.png" alt="Platform as a Service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Azure Virtual Machines is detailed as "It provides on-demand, high-scale, secure, virtualized infrastructure".&lt;/li&gt;
&lt;li&gt;Azure VMs are more expensive to run in comparison to Azure App Service.&lt;/li&gt;
&lt;li&gt;Developers describe Azure App Service as "Build, deploy, and scale web apps on a fully managed platform". Quickly build, deploy, and scale web apps created with popular frameworks &lt;/li&gt;
&lt;li&gt;Azure App Service requires much less managerial efforts in comparison to Azure Virtual Machines.&lt;/li&gt;
&lt;li&gt;Azure App Services do not offer Pay-as-you-Go. Hence, you’re paying for the service plan, even if you’re not using it.&lt;/li&gt;
&lt;li&gt;Azure App Service have constraints in comparison to Azure VMs in terms of scalability. Hence, Azure VMs are preferred for apps, which have scope to expand for future.&lt;/li&gt;
&lt;li&gt;The development of app is much simpler and faster in Azure App Service.&lt;/li&gt;
&lt;li&gt;Azure VMs offer developer more control over the environment. Like, one can’t choose underlying OS of VM in an Azure App Service.&lt;/li&gt;
&lt;li&gt;There may be constraints for the support of certain programming languages on Azure App Service. In that case, one has to use Azure VM to create environment for the programming language.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use below configuration for deployment:&lt;br&gt;
&lt;strong&gt;&lt;u&gt;For NodeJS Application:&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
Build provider: App Service Build Service&lt;br&gt;
Runtime stack: Node&lt;br&gt;
Version: Node 16 LTS&lt;br&gt;
Operating System: Linux&lt;br&gt;
Deployment: Bitbucket&lt;/p&gt;

&lt;p&gt;Refer to the following link:&lt;br&gt;
&lt;a href="https://dev.to/bashirk/the-painless-way-to-deploying-your-nodejs-app-on-azure-part-1-14fi"&gt;Deploying Your NodeJS App on Azure&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;For React Application:&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
Build provider: App Service Build Service&lt;br&gt;
Runtime stack: .NET&lt;br&gt;
Version: ASP.NET V4.8&lt;br&gt;
Operating System: Windows&lt;br&gt;
Deployment: FTP deployment using FileZilla&lt;/p&gt;

&lt;p&gt;Refer to the following video link:&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=3wF99gvBFcw" rel="noopener noreferrer"&gt;Deploy ReactJS application to Azure cloud using 3 different ways | FTP | Kudu | CI/CD DevOps&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Note&lt;/u&gt;&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In App Service, application settings are variables passed as environment variables to the application code&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2phokob022em8u0faj1e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2phokob022em8u0faj1e.png" alt="Configuration Settings"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;.NET framework and IIS require a web.config file to identify application folder structure for navigation.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;configuration&amp;gt;
&amp;lt;system.webServer&amp;gt;
&amp;lt;staticContent&amp;gt;
    &amp;lt;mimeMap fileExtension=".json" mimeType="application/json" /&amp;gt;
&amp;lt;/staticContent&amp;gt;
    &amp;lt;rewrite&amp;gt;
      &amp;lt;rules&amp;gt;
        &amp;lt;rule name="Main Rule" stopProcessing="true"&amp;gt;
                &amp;lt;match url=".*" /&amp;gt;
                &amp;lt;conditions logicalGrouping="MatchAll"&amp;gt;
                    &amp;lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&amp;gt;
                    &amp;lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&amp;gt;
                &amp;lt;/conditions&amp;gt;
                &amp;lt;action type="Rewrite" url="/" /&amp;gt;
            &amp;lt;/rule&amp;gt;
        &amp;lt;/rules&amp;gt;
    &amp;lt;/rewrite&amp;gt;
&amp;lt;/system.webServer&amp;gt;
&amp;lt;/configuration&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;u&gt;Conclusion&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
There is a lot to Azure. These are basic steps of the deploying React and NodeJS application on App services. Understanding of which service should you choose App Service or Virtual Machine for deployment?&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>azure</category>
      <category>react</category>
      <category>node</category>
    </item>
  </channel>
</rss>
