<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Azure on Ajo Mathew</title><link>https://blog.ajomathew.dev/tags/azure/</link><description>Recent content in Azure on Ajo Mathew</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Tue, 25 Nov 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.ajomathew.dev/tags/azure/rss.xml" rel="self" type="application/rss+xml"/><item><title>A Practical Guide to Handling Azure Alerts During Planned Maintenance</title><link>https://blog.ajomathew.dev/posts/2025-11-25-a-practical-guide-to-handling-azure-alerts-during-planned-maintenance/</link><pubDate>Tue, 25 Nov 2025 00:00:00 +0000</pubDate><guid>https://blog.ajomathew.dev/posts/2025-11-25-a-practical-guide-to-handling-azure-alerts-during-planned-maintenance/</guid><description>&lt;h1 id="problem-description"&gt;Problem description&lt;/h1&gt;
&lt;p&gt;Availability alerts for VMs in a resource group were configured. During planned maintenance (for example, a VM reboot), the team receives VM availability notifications that are false positives. How can we avoid or resolve these false alarms?&lt;/p&gt;
&lt;h1 id="approaches"&gt;Approaches&lt;/h1&gt;
&lt;p&gt;The alert in question uses VM availability metrics evaluated every 1 minute with a 5‑minute lookback window.&lt;/p&gt;
&lt;h2 id="option-1--disable-the-alert-during-the-maintenance-window"&gt;Option 1 — Disable the alert during the maintenance window&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;When you stop the VM, disable the alert.&lt;/li&gt;
&lt;li&gt;When you start the VM, re-enable the alert.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is a simple approach but requires coordinating the start/stop process with alert management.&lt;/p&gt;</description></item><item><title>Azure Container Groups for hosting</title><link>https://blog.ajomathew.dev/posts/2023-05-22-azure-aci-limitations/</link><pubDate>Mon, 22 May 2023 00:00:00 +0000</pubDate><guid>https://blog.ajomathew.dev/posts/2023-05-22-azure-aci-limitations/</guid><description>&lt;p&gt;Few days ago I was in need of a quick and easy option to host few containers with Azure for one of my Demos. I didn’t want to go with the headache of having an AKS or VM with docker installed. So I picked ACI ( Azure Container Instance ) with an nginx vm for reverse proxy – Since this was to be presented quick we we went the dirty way.&lt;/p&gt;</description></item><item><title>Use Azure NSG and Azure Service Tags to block internet and allow to Azure Portal</title><link>https://blog.ajomathew.dev/posts/2023-02-27-azure-nsg-allow-only-portal/</link><pubDate>Mon, 27 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.ajomathew.dev/posts/2023-02-27-azure-nsg-allow-only-portal/</guid><description>&lt;p&gt;My Client got a requirement to block internet access inside a Subnet \ Vnet only using NSG and allow connection only to Azure Portal.&lt;/p&gt;
&lt;p&gt;Client is using Azure Private Endpoints to enable private access to Azure Storage , Databricks and other services hence other resource access from within the VMs inside VM is working as expected.&lt;/p&gt;
&lt;p&gt;The requirement from security team is to lock Azure Vnet &amp;amp; Subnet from internet and enable only direct Portal access.&lt;/p&gt;</description></item><item><title>Azure DevOpos pipeline Yaml variables not substituting azureResourceManagerConnection</title><link>https://blog.ajomathew.dev/posts/2022-03-03-azure-devops-yaml-vars/</link><pubDate>Thu, 03 Mar 2022 00:00:00 +0000</pubDate><guid>https://blog.ajomathew.dev/posts/2022-03-03-azure-devops-yaml-vars/</guid><description>&lt;p&gt;While setting up an Azure ARM deployment pipeline using yaml. Below is my &lt;code&gt;template.yaml&lt;/code&gt; file&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;parameters&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;azRMConnection&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;type&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;string&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;subscriptionID&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;type&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;string&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;resourceGroupName&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;type&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;string&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;deploymentLocation&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;type&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;string&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;default&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#34;[resourceGroup().location]&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;armTemplateFilePath&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;type&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;string&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;armTemplateParameterFilePath&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;type&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;string&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;name&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;overrideParameters&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;type&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;string&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;steps&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#f92672"&gt;task&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;AzureResourceManagerTemplateDeployment@3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;displayName&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#34;ARM Template Deployment&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;inputs&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;deploymentScope&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#39;Resource Group&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;azureResourceManagerConnection&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#39;${{parameters.azRMConnection}}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;deploymentMode&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Incremental&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;subscriptionId&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;${{parameters.subscriptionID}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;action&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#39;Create Or Update Resource Group&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;resourceGroupName&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;${{parameters.resourceGroupName}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;location&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;${{parameters.deploymentLocation}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;templateLocation&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;Linked artifact&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;csmFile&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;${{parameters.armTemplateFilePath}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;csmParametersFile&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;${{parameters.armTemplateParameterFilePath}}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;overrideParameters&lt;/span&gt;: &lt;span style="color:#e6db74"&gt;&amp;#34;${{parameters.overrideParameters}}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And this is my actual &lt;code&gt;main.yaml&lt;/code&gt; looks like&lt;/p&gt;</description></item><item><title>Azure ARM template copy function - Using Objects as parameters with multiple resource properties</title><link>https://blog.ajomathew.dev/posts/2021-10-30-azure-arm-copy/</link><pubDate>Sat, 30 Oct 2021 00:00:00 +0000</pubDate><guid>https://blog.ajomathew.dev/posts/2021-10-30-azure-arm-copy/</guid><description>&lt;p&gt;I was following this &lt;a href="https://docs.microsoft.com/en-us/azure/architecture/guide/azure-resource-manager/advanced-templates/objects-as-parameters" target="_blank" rel="noopener"&gt;Azure Document&lt;/a&gt; to try out Azure ARM copy operation to loop through properties of an azure resource. Looks like the page was not updated correctly so I raised an issue with the &lt;a href="https://docs.microsoft.com/en-us/azure/architecture/guide/azure-resource-manager/advanced-templates/objects-as-parameters" target="_blank" rel="noopener"&gt;MS Docs github page&lt;/a&gt;. This was just minor change - where NSG properties were not correctly reprsented in that example document.
You can follow below correct ARM templates.&lt;/p&gt;
&lt;h3 id="arm-template"&gt;ARM template&lt;/h3&gt;
&lt;p&gt;{% gist 659a893a3a941d72f824e0f703c13fda %}&lt;/p&gt;
&lt;h3 id="parameter"&gt;Parameter&lt;/h3&gt;
&lt;p&gt;{% gist c4bcdc862196719e79c010d1d61dc4d9 %}&lt;/p&gt;</description></item><item><title>Azure Container Groups for hosting ?</title><link>https://blog.ajomathew.dev/posts/2020-07-25-aci-biggest/</link><pubDate>Sat, 25 Jul 2020 00:00:00 +0000</pubDate><guid>https://blog.ajomathew.dev/posts/2020-07-25-aci-biggest/</guid><description>&lt;p&gt;Few days ago I was in need of a quick and easy option to host few containers with Azure for one of my Demos. I didn&amp;rsquo;t want to go with the headache of having an AKS or VM with docker installed. So I picked ACI ( Azure Container Instance ) with an nginx vm for reverse proxy - Since this was to be presented quick we we went the dirty way.&lt;/p&gt;</description></item><item><title>Uninstall Az Powershell Module forcefully and completely</title><link>https://blog.ajomathew.dev/posts/2020-06-08-uninstall-az-powershell-module-forcefully-and-completely/</link><pubDate>Mon, 08 Jun 2020 00:00:00 +0000</pubDate><guid>https://blog.ajomathew.dev/posts/2020-06-08-uninstall-az-powershell-module-forcefully-and-completely/</guid><description>&lt;p&gt;I&amp;rsquo;m primarily using PowerShell to address Azure automation activities from running from local to Azure itself. The most painful task encountered is about upgrading PowerShell Az modules and making it work with VsCode.&lt;/p&gt;
&lt;p&gt;After many trial and error, this is the best method I could recommend to uninstall the PowerShell Az module.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Get-installedmodule Az.*| foreach-object{Uninstall-Module -Name $_.Name -Verbose -AllVersions -force}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you encounter running the above code snippet from the no-Admin account, switch to the Admin account. Incase Az.Accounts module is adamant in getting uninstalled, open a cmd - As Administrator and run below command. This will rid your system of Az modules.&lt;/p&gt;</description></item><item><title>After (lot of ) Hacks - A working way to deploying Azure SQL on Virtual Machine using terraform</title><link>https://blog.ajomathew.dev/2020/05/25/lot-of-hacks-to-deploy-terraform-azure-sql-vm/</link><pubDate>Mon, 25 May 2020 00:00:00 +0000</pubDate><guid>https://blog.ajomathew.dev/2020/05/25/lot-of-hacks-to-deploy-terraform-azure-sql-vm/</guid><description>&lt;p&gt;I am very new with terraform. I was trying out terraform to deploy an SQL VM to Azure. SQL VM in Azure has undergone many changes recently from using &lt;code&gt;SqlVmIaasExtension&lt;/code&gt; to manage SQL VM instance to a new resource type &lt;a href="https://github.com/Azure/azure-quickstart-templates/blob/master/101-sql-vm-new-storage/azuredeploy.json" target="_blank" rel="noopener"&gt;&lt;code&gt;Microsoft.SqlVirtualMachine/SqlVirtualMachines&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To implement &lt;a href="https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sql/virtual-machines-windows-sql-performance#disks-guidance" target="_blank" rel="noopener"&gt;the best practice&lt;/a&gt; of SQL, we had to fall to PowerShell DSC. Now Azure natively support &lt;a href="https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sql/virtual-machines-windows-sql-server-storage-configuration" target="_blank" rel="noopener"&gt;disk management(new Storage Type)&lt;/a&gt; via SqlVirtualMachine resource type.&lt;/p&gt;
&lt;p&gt;I wanted to get new Storage type implemented via terraform &lt;a href="https://www.terraform.io/docs/providers/azurerm/r/mssql_virtual_machine.html" target="_blank" rel="noopener"&gt;&lt;code&gt;azurerm_mssql_virtual_machine&lt;/code&gt;&lt;/a&gt;. This resource in terraform under module &lt;code&gt;azurerm&lt;/code&gt; supports everything except new storage types.&lt;/p&gt;</description></item><item><title>Linux Log Rotate and archive rotated file.</title><link>https://blog.ajomathew.dev/posts/2018-05-08-linux-log-rotate-and-archive-rotated-file/</link><pubDate>Tue, 08 May 2018 00:00:00 +0000</pubDate><guid>https://blog.ajomathew.dev/posts/2018-05-08-linux-log-rotate-and-archive-rotated-file/</guid><description>&lt;p&gt;I was checking an article on how to upload archived logs to azure blob.
As initial set up I&amp;rsquo;ve updated logrotate.conf(&lt;code&gt;/etc/logrotate.conf&lt;/code&gt;) with below settings.&lt;/p&gt;
&lt;h4 id="file-to-edit"&gt;file to edit:&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;/etc/logrotate.conf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;{% gist 5d2a8a1bf8cb0f619b45a39785dee395 %}&lt;/p&gt;
&lt;p&gt;Then updated syslog rotate config to test on how messages files can be archived. Make sure the destination path is created. In this case I&amp;rsquo;ve got &lt;code&gt;/opt/logs/&lt;/code&gt; referenced.
&lt;em&gt;file edited&lt;/em&gt;
&lt;code&gt;/opt/logrotate.d/syslog&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;{% gist bacb68f7f66e346d1d80f2a934c00856 %}&lt;/p&gt;
&lt;p&gt;This will ensure the last rotated log file would be copied to /opt/logs/. You can have any other scripts configured to upload to blob from here.
Once these settings are in place test run(force run) &lt;em&gt;logrotate -f /etc/logrotate.conf&lt;/em&gt;.
Result of the operation can be found below&lt;/p&gt;</description></item></channel></rss>