<?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 Arun Varriar on Medium]]></title>
        <description><![CDATA[Stories by Arun Varriar on Medium]]></description>
        <link>https://medium.com/@arunvarriar?source=rss-4f8af59649cd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*c0PFBYmIZmNgWukKiPHc3Q.jpeg</url>
            <title>Stories by Arun Varriar on Medium</title>
            <link>https://medium.com/@arunvarriar?source=rss-4f8af59649cd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 23:34:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arunvarriar/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[List Azure devops release Pipelines and Last run]]></title>
            <link>https://medium.com/@arunvarriar/list-azure-devops-release-pipelines-and-last-run-e18154b00199?source=rss-4f8af59649cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/e18154b00199</guid>
            <category><![CDATA[azure-devops-release-run]]></category>
            <category><![CDATA[release-last-run]]></category>
            <category><![CDATA[ado-release-pipeline]]></category>
            <category><![CDATA[release-pipeline]]></category>
            <dc:creator><![CDATA[Arun Varriar]]></dc:creator>
            <pubDate>Wed, 15 Oct 2025 14:06:01 GMT</pubDate>
            <atom:updated>2025-10-15T14:06:01.426Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog discusses in detail about how we can get list of azure devops build pipelines and their last run.</p><p>In Azure DevOps (ADO), users with permissions to create release pipelines often do so for learning purposes or due to a lack of awareness about existing pipelines — especially when knowledge transfer is insufficient. Over time, this can lead to redundant or unused pipelines, contributing to technical debt. To address this, analyzing pipelines that haven’t run in a long time can help identify candidates for cleanup and streamline the ADO environment.</p><p>In addition to cleanup efforts, the same pipeline usage data can be leveraged for audit purposes. It provides valuable insights into pipeline ownership, activity history, and usage patterns — helping ensure compliance, traceability, and better governance across our Azure DevOps environment.</p><pre># Prerequisites:<br># - Personal Access Token (PAT) with appropriate Azure DevOps permissions<br><br><br>$organization = &quot;Your ADO organisation&quot; # Azure DevOps organization name (not URL)<br>$pat = &quot;Personal Acccess Token&quot; # Replace with your PAT<br>$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(&quot;:$pat&quot;))<br>$apiBaseUrl = &quot;https://vsrm.dev.azure.com/$organization&quot;<br><br># Prepare an array to collect results<br>$results = @()<br><br># Get all projects<br>$projectsUrl = &quot;https://dev.azure.com/$organization/_apis/projects?api-version=7.0&quot;<br>$projects = Invoke-RestMethod -Uri $projectsUrl -Headers @{Authorization = &quot;Basic $base64AuthInfo&quot;}<br><br>foreach ($project in $projects.value) {<br>    $projectName = $project.name<br><br>    # Get all release definitions for the project<br>    $definitionsUrl = &quot;$apiBaseUrl/$projectName/_apis/release/definitions?api-version=7.0&quot;<br>    $definitions = Invoke-RestMethod -Uri $definitionsUrl -Headers @{Authorization = &quot;Basic $base64AuthInfo&quot;}<br><br>    foreach ($definition in $definitions.value) {<br>        $definitionId = $definition.id<br>        $definitionName = $definition.name<br><br>        # Get the latest release for this definition<br>        $releasesUrl = &quot;$apiBaseUrl/$projectName/_apis/release/releases?definitionId=$definitionId&amp;`$top=1&amp;api-version=7.0&quot;<br>        $releases = Invoke-RestMethod -Uri $releasesUrl -Headers @{Authorization = &quot;Basic $base64AuthInfo&quot;}<br><br>        if ($releases.value.Count -gt 0) {<br>            $release = $releases.value[0]<br>            $results += [PSCustomObject]@{<br>                Project          = $projectName<br>                DefinitionName   = $definitionName<br>                DefinitionId     = $definitionId<br>                LatestReleaseId  = $release.id<br>                Status           = $release.status<br>                CreatedOn        = $release.createdOn<br>                ReleaseName      = $release.name<br>            }<br>        } else {<br>            $results += [PSCustomObject]@{<br>                Project          = $projectName<br>                DefinitionName   = $definitionName<br>                DefinitionId     = $definitionId<br>                LatestReleaseId  = &quot;&quot;<br>                Status           = &quot;&quot;<br>                CreatedOn        = &quot;&quot;<br>                ReleaseName      = &quot;&quot;<br>            }<br>        }<br>    }<br>}<br><br># Export results to CSV<br>$results | Export-Csv -Path &quot;$PSScriptRoot\releases_report.csv&quot; -NoTypeInformation<br>Write-Host &quot;CSV</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e18154b00199" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[List Azure devops build Pipelines and Last run]]></title>
            <link>https://medium.com/@arunvarriar/list-azure-devops-build-pipelines-and-last-run-9f86a4ba8004?source=rss-4f8af59649cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f86a4ba8004</guid>
            <category><![CDATA[pipeline-latest-run]]></category>
            <category><![CDATA[pipeline-last-run]]></category>
            <category><![CDATA[list-build-pipeline]]></category>
            <dc:creator><![CDATA[Arun Varriar]]></dc:creator>
            <pubDate>Wed, 01 Oct 2025 03:31:57 GMT</pubDate>
            <atom:updated>2025-10-01T03:31:57.370Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog discusses in detail about how we can get list of azure devops build pipelines and their last run.</p><p>Generally any user who has access to create the build pipelines can go create pipelines — might be for learning purpose or without awareness of already existing pipelines due to the lack of knowledge transitions. After a point such cases becomes a tech debt and want to analyze the pipelines which have been not running for long time. This data helps in cleaning up the ADO.</p><p>Similarly the same data can be used for audit purpose as well to figure out the pipeline information.</p><pre>$organization = &lt;Your organisation&gt;# Azure DevOps organization name <br>$pat = &lt;PAT&gt;# Replace with your PAT<br>$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(&quot;:$pat&quot;))<br>$apiBaseUrl = &quot;https://dev.azure.com/$organization&quot;<br><br># Prepare an array to collect results<br>$results = @()<br><br># Get all projects<br>$projectsUrl = &quot;$apiBaseUrl/_apis/projects?api-version=7.0&quot;<br>$projects = Invoke-RestMethod -Uri $projectsUrl -Headers @{Authorization = &quot;Basic $base64AuthInfo&quot;}<br><br>foreach ($project in $projects.value) {<br>    $projectName = $project.name<br><br>    # Get all build definitions for the project<br>    $definitionsUrl = &quot;$apiBaseUrl/$projectName/_apis/build/definitions?api-version=7.0&quot;<br>    $definitions = Invoke-RestMethod -Uri $definitionsUrl -Headers @{Authorization = &quot;Basic $base64AuthInfo&quot;}<br><br>    foreach ($definition in $definitions.value) {<br>        $definitionId = $definition.id<br>        $definitionName = $definition.name<br><br>        # Get the latest build for this definition (from any branch)<br>        $buildsUrl = &quot;$apiBaseUrl/$projectName/_apis/build/builds?definitions=$definitionId&amp;`$top=1&amp;api-version=7.0&quot;<br>        $builds = Invoke-RestMethod -Uri $buildsUrl -Headers @{Authorization = &quot;Basic $base64AuthInfo&quot;}<br>        write-host &quot;Processing Project: $projectName, Definition: $definitionName&quot;<br>        if ($builds.value.Count -gt 0) {<br>            $build = $builds.value[0]<br>            $results += [PSCustomObject]@{<br>                Project         = $projectName<br>                DefinitionName  = $definitionName<br>                DefinitionId    = $definitionId<br>                LatestBuildId   = $build.id<br>                Status          = $build.status<br>                Result          = $build.result<br>                SourceBranch    = $build.sourceBranch<br>                QueueTime       = $build.queueTime<br>            }<br>        } else {<br>            $results += [PSCustomObject]@{<br>                Project         = $projectName<br>                DefinitionName  = $definitionName<br>                DefinitionId    = $definitionId<br>                LatestBuildId   = &quot;&quot;<br>                Status          = &quot;&quot;<br>                Result          = &quot;&quot;<br>                SourceBranch    = &quot;&quot;<br>                QueueTime       = &quot;&quot;<br>            }<br>        }<br>    }<br>}<br><br># Export results to CSV<br>$results | Export-Csv -Path &quot;$PSScriptRoot\builds_report.csv&quot; -NoTypeInformation<br>Write-Host &quot;CSV report generated at $PSScriptRoot\builds_report.csv&quot;</pre><p>This code will export all the data to a csv file.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f86a4ba8004" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure devops MCP server]]></title>
            <link>https://medium.com/@arunvarriar/azure-devops-mcp-server-23d3c719c69f?source=rss-4f8af59649cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/23d3c719c69f</guid>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[ado-mcp]]></category>
            <category><![CDATA[ado-mcp-server]]></category>
            <category><![CDATA[azure-devops-mcp-server]]></category>
            <dc:creator><![CDATA[Arun Varriar]]></dc:creator>
            <pubDate>Mon, 22 Sep 2025 15:35:41 GMT</pubDate>
            <atom:updated>2025-09-25T13:10:36.834Z</atom:updated>
            <content:encoded><![CDATA[<p>Azure DevOps just became better with Agents!!!</p><p>Azure DevOps has taken a significant leap forward with the integration of Model Context Provider (MCP) servers. These local MCP servers act as intermediaries between GitHub Copilot and your Azure DevOps organization, enabling the injection of rich, real-time context — such as work items, pull requests, and test plans — into prompts sent to large language models (LLMs). This contextual enhancement empowers Copilot to generate more accurate and relevant responses tailored to your specific Azure DevOps projects, including improved work item descriptions, smarter pull requests, and automated test plan creation.</p><p>Before reading this blog I would recommend everyone to go through this as well: <a href="https://github.com/microsoft/azure-devops-mcp?tab=readme-ov-file">https://github.com/microsoft/azure-devops-mcp?tab=readme-ov-file</a></p><p><strong>How to setup Azure devops MCP</strong></p><p>For this guide, MCP is configured using Visual Studio Code (VS Code), although it can also be set up in Visual Studio.</p><p>Ensure the following tools are installed:</p><ul><li>Visual Studio Code or VS Code Insiders</li><li>Node.js version 20 or higher</li><li>Azure CLI</li></ul><p>Azure Login : Make sure you are logged in to Azure DevOps via the Azure CLI as: az login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*8gqfeGeuoOFhYZispiJpWQ.png" /></figure><p>This command will display all Azure subscriptions available to you. Select the subscription linked to your Azure DevOps organization.</p><p><strong>Installation</strong></p><p>For installation you can go to the github MCP page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*kHXqbYF-kXAJ0j5rz4xk-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*S623AZG3TC0uTP8lqbd55Q.png" /></figure><p>This should open the below page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*GWfD09hip8g47O39PeB_iQ.png" /></figure><p>Install the azure devops MCP using the below command:</p><p>npm install -g @azure-devops/mcp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*qOo0erOX5lxLCEjVDCYISw.png" /></figure><p>After installing, create the mcp and copilot instruction with the folder structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*48emlj0U4HajI6fzBLv0vw.png" /></figure><p><strong>Once you add the files, add the contents to it. </strong>MCP.json:</p><pre>{<br>  &quot;inputs&quot;: [<br>    {<br>      &quot;id&quot;: &quot;ado_org&quot;,<br>      &quot;type&quot;: &quot;promptString&quot;,<br>      &quot;description&quot;: &quot;Azure DevOps organization name  (e.g. &#39;contoso&#39;)&quot;<br>    }<br>  ],<br>  &quot;servers&quot;: {<br>    &quot;ado&quot;: {<br>      &quot;type&quot;: &quot;stdio&quot;,<br>      &quot;command&quot;: &quot;npx&quot;,<br>      &quot;args&quot;: [&quot;-y&quot;, &quot;@azure-devops/mcp&quot;, &quot;${input:ado_org}&quot;]<br>    }<br>  }<br>}</pre><p>Under copilot instartuciotns you can copy this content: <a href="https://github.com/microsoft/azure-devops-mcp/blob/main/.github/copilot-instructions.md">https://github.com/microsoft/azure-devops-mcp/blob/main/.github/copilot-instructions.md</a></p><p>After saving you should get a prompt asking for organization, fill the organization. After entering your organization your MCP should be running now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*-rDnQ2GyYa6SYlbouAqCaA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*b0w6qN1Bvsh2MijYNqpMbQ.png" /></figure><p>Once the MCP server is up and running you can start interacting with your ADO.</p><p>You can use any of the prompts from these page;<br> <a href="https://github.com/microsoft/azure-devops-mcp/tree/main?tab=readme-ov-file#%EF%B8%8F-supported-tools">https://github.com/microsoft/azure-devops-mcp/tree/main?tab=readme-ov-file#%EF%B8%8F-supported-tools</a></p><p>An example would be you can provide a basic detail and ask the github copilot to create a work item under your backlog…wooo you will have work item under your backlog with better acceptance criteria and description.</p><p>We can even create automated tests/unit tests by reading the work items from azure devops in github copilot using agent mode with MCP servers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23d3c719c69f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Packages for using Azure DevOps Rest Clients]]></title>
            <link>https://medium.com/@arunvarriar/packages-for-using-azure-devops-rest-clients-c8696cf5d872?source=rss-4f8af59649cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8696cf5d872</guid>
            <category><![CDATA[azure-devops-api]]></category>
            <category><![CDATA[ado-packages]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Arun Varriar]]></dc:creator>
            <pubDate>Mon, 15 Sep 2025 10:20:50 GMT</pubDate>
            <atom:updated>2025-09-15T10:20:50.571Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, I am going to discuss about the ADOAdmin.AzureDevOps.Clients which can be used to call, patch and post any of the ADO API.</p><p>ADOAdmin.AzureDevOps.Clients, as the name suggests it has been aimed for ADO admins who use the ADO api’s extensively. This package has got modules for working Azure DevOps API operations as GET,PATCH and POST. This can be further extended, based on the suggestions.</p><p>This package gives facility to avoid the repetition of codes that is being used for API calls.<br><strong>How to Install it?</strong></p><p>1. Click on “Manage Nuget Package” for your solution/project<br> 2. Search for “ADOAdmin.AzureDevOps.Clients”<br> 3. Install it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*tm5upo-Io7hq3tQF.PNG" /></figure><p>How to use it?</p><p>1.Once you install it, in namespace as</p><p>using ADOAdmin.AzureDevOps.Clients;</p><p>2.Once you add it in the package list, create an object for RestAPIClients:</p><p>RestAPIClient adoClient = new RestAPIClient();</p><p>3. To use it for GET operations:</p><p>string _jResponse=adoClient.AzureDevOpsGet(string devOpsPat, string apiUrl)</p><p>Sample:</p><p>string auditRepsonse = adoClient.AzureDevOpsGet(adoPat, adoApiUrl = string.Format( <br> @”https://auditservice.dev.azure.com/{0}/_apis/audit/auditlog?startTime={1}&amp;endTime={2}&amp;continuationToken={3}&amp;batchSize=1000&amp;skipAggregation=true&amp;api-version=5.1-preview.1&quot;,<br> accountName, auditReadStartTime, auditReadEnddate, continuationToken));</p><p>4.To use it for POST operations:</p><p>string _jResponse=adoClient.AzureDevOpsPost(string devOpsPat, string apiUrl, string jsonData)</p><p>5.To use it for PATCH operations:</p><p>string _jResponse=adoClient.AzureDevOpsPost(string devOpsPat, string apiUrl, string jsonData)</p><p>Without much complications and googling for how you can use httpclients to call ADO API’s use can directly use these packages.</p><p>The source code for these packages can be found here: <a href="https://github.com/Arunvarriar/ado-api-usage">Ado_api_Usage</a></p><p>Hope this helps!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8696cf5d872" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build your Azure DevOps extensions with Azure Pipelines]]></title>
            <link>https://medium.com/@arunvarriar/build-your-azure-devops-extensions-with-azure-pipelines-a414dcd6b144?source=rss-4f8af59649cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/a414dcd6b144</guid>
            <category><![CDATA[azure-devops-pipeline]]></category>
            <category><![CDATA[build-extensions]]></category>
            <category><![CDATA[build]]></category>
            <category><![CDATA[azure-devops]]></category>
            <dc:creator><![CDATA[Arun Varriar]]></dc:creator>
            <pubDate>Mon, 15 Sep 2025 05:15:37 GMT</pubDate>
            <atom:updated>2025-09-15T05:15:37.701Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog I will be discussing about building azuredevops extension using an azure pipeline.</p><p>Whenever we lack some out of the box functionality in ADO, we might need to develop an ADO extension and deploy them using CI-CD.</p><p>In order to build and deploy them we have some useful extension available in marketplace. These extension tasks helps in smoothly building and deploying an extension. They are:</p><ol><li><a href="https://marketplace.visualstudio.com/items?itemName=ms-devlabs.vsts-developer-tools-build-tasks">Azure DevOps Extension Tasks</a> : This extension helps in building and publishing your extension. This is developed my Microsoft DevLabs</li><li><a href="https://marketplace.visualstudio.com/items?itemName=maikvandergaag.maikvandergaag-versioncounter">Version Number Counter</a> : This task helps in incrementing the version number of the extension.</li></ol><p>Create your build pipeline:</p><p>1.Use the classic editor pipeline and select your repository:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*PQjt_Et7VuxUGiVP.PNG" /></figure><p>2.For building the extension I am going to use the below tasks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*tRBMxv3H7YIS5_pK.PNG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/0*QUAKVSqFhrF___Ue.PNG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/0*38EwUrdKL6-dZZKs.PNG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*9QIUMcNcQcy-32H9.PNG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/0*Xn827I5mBoG2E3Mn.PNG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/0*vRa4InmzlQGuZJlh.PNG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/0*sx4LyJlHwXSip46U.PNG" /></figure><p>Once you run the pipeline successfully, you can see the build artifacts .vsix as the inside the build artifacts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*NlOLQxpIiT3yVgGB.PNG" /></figure><p>Now you can publish this artifact to market place using another build tasks using release pipeline or extending the same pipeline, about which I will be covering in my next blog. Manual way to publish this would be download the .vsix from the artifact and manually upload and publish it to the market place.</p><p>Have fun with Azure devops!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a414dcd6b144" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monitor of AzureDevops repository policy — Create custom policy to monitor recommended repository…]]></title>
            <link>https://medium.com/@arunvarriar/monitor-of-azuredevops-repository-policy-create-custom-policy-to-monitor-recommended-repository-58e607999a54?source=rss-4f8af59649cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/58e607999a54</guid>
            <category><![CDATA[azure-devops-repo]]></category>
            <category><![CDATA[repository-policy]]></category>
            <category><![CDATA[monitor-repo-policy]]></category>
            <dc:creator><![CDATA[Arun Varriar]]></dc:creator>
            <pubDate>Tue, 09 Sep 2025 11:25:59 GMT</pubDate>
            <atom:updated>2025-09-09T11:25:59.990Z</atom:updated>
            <content:encoded><![CDATA[<h3>Monitor of AzureDevops repository policy — Create custom policy to monitor recommended repository policies are enabled</h3><p>Branch policy are always an important factor in protecting your branch and deciding the work flow. Enabling certain branch policies help you always to protect from others being contributing.</p><p>As part of quality and to protect your branches, stakeholders always recommend to align with certain git repo policies in Azure Devops. In addition to quality, it helps keep your repos from changing the code from your default branches. By default, ADO has <strong><em>Require a minimum number of </em></strong><em>reviewers, Check for linked work items, Check for comment resolution, Limit merge types, Build Validation, Status checks.</em></p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*TOFQduAOz-PAD8Wt" /></figure><p><strong>Why we need Custom policy?</strong></p><p>Generally, when a PR is raised if the default polices are enabled then it will be auto applied to a PR. But the users who have permission to alter with polices can alter them and complete the PR which can have serious security and quality impacts. So there is always a question, how to make sure/monitor that all the polices are enabled.</p><p>To overcome this, we can create a custom policy which will act as policy to monitor other policies. The advantage of custom policy is even if the custom policy is not added to repo policy as required, it will evaluate the policies applied over a repo and respond against PR as optional policy. This is because the service hook gets triggered when the PR is PR created and left part all happens in Azure and not in ADO. When the custom policy executes we can insert the repo evaluation details to a data base which can be in turn used for reporting on repo compliances.</p><p><strong>What does Custom Policy do?</strong></p><p>As mentioned, custom policy will be utilized to evaluate whether we have all recommended policies enabled over the repo. If all the policies are enabled, then custom policy will respond back to PR as passed else if will be failed. Also if the custom policy is enabled as required policy in repo settings then the user will not be able to complete the PR unless the custom policy passes based on the evaluation — result of evaluation whether we all policies enabled.</p><p><strong>How it works:</strong></p><p>Here, I am going to discuss on creating a custom policy which will make sure that all these policies are enabled for Pull request, unless the custom policy passes the developer will not be able to merge the code. The custom policy will act as mother of all policies.</p><p>There are 2 parts for the custom policy to work. I would recommend Azure function and Queue Storage to implement custom policies. First part is you need service hook which triggers when a pull request is created and add the request JSON from service hook to Queue Storage using a http trigger azure function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*25xug105qBlqwjv2.PNG" /></figure><p>Second part is a Queue triggered azure function which will trigger when an JSON reaches the Queue Storage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*ld2Eu95G6_a1EIRk.PNG" /></figure><p>When the Queue triggered Azure function runs, it fetches the JSON from Queue storage which was send from service hooks. The JSON will have details like project id, repository id and PR id. Using these data we can use PR evaluation API to get the polices applied over that PR: <a href="https://learn.microsoft.com/en-us/rest/api/azure/devops/policy/evaluations/list?view=azure-devops-rest-7.1">Evaluations PR</a> .Once the evaluation is completed, we can respond back to PR as Custom Policy : <a href="https://learn.microsoft.com/en-us/azure/devops/repos/git/create-pr-status-server-with-azure-functions?view=azure-devops">Creating Custom Policy</a>.</p><p>Hope this idea helps in monitoring the repository policies and protect your branch!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58e607999a54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Get Notified when a Azure DevOps Project is Created or Deleted!]]></title>
            <link>https://medium.com/@arunvarriar/how-to-get-notified-when-a-azure-devops-project-is-created-or-deleted-964a397754b2?source=rss-4f8af59649cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/964a397754b2</guid>
            <category><![CDATA[project-creation]]></category>
            <category><![CDATA[notifications]]></category>
            <category><![CDATA[delete-project]]></category>
            <category><![CDATA[azure-devops-project]]></category>
            <dc:creator><![CDATA[Arun Varriar]]></dc:creator>
            <pubDate>Tue, 09 Sep 2025 11:23:45 GMT</pubDate>
            <atom:updated>2025-09-09T11:23:45.711Z</atom:updated>
            <content:encoded><![CDATA[<p>We have been working with Azure DevOps to get notifications and found no ways to get info of the projects getting deleted and created(by some other collection admins!!).Main reason to get the notifications was as the project admins have the privilege to delete their project, so monitoring of the deletion in an automated way was necessary. Apart from this if we have multiple collection admins then, it is suggested all to be aware of what is happening in an ADO at collection level. I would always recommend the collection level admins to be maintained as low number as 2–4 people.</p><p>To monitor this, the only way was read the audit from ADO audit Logs. So the best way we found was to write a timer triggered job which runs on a daily basis and reads the audit for project created and deleted, then notifies the collection admins through Email or through the Teams Channel.</p><p>To get the audits of the Azure DevOps you can use the <a href="https://docs.microsoft.com/en-us/rest/api/azure/devops/audit/audit%20log/query?view=azure-devops-rest-5.1">Audit API</a>:</p><p>The above example fetched the audit log for last 24 hrs from 13/06/2020 12:31PM to 14/06/2020 12:31PM.</p><p>Press enter or click to view image in full size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*AyAEofKu1knWHeEq.png" /></figure><p>The decoratedAuditLogEntries contains all the log details. We just need to read each attributes of the depending on the length of the decoratedAuditLogEntries. For example here the lenth of decoratedAuditLogEntries is 94. So we may need to check all the 94 entries inside it.All the actions perfromed in Azure DevOps is logged in decoratedAuditLogEntries with an action id. So we can easily get the action id for project created and deleted.</p><p>Now for project creation ,decoratedAuditLogEntries will have its actionId as Project.CreateCompleted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*-U0afiKdTVXNawU2.png" /></figure><p>If you can get the action Id “Project.CreateCompleted” from response json, then you can read the project name, Id and other details.</p><p>Similarly for Project deletion , decoratedAuditLogEntries will have its actionId as Project.SoftDeleteCompleted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*fd7lOdi8XgznY3yE.png" /></figure><p>If you can get the action Id “Project.SoftDeleteCompleted” from response json, then you can read the project name, operation time and other details.</p><p>Once you get all the details from Project.SoftDeleteCompleted and Project.CreateCompleted for deleted and created projects, you can use some notification method via email or to your organisation Teams channel.</p><p>The important thing to note here at times the log could be large, so we may have to use the continuation token and hasMore property from the API response.</p><p>Here we need to check whether “hasMore” property is true or not, if its true then we need to check for the continuationToken and the pass it with the API each time.</p><p>Enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=964a397754b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure devops — Save Up to 75% Cost — Smart Test Plan License Manager]]></title>
            <link>https://medium.com/@arunvarriar/smart-test-plan-license-manager-5ec58e3b135c?source=rss-4f8af59649cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ec58e3b135c</guid>
            <category><![CDATA[how-to-save-cost-in-ado]]></category>
            <category><![CDATA[test-plan-license-manager]]></category>
            <category><![CDATA[licensemanager]]></category>
            <category><![CDATA[ado-cost-saving]]></category>
            <category><![CDATA[azure-devops-cost-saving]]></category>
            <dc:creator><![CDATA[Arun Varriar]]></dc:creator>
            <pubDate>Thu, 08 May 2025 13:44:38 GMT</pubDate>
            <atom:updated>2025-09-24T12:55:16.955Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Revolutionize Azure DevOps Licensing and Save Up to 75%</strong></h3><p>Managing licenses in Azure DevOps can be a costly affair — especially when it comes to the Basic + Test Plans license tier. But what if you could cut those costs by up to 75% without compromising access for your QA teams?<br> In this blog, we’ll explore a smarter, more efficient licensing model that leverages on-demand provisioning and automation to dramatically reduce your Azure DevOps expenses.</p><h3><strong>Understanding Azure DevOps Licensing</strong></h3><p><strong>Azure DevOps offers several access levels based on user roles:<br> </strong>— Stakeholder — Free<br> — Basic — $5/user/month<br> — Basic + Test Plans — $52/user/month<br> — Visual Studio Subscriber — Included with VS subscriptions<br> <br> Official Pricing Reference: <a href="https://azure.microsoft.com/en-us/pricing/details/devops/azure-devops-services/">pricing azure-devops-services</a></p><p><strong>The Basic + Test Plans license is essential for QA engineers who need to:</strong><br> — Create and manage test plans and test suites<br> — Author test cases using the grid view or Test Runner<br> — Organize test cases (assign, move, reorder)<br> — Assign configurations or testers<br> — Manage User Acceptance Testing (UAT)</p><h3><strong>The Problem with Traditional Licensing</strong></h3><p>Most organizations assign licenses based on group rules or static access policies, which often leads to over-licensing. QA engineers may be assigned the expensive Test Plan license even if they only need it occasionally.</p><p><strong>Introducing On-Demand Licensing</strong></p><p>With Azure DevOps, you can now implement on-demand licensing using a custom extension and automation. Here’s how it works:</p><p><strong>1.</strong> <strong>License Storage</strong></p><p>You maintain a user list (storage) of those who require the Basic + Test Plans license. Once added, they can always upgrade their license whenever they want.</p><p><strong>2.</strong> <strong>Daily Downgrade Automation</strong></p><p>Using a PowerShell script scheduled via Azure DevOps pipelines, users are downgraded back to Basic daily. This leverages Microsoft’s pro-rated billing model, which charges approximately 1/31st of the monthly cost per day.</p><h4><strong>Extension Architecture</strong></h4><p>The extension includes two endpoints:</p><p>— Organization Level:</p><p>· Admins manage the list of users who need the Test Plan license.</p><p>· At Personal Access Token Settings you need to provide the PAT of collection admin who has access to upgrade the license.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*KGUnZ33NzfWYbCEpmcDQ0w.png" /></figure><p>-Project Level: A new “Test Plan License” tab is added under the Test Plans section, allowing users to request or update their license in real time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*IZZH8OaRQ6ESEnP3G8eRYg.png" /></figure><p>Here is the link to the extension: <a href="https://marketplace.visualstudio.com/items?itemName=ArunVarriar.smartacesss-license-manager">Smart Test Plan License Manager — Visual Studio Marketplace</a></p><h3><strong>Real-World Cost Savings</strong></h3><p>Let’s break it down based on a scenario:</p><p>Let assume your organization has 1000 IT engineers with 200 QA who are being assigned with Test Plan license:<br> — Traditional Cost for Test Plan: 200 × $52 = $10,400/month<br> — Smart-Access Model:<br> — 200 users on Basic: 200 × $5 = $1,000<br> — 25 users on Test Plan (average): 25 × $52 = $1,300<br> — Total: $2,300/month<br> <br> Monthly Savings:<br> $10,400 − $2,300 = $8,100 saved</p><p>That’s nearly 75% in cost reduction!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*bC217DODvEAD3QKKFaqkCA.png" /></figure><p>This isn’t just a cost-cutting hack — it’s a smarter way to manage access. Your QA team still gets what they need, when they need it. And your finance team? They’ll love you for it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ec58e3b135c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deleting Azure Devops old Git branches using API]]></title>
            <link>https://medium.com/@arunvarriar/deleting-azure-devops-old-git-branches-using-api-ae5c1268d21b?source=rss-4f8af59649cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae5c1268d21b</guid>
            <category><![CDATA[azuredevops-repo]]></category>
            <category><![CDATA[delete-old-branches]]></category>
            <category><![CDATA[delete-ado-repo-branches]]></category>
            <category><![CDATA[git-old-branches]]></category>
            <dc:creator><![CDATA[Arun Varriar]]></dc:creator>
            <pubDate>Mon, 17 Mar 2025 09:44:20 GMT</pubDate>
            <atom:updated>2025-03-18T05:50:59.868Z</atom:updated>
            <content:encoded><![CDATA[<p>Managing old and stale branches in Git can quickly become a technical debt. A plethora of undeleted feature branches can create confusion and clutter, consuming valuable space. Once this clutter accumulates, manually sorting through and deleting each branch becomes a daunting task.</p><p>To address this issue, we can automate the cleanup process using a PowerShell script. This script targets branches that haven’t had any commits before 365 days and deletes them. The timeframe is configurable, allowing organizations to set their own criteria for branch deletion.</p><pre># Variables<br>$organization = &quot;ADO Organisation&quot;<br>$project = &quot;ADO project Name&quot;<br>$repository = &quot;RepoName&quot;<br>$repositoryId=&quot;Repo Id&quot;<br>$personalAccessToken = &quot;User PAT&quot;<br>$_date = (Get-Date).AddDays(-350)  # Today&#39;s date minus 365 days<br><br># Base64-encoded PAT<br>$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(&quot;:$($personalAccessToken)&quot;))<br><br># API URL to list all branches<br>$branchesUrl = &quot;https://dev.azure.com/$organization/$project/_apis/git/repositories/$repository/refs?filter=heads/&amp;api-version=6.0&quot;<br><br># Invoke the REST API to get all branches<br>$branchesResponse = Invoke-RestMethod -Uri $branchesUrl -Method Get -Headers @{Authorization=(&quot;Basic {0}&quot; -f $base64AuthInfo)}<br><br># Loop through each branch and get the latest commit<br>foreach ($branch in $branchesResponse.value) {<br>    $branchName = $branch.name -replace &#39;^refs/heads/&#39;, &#39;&#39;<br>    $branchObjectId = $branch.objectId<br>    $commitsUrl = &quot;https://dev.azure.com/$organization/$project/_apis/git/repositories/$repository/commits?searchCriteria.itemVersion.version=$branchName&amp;`$top=1&amp;api-version=6.0&quot;<br>    <br>    # Invoke the REST API to get the latest commit for the branch<br>    $commitsResponse = Invoke-RestMethod -Uri $commitsUrl -Method Get -Headers @{Authorization=(&quot;Basic {0}&quot; -f $base64AuthInfo)}<br>    $latestCommit = $commitsResponse.value[0]<br>    $refbranchName=&quot;refs/heads/$($branchName)&quot;<br>    <br>    # Output the latest commit details for the branch<br>    Write-Output &quot;Branch: $branchName&quot;<br>    Write-Output &quot;Commit ID: $($latestCommit.commitId)&quot;<br>    Write-Output &quot;Author: $($latestCommit.author.name)&quot;<br>    Write-Output &quot;Date: $($latestCommit.author.date)&quot;<br>    Write-Output &quot;Message: $($latestCommit.comment)&quot;<br>    Write-Output &quot;----------------------------------------&quot;<br>    <br>    # Check if the latest commit date is greater than xDate<br>    $commitDate = [datetime]::Parse($latestCommit.author.date)<br>    if ($commitDate  -lt $_date) {<br>        $body = ConvertTo-Json (<br>                                    @(<br>                                        @{<br>                                            name        = $refbranchName;<br>                                            oldObjectId = $branchObjectId;<br>                                            newObjectId = &quot;0000000000000000000000000000000000000000&quot;;<br>                                        }<br>                                        )<br>                                )<br><br>        # API URL to delete the branch<br>        $deleteBranchUrl = &quot;https://dev.azure.com/$organization/$project/_apis/git/repositories/$repositoryId/refs?filter=heads/$branchName&amp;api-version=6.0&quot;<br>        $deleteResponse = Invoke-RestMethod -Uri $deleteBranchUrl -Method Post -Headers @{Authorization=(&quot;Basic {0}&quot; -f $base64AuthInfo)} -Body $body -ContentType &quot;application/json&quot;                                <br><br>        write-host &quot;Deleted branch: $deleteResponse&quot;                                <br><br>    }<br>}</pre><p>Code would need the following variables to be updated:</p><p>· personalAccessToken = Personal Access Token</p><p>· organization = the name of the organization</p><p>· project = The name of the project</p><p>· repository = the name of the repository that contains a branch</p><p>· repositoryId = The name of the branch that will be deleted</p><p>· _date= The difference of days which you want to consider as last commit date</p><p>The script retrieves all branches in the specified repository and checks their last commit dates. If a branch’s last commit date is older than a given timeframe, such as 365 days, the script will delete that branch.</p><p>Additionally, we can explore different approaches, including targeting branches based on specific naming patterns.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae5c1268d21b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Move Workitem Linked to Test Cases]]></title>
            <link>https://medium.com/@arunvarriar/move-workitem-linked-to-test-cases-0378c48d50f5?source=rss-4f8af59649cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/0378c48d50f5</guid>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[linked-work-item]]></category>
            <category><![CDATA[work-item]]></category>
            <category><![CDATA[move]]></category>
            <category><![CDATA[test-case]]></category>
            <dc:creator><![CDATA[Arun Varriar]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 11:15:35 GMT</pubDate>
            <atom:updated>2025-06-10T10:15:33.500Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, I will discuss on how we developed a new extension to address a long-standing user request for moving work items between projects in Azure DevOps (ADO) while retaining Test Case links. Many users, including myself, have faced challenges with this issue.</p><p>In an organization, we often work on multiple projects in ADO, and it’s common to move work items like bugs and stories across projects related to different products. Generally, moving work items without Test Management items (such as Test Cases and shared steps) is straightforward, thanks to Microsoft’s out-of-the-box functionality. However, moving work items that are linked to Test Management items has been problematic, as Microsoft does not provide built-in support for this scenario and throws error as below:</p><p>“VS403093: The work item xxxxx cannot be moved. Work items with links to Test Case work items cannot be moved. Please remove the work item link(s) and try again.”</p><p>The new extension <a href="https://marketplace.visualstudio.com/items?itemName=ArunVarriar.MoveworkitemExtension"><strong><em>MoveworkitemExtension </em></strong></a>we have developed solves this problem.</p><p><strong>Pre-Requisites:</strong></p><ol><li>Add a new dropdown field named TargetProject with the reference name Custom.TargetProject.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*aCnlcsktpH3UjGPT.PNG" /></figure><p>2. Populate this dropdown with all the project names in your organization, ensuring they match exactly.</p><p><strong>How it works?</strong></p><p>After installing the extension, you’ll see a “Move to Team Project” button enabled for all types of work items, except Test Cases. To move a work item with Test Case links, follow these steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*_5RScYw4zIiavtMo.PNG" /></figure><ol><li>Select the target project from the dropdown and save the work item.</li><li>Click the “Move to Team Project” button.</li></ol><p>That’s it! The work item, along with its Test Case links, will be moved to the selected project.</p><p><strong>Idea Behind the Extension</strong></p><p>Since directly moving work items with Test Case links isn’t possible, our extension first unlinks the Test Cases from the work item. After unlinking, it updates the area path and iteration path of the work item to match the target project’s area path. Once these updates are made, the extension relinks all the Test Cases to the work item, preserving their link types. Other links remain unchanged during this process.</p><p>For work items without Test Case links, the extension works similarly. Simply select the target project and click the “Move to Team Project” button. The area path and iteration path will be updated accordingly.</p><p><strong>Permissions Needed</strong></p><p>Lastly, you’ll need specific permissions to perform this action.</p><ol><li>Move work items out of the project: This permission must be allowed in the source project for the user who wants to move the work item to another project.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*QMwe0DtIvWYJv7Zb.png" /></figure><p>2. Create and edit work items: The user must have these permissions in the target project.</p><p>These permissions are also required when using Microsoft’s out-of-the-box functionality, so they should be familiar to most users</p><p><strong>Exceptions:</strong></p><p>The process templates for both the source and target projects should be similar. They don’t need to be identical or have the same fields, but the target project should not have any new mandatory fields. If the target project has any new mandatory fields while moving the item, an error message will be displayed.</p><p>Add on: Do you want to save cost for Azure devops: <a href="https://medium.com/@arunvarriar/smart-test-plan-license-manager-5ec58e3b135c">https://medium.com/@arunvarriar/smart-test-plan-license-manager-5ec58e3b135c</a><br>Marketplace: <a href="https://marketplace.visualstudio.com/items?itemName=ArunVarriar.smartacesss-license-manager">https://marketplace.visualstudio.com/items?itemName=ArunVarriar.smartacesss-license-manager</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0378c48d50f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>