<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Narmatha Balasundaram on Medium]]></title>
        <description><![CDATA[Stories by Narmatha Balasundaram on Medium]]></description>
        <link>https://medium.com/@narmathabala?source=rss-b766799632b6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*UqCFjnGIVkoicIXk.png</url>
            <title>Stories by Narmatha Balasundaram on Medium</title>
            <link>https://medium.com/@narmathabala?source=rss-b766799632b6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 17:46:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@narmathabala/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Pipeline Decorators]]></title>
            <link>https://narmathabala.medium.com/pipeline-decorators-5367eaf03fd2?source=rss-b766799632b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5367eaf03fd2</guid>
            <category><![CDATA[pipeline-as-code]]></category>
            <category><![CDATA[azure-devops]]></category>
            <dc:creator><![CDATA[Narmatha Balasundaram]]></dc:creator>
            <pubDate>Thu, 18 Feb 2021 17:53:01 GMT</pubDate>
            <atom:updated>2021-02-18T17:53:01.648Z</atom:updated>
            <content:encoded><![CDATA[<h4>The approach, considerations and implications to using Pipeline Decorators in your project.</h4><p><strong>Introduction</strong></p><p>Pipeline Decorators provide an ability to add required steps to be added in a YAML file that can be applied to all pipelines in an organization. In other words, the decorator pattern is employed by adding tasks to be automatically run defined jobs in the pipeline.</p><p>Pipeline decorators come in handy when there are compliance/governance mandatory tasks — these can be injected at the beginning and/or end of every pipeline in AzDO organization. For example, when the organization has a required step for static code analysis on all builds, this task can easily be added as a Pipeline Decorator to be executed on all pipelines in the organization.</p><p>In a nutshell, the sequence of steps to be followed for using Pipeline Decorators are</p><ol><li>Create an Azure DevOps Extension, adding a step to perform the mandatory task at point in the build process (pre-task or post-task step). For detailed steps on how to use Pipeline Decorators in your solution, refer to <a href="https://docs.microsoft.com/en-us/azure/devops/extend/develop/add-pipeline-decorator?view=azure-devops">Azure Documentation</a>.</li><li>Create Decorator YAML to add steps to be injected. When using <a href="https://docs.microsoft.com/en-us/azure/devops/extend/develop/add-pipeline-decorator?view=azure-devops#conditional-injection">conditional injection</a> of the Pipeline Decorator in a pipeline, be sure to define the condition here.</li><li>Build and install the extension in the Azure MarketPlace. Remember to mark the extension ‘private’, when developing an extension specific to an organization.</li></ol><p>For our solution, we investigated using Pipeline Decorators to add steps that will log informational type messages during the pipeline run. This was a crucial step to ensure AzDO pipeline templates authored had good coverage of tests. The extension targeted pre-task and post-task for jobs defined in AzDO pipeline. Due to the write-only limitation of build artifacts, the logs from these tasks were stored in Azure Blob Storage. This ensured accessing and appending new log information to be possible.</p><p><strong>Considerations and Implications</strong></p><ol><li>The Pipeline Decorator extension is global in nature and is installed for the entire AzDO organization. When thinking about using Pipeline Decorators, it is important to consider its implications to all of the pipelines in the organization.</li><li>Conditional injection is used to target required pipelines in the organization; but there is still a concern about narrowing the use case to prevent accidental triggers for any projects and/or pipeline.</li><li>When the targeted use case changes and/or expands, the extension must be updated, recompiled and updated in the MarketPlace. An extension could be marked as ‘private’, if required and shared with desired Azure organization.</li><li>Even with conditional injection, it is important to remember that every single project in the Azure DevOps organization executes this condition to check if the extension should be applied. Though there is no considerable performance concerns with this, it is indeed a validation check occurring during the lifecycle of the pipeline build.</li><li>When there are multiple Pipeline Decorators in an Azure DevOps organization, the execution order of these extensions can not be guaranteed.</li><li>During our investigation, log informational messages were written to Azure Blob Storage as a post-task before the completion of the job. As with any writes, some latency was observed thus making the pipeline longer.</li></ol><p><strong>Conclusions</strong></p><p>Pipeline Decorators allow you to define a set of common actions that can be applied across all projects. By using conditional injection, it is possible to customize and target specific projects. It is important to evaluate what tasks these Pipeline Decorators perform and their implications across the organization.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5367eaf03fd2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Telemetry for Electron App using AppInsights]]></title>
            <link>https://narmathabala.medium.com/telemetry-for-electron-app-using-appinsights-c8883dfd6745?source=rss-b766799632b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8883dfd6745</guid>
            <dc:creator><![CDATA[Narmatha Balasundaram]]></dc:creator>
            <pubDate>Wed, 12 Feb 2020 19:58:59 GMT</pubDate>
            <atom:updated>2020-02-12T19:58:59.775Z</atom:updated>
            <content:encoded><![CDATA[<p>Building observable systems is crucial to measure the behavior of the application. <a href="https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview">Application Insights</a> is a part of Azure Monitor and is a performance monitoring platform. This blog post will guide the user about how to integrate AppInsights into an Electron application for logging telemetry data.</p><p>Electron is a framework for creating cross platform desktop applications with web technologies like JavaScript, HTML and CSS. Electron app bundles a web browser — <a href="https://www.chromium.org/">Chromium</a>.</p><h3>Getting Started</h3><p>The first step is to log on to your <a href="https://ms.portal.azure.com/#home">Azure Portal</a> account and create an Application Insights resource. Click on “Create a resource” and search for “Application Insights”. It is also available under DevOps-&gt;Application Insights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*020p5oFt33AKwqLR9GL0zw.png" /><figcaption>Azure Portal Resource — Creating Application Insights resource</figcaption></figure><blockquote>During resource creation “Name”, “Region”, <br>Subscription ID” and “Resource Group” are required to be provided.</blockquote><h3>Configuring AppInsights SDK</h3><p>The next step is to integrate this into an existing Electron application. Install Application Insights SDK from the Windows Terminal using</p><pre>npm install --save applicationinsights</pre><p><a href="https://github.com/Microsoft/ApplicationInsights-node.js">AppInsights SDK</a> is initialized in the Electron app when the application starts — the earlier, the better. If you are not using a <a href="https://www.oodesign.com/singleton-pattern.html">singleton design pattern </a>that the code links here, then the integration is simpler.</p><p>In the <strong><em>main</em></strong> file, place this code inside the function hooked to ready event that is triggered when Electron has completed the initialization process. In the Electron template, this will be during <em>createWindow()</em> event.</p><pre>let appInsights = require(‘applicationinsights’);<br>appInsights.setup(“your-instrumentation-key”).start();</pre><blockquote>NOTE: Use instrumentation key of your Application Insights instance.</blockquote><p>Below is the instantiation using AppInsights singleton helper class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c7078769458cb8a25bb7d0d9ba3f133/href">https://medium.com/media/9c7078769458cb8a25bb7d0d9ba3f133/href</a></iframe><blockquote>Note: Full version of <a href="https://gist.github.com/NarmathaBala/cbfcbcfd702ef02c51b547a3429e45f7">telemetry-helper.ts</a></blockquote><p>If you are looking for a basic setup, at this point you are all set to start logging telemetry data to ApplicationInsights.</p><h3>Custom Telemetry</h3><p>AppInsights provides the flexibility of <a href="https://docs.microsoft.com/en-us/azure/azure-monitor/app/api-custom-events-metrics"><em>tracking custom data</em></a> for events, metrics and errors — be it a page load, button click or to measure time taken for a certain action in the code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/80e8bbb318b0563bedbf0b6e9958c5e7/href">https://medium.com/media/80e8bbb318b0563bedbf0b6e9958c5e7/href</a></iframe><blockquote>Note: Remember to get the reference to defaultClient before logging custom events.</blockquote><h3>Logging Telemetry Data from Electron Renderer Process</h3><p>In Electron, there are <a href="https://www.electronjs.org/docs/tutorial/application-architecture">two main processes </a>— the process that runs the <em>main </em>script called <strong>main process,</strong> is responsible for displaying a GUI using webpages and one that uses Chromium for rendering web pages, called <strong>renderer process.</strong></p><p>One of the challenges we faced was <strong><em>sending custom telemetry data from the renderer process</em></strong>. By default, any native interactions directly from the renderer process is not allowed. The renderer process of the webpage communicated with the main process to request main process to perform those operations.</p><p>Electron uses interprocess communication (IPC) to communicate between these processes. IPC is similar to a postoffice message box — basically, a message is sent with a channel name and information from the renderer process and main process listens to the message on a channel.</p><p>The solution is to piggyback on Electron’s in-built IPC to transfer custom telemetry data from the individual rendering webpages(process) to the main process. Main process then uses AppInsights SDK to log custom events.</p><p>The below sample shows the <strong><em>ipcRenderer</em></strong> using .send() to send an asynchronous message to the main process via <em>channel</em>, along with arguments.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5f8604a9c05235324c816bc10f58c53/href">https://medium.com/media/d5f8604a9c05235324c816bc10f58c53/href</a></iframe><p>The main process handles it by listening for the <em>channel </em>within the <strong><em>ipcMain</em></strong> module.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d67f71a2bf25683391259690418e884/href">https://medium.com/media/0d67f71a2bf25683391259690418e884/href</a></iframe><h4>References</h4><ol><li><a href="https://cameronnokes.com/blog/deep-dive-into-electron&#39;s-main-and-renderer-processes/"><em>https://cameronnokes.com/blog/deep-dive-into-electron&#39;s-main-and-renderer-processes/</em></a></li><li><a href="https://github.com/ccnokes/electron-tutorials"><em>https://github.com/ccnokes/electron-tutorials</em></a></li><li><em>Complete singleton implementation of </em><a href="https://gist.github.com/NarmathaBala/cbfcbcfd702ef02c51b547a3429e45f7"><em>telemetry helper</em></a><em>.</em></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8883dfd6745" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>