<?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 Balakrishna Topuri on Medium]]></title>
        <description><![CDATA[Stories by Balakrishna Topuri on Medium]]></description>
        <link>https://medium.com/@balakrishna.azure?source=rss-a77462e98679------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*eBZe2cBtC9SU5paQ</url>
            <title>Stories by Balakrishna Topuri on Medium</title>
            <link>https://medium.com/@balakrishna.azure?source=rss-a77462e98679------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 03:42:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@balakrishna.azure/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[From Chat Prompt to SAP Infrastructure: Understanding SDAF Ops on Azure]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">How AI-assisted configuration and Infrastructure as Code can simplify SAP system deployment</p><p class="medium-feed-link"><a href="https://medium.com/@balakrishna.azure/from-chat-prompt-to-sap-infrastructure-understanding-sdaf-ops-on-azure-94d726c8b03f?source=rss-a77462e98679------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@balakrishna.azure/from-chat-prompt-to-sap-infrastructure-understanding-sdaf-ops-on-azure-94d726c8b03f?source=rss-a77462e98679------2</link>
            <guid isPermaLink="false">https://medium.com/p/94d726c8b03f</guid>
            <dc:creator><![CDATA[Balakrishna Topuri]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 05:42:54 GMT</pubDate>
            <atom:updated>2026-10-25T05:42:54.699Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Enable Microsoft Entra login for a Linux VM in Azure]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@balakrishna.azure/enable-microsoft-entra-login-for-a-linux-vm-in-azure-79f1fa60cb58?source=rss-a77462e98679------2"><img src="https://cdn-images-1.medium.com/max/1200/0*o554Lw8n1C19LIP8.gif" width="1200"></a></p><p class="medium-feed-snippet">Improve the security of Azure Linux virtual machines (VMs) or Azure Arc-enabled Linux servers, you can integrate with Microsoft Entra&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@balakrishna.azure/enable-microsoft-entra-login-for-a-linux-vm-in-azure-79f1fa60cb58?source=rss-a77462e98679------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@balakrishna.azure/enable-microsoft-entra-login-for-a-linux-vm-in-azure-79f1fa60cb58?source=rss-a77462e98679------2</link>
            <guid isPermaLink="false">https://medium.com/p/79f1fa60cb58</guid>
            <dc:creator><![CDATA[Balakrishna Topuri]]></dc:creator>
            <pubDate>Wed, 14 May 2025 09:26:05 GMT</pubDate>
            <atom:updated>2025-05-14T09:51:46.034Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Assign the LCM policy using the bicep on the azure blob storage account]]></title>
            <link>https://medium.com/@balakrishna.azure/assign-the-lcm-policy-using-the-bicep-on-the-azure-blob-storage-account-faf698e9527b?source=rss-a77462e98679------2</link>
            <guid isPermaLink="false">https://medium.com/p/faf698e9527b</guid>
            <dc:creator><![CDATA[Balakrishna Topuri]]></dc:creator>
            <pubDate>Sun, 25 Aug 2024 05:25:08 GMT</pubDate>
            <atom:updated>2024-08-25T05:27:36.908Z</atom:updated>
            <content:encoded><![CDATA[<p>lifecycle management (LCM) policy using Bicep to help manage costs by optimizing blob storage, you can define a policy that transitions blobs to a lower access tier or deletes them based on their age and access patterns. This setup helps manage costs by reducing the amount of storage used and moving older or less frequently accessed data to more cost-effective storage tiers.</p><p>Here’s a Bicep template to create a storage account with a lifecycle management policy that deletes blobs not accessed for more than 30 days:</p><pre>resource &lt;Policy name&gt; &#39;Microsoft.Storage/storageAccounts/lifecycleManagementPolicies@2023-01-01&#39; = {<br>  name: &#39;default&#39;<br>  parent: &lt;your storage account name resource&gt;<br>  properties: {<br>    rules: [<br>      {<br>        name: &#39;Policy name&#39;<br>        filters: {<br>          blobTypes: [<br>            &#39;blockBlob&#39;<br>          ]<br>        }<br>        actions: {<br>          baseBlob: {<br>            delete: {<br>              daysAfterModificationsGreaterThan: 30<br>            }<br>          }<br>      prefixMatch: [<br>        &quot;mylifecyclecontainer/log&quot;<br>      ]<br>        }<br>        enabled: true<br>      }<br>    ]<br>  }<br>}<br></pre><h3>Deployment Instructions</h3><ol><li>Save the Bicep template to a file, for example, storage-account.bicep.</li><li>Deploy the Bicep template using the Azure CLI:</li></ol><pre>az deployment group create --resource-group &lt;your-resource-group&gt; --template-file storage-account.bicep</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=faf698e9527b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scheduled Events for Linux VMs]]></title>
            <link>https://medium.com/@balakrishna.azure/scheduled-events-for-linux-vms-e06cbf3f891a?source=rss-a77462e98679------2</link>
            <guid isPermaLink="false">https://medium.com/p/e06cbf3f891a</guid>
            <dc:creator><![CDATA[Balakrishna Topuri]]></dc:creator>
            <pubDate>Sun, 25 Aug 2024 04:34:10 GMT</pubDate>
            <atom:updated>2024-08-25T04:34:10.491Z</atom:updated>
            <content:encoded><![CDATA[<p>Scheduled Events is an Azure Metadata Service that gives your application time to prepare for virtual machine (VM) maintenance. It provides information about upcoming maintenance events (for example, reboot) so that your application can prepare for them and limit disruption. It’s available for all Azure Virtual Machines types, including PaaS and IaaS on both Windows and Linux.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*hrDec4KFQbHkzuv6VWrznA.png" /></figure><p>Below Endpoint to ack the request of events are occur</p><p><a href="http://169.254.169.254/metadata/scheduledevents?api-version=2020-07-01">http://169.254.169.254/metadata/scheduledevents?api-version=2020-07-01</a></p><p>There are two types of VM maintenance:</p><ul><li><strong>Planned maintenance</strong> events are periodic updates made by Microsoft to the underlying Azure platform. Most of these updates are totally transparent to customers. However, some maintenance may result in brief freezes or performances degradation, and on very rare occasions, a reboot might be required.</li><li><strong>Unplanned maintenance</strong> events occur when the hardware or physical infrastructure underlying your VM has been faulted in some way. When such a failure <a href="https://azure.microsoft.com/en-us/blog/improving-azure-virtual-machine-resiliency-with-predictive-ml-and-live-migration/">will occurs, thanks to predictive ML</a>, the Azure platform automatically migrates (live migration) your VM from the unhealthy physical host to a new, healthy physical host.</li></ul><p>In cases where Live Migration can’t be used, the VM experiences unexpected downtime (reboot).</p><h3>Azure — Palette of choices to apply updates depending on update &amp; constraints</h3><p>To go further into detail, Azure uses <a href="https://azure.microsoft.com/en-us/blog/advancing-noimpact-and-lowimpact-maintenance-technologies/">different techniques</a> for updates depending on the type of update and the constraints to ensure that updates are minimally impactful:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zvzPxlRk1kXqhvsAD33GNw.png" /></figure><ul><li><strong>Hot Patching</strong> — This provides the ability to make targeted changes to running code without downtime. All new invocations of a function on the host are redirected to an updated version of that function.</li><li><strong>Live migration</strong> — This involves moving a running customer VM from one host to another.</li><li>The VM’s local state is moved while it is still running.</li><li>It can be used to move guest VMs onto different hosts preemptively when <a href="https://azure.microsoft.com/en-us/blog/improving-azure-virtual-machine-resiliency-with-predictive-ml-and-live-migration/">Azure Machine Learning algorithms predict an impending hardware failure</a>.</li><li>Eligible VMs: ~90% (except for G, L, M, N and H series)</li><li>Link: <a href="https://azure.microsoft.com/en-us/blog/improving-azure-virtual-machine-resiliency-with-predictive-ml-and-live-migration/">How live migration works behind the scenes</a></li><li><strong>VM-PHU</strong> — Virtual Machine Preserving Host Update</li><li>This suspends VMs in memory, soft reboots the OS, resumes the VMs.</li><li>This is the most impactful non-rebootful update, but fortunately, this is the least common.</li></ul><h3>1) Catch scheduled events 15 minutes prior to pause</h3><p><a href="https://learn.microsoft.com/en-us/azure/virtual-machines/linux/scheduled-events">Schedule Events</a> is an <a href="https://learn.microsoft.com/en-us/azure/virtual-machines/instance-metadata-service?tabs=linux">Azure Instance Metadata Service (IMDS)</a> API that gives your application time to prepare for VM maintenance. It provides up to 15 minute advance notice prior to maintenance events (Reboot, Redeploy, Freeze, Preempt, Terminate) so that your application can prepare for them and limit disruption:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*-x-JWDcjp2MAGMiq6rVjYg.png" /></figure><h3>How to diagnose disruptions to VM availability?</h3><p>There are 2 ways to avoid the Scheduled event of VM unavailability</p><ol><li>enable the below process if the cluster was running on server</li><li>each VM level we can ack the scheduled event using the python script and enable the monitor from azure monitor</li></ol><p><strong>Below the steps to avoid the impact of the application running on SAP JAVA application which is configured for PCS cluster</strong></p><p>Azure offers <a href="https://learn.microsoft.com/en-us/azure/virtual-machines/linux/scheduled-events">scheduled events</a>. Scheduled events are sent via the metadata service and allow time for the application to prepare for such events.</p><p>The Pacemaker resource agent azure-events-az monitors for scheduled Azure events. If events are detected and the resource agent determines that another cluster node is available, it sets a cluster health attribute.</p><p>When the cluster health attribute is set for a node, the location constraint triggers and all resources with names that don’t start with health- are migrated away from the node with the scheduled event. After the affected cluster node is free of running cluster resources, the scheduled event is acknowledged and can execute its action, such as a restart.</p><ol><li>[A] Make sure that the package for the azure-events-az agent is already installed and up to date.</li></ol><ul><li>RHEL 8.x: sudo dnf info resource-agents</li><li>RHEL 9.x: sudo dnf info resource-agents-cloud</li></ul><p>Minimum version</p><ul><li>RHEL 8.4: resource-agents-4.1.1-90.13</li><li>RHEL 8.6: resource-agents-4.9.0-16.9</li><li>RHEL 8.8: resource-agents-4.9.0-40.1</li><li>RHEL 9.0: resource-agents-cloud-4.10.0-9.6</li><li>RHEL 9.2 and newer: resource-agents-cloud-4.10.0-34.1</li></ul><ol><li>Configure the resources in Pacemaker.</li></ol><pre>sudo pcs property set maintenance-mode=true</pre><p>Set the Pacemaker cluster health-node strategy and constraint.</p><pre>pcs property set node-health-strategy=custom  sudo pcs constraint location &#39;regexp%!health-.*&#39; \ rule score-attribute=&#39;#health-azure&#39; \ defined &#39;#uname&#39;</pre><p>Don’t define any other resources in the cluster starting with health- besides the resources described in the next steps.</p><p>Set the initial value of the cluster attributes. Run for each cluster node and for scale-out environments including majority maker VM.</p><pre>sudo crm_attribute --node &lt;primary clster server name&gt; --name &#39;#health-azure&#39; --update 0 <br>sudo crm_attribute --node &lt;secondary &lt;cluster name&gt; &#39;#health-azure&#39; --update 0</pre><p>Configure the resources in Pacemaker. Make sure the resources start with health-azure.</p><pre>sudo pcs resource create health-azure-events \ ocf:heartbeat:azure-events-az \ op monitor interval=10s timeout=240s \ op start timeout=10s start-delay=90s  sudo pcs resource clone health-azure-events allow-unhealthy-nodes=true failure-timeout=120</pre><p>Take the Pacemaker cluster out of maintenance mode.</p><pre>sudo pcs property set maintenance-mode=false</pre><p>Clear any errors during enablement and verify that the health-azure-events resources have started successfully on all cluster nodes.</p><pre>pcs resource cleanup</pre><p>First-time query execution for scheduled events <a href="https://learn.microsoft.com/en-us/azure/virtual-machines/linux/scheduled-events#enabling-and-disabling-scheduled-events">can take up to two minutes</a>. Pacemaker testing with scheduled events can use reboot or redeploy actions for the cluster VMs. For more information</p><p><strong>Below Steps need to configure form the VM level to acknowledge the scheduled</strong></p><p>below python script need to copy from the server and add on the crontab to run every minute to check the status</p><pre>import requests<br>import json<br>import datetime<br>import base64<br>import hashlib<br>import hmac<br><br># Constants<br>METADATA_URL = &#39;http://169.254.169.254/metadata/scheduledevents?api-version=2020-07-01&#39;<br>LOG_ANALYTICS_WORKSPACE_ID = &#39;your_workspace_id&#39;<br>LOG_ANALYTICS_PRIMARY_KEY = &#39;your_primary_key&#39;<br>LOG_ANALYTICS_LOG_TYPE = &#39;your_log_type&#39;<br>ACKNOWLEDGE_EVENT_URL = &#39;http://169.254.169.254/metadata/scheduledevents/{event_id}/acknowledge?api-version=2020-07-01&#39;<br><br>def fetch_scheduled_events():<br>    headers = {&#39;Metadata&#39;: &#39;true&#39;}<br>    response = requests.get(METADATA_URL, headers=headers)<br>    response.raise_for_status()<br>    return response.json()<br><br>def acknowledge_event(event_id):<br>    url = ACKNOWLEDGE_EVENT_URL.format(event_id=event_id)<br>    headers = {&#39;Metadata&#39;: &#39;true&#39;}<br>    response = requests.post(url, headers=headers)<br>    response.raise_for_status()<br>    return response.json()<br><br>def send_data_to_log_analytics(message):<br>    time = datetime.datetime.utcnow().isoformat()<br>    body = {<br>        &quot;Time&quot;: time,<br>        &quot;Message&quot;: message<br>    }<br>    <br>    json_body = json.dumps(body)<br>    content_length = str(len(json_body))<br>    json_bytes = json_body.encode(&#39;utf-8&#39;)<br>    signature = generate_signature(content_length, json_body)<br>    <br>    headers = {<br>        &#39;Content-Type&#39;: &#39;application/json&#39;,<br>        &#39;Authorization&#39;: signature,<br>        &#39;Log-Type&#39;: LOG_ANALYTICS_LOG_TYPE<br>    }<br>    <br>    url = f&#39;https://{LOG_ANALYTICS_WORKSPACE_ID}.ods.opinsights.azure.com/api/logs?api-version=2016-04-01&#39;<br>    response = requests.post(url, headers=headers, data=json_bytes)<br>    response.raise_for_status()<br>    return response.json()<br><br>def generate_signature(content_length, json_body):<br>    date = datetime.datetime.utcnow().strftime(&#39;%a, %d %b %Y %H:%M:%S GMT&#39;)<br>    string_to_hash = f&quot;POST\n{content_length}\napplication/json\nx-ms-date:{date}\n/api/logs&quot;<br>    <br>    key = base64.b64decode(LOG_ANALYTICS_PRIMARY_KEY)<br>    hashed = hmac.new(key, string_to_hash.encode(&#39;utf-8&#39;), hashlib.sha256)<br>    signature = &#39;SharedKey {}:{}&#39;.format(LOG_ANALYTICS_WORKSPACE_ID, base64.b64encode(hashed.digest()).decode(&#39;utf-8&#39;))<br>    <br>    return signature<br><br>def main():<br>    # Fetch events<br>    events = fetch_scheduled_events()<br>    print(&quot;Scheduled Events:&quot;, events)<br>    <br>    # Process each event<br>    for event in events.get(&#39;events&#39;, []):<br>        event_id = event[&#39;eventId&#39;]<br>        print(f&quot;Acknowledging event {event_id}&quot;)<br>        acknowledge_event(event_id)<br>        <br>        # Send event info to Log Analytics<br>        message = f&quot;Event {event_id} acknowledged at {datetime.datetime.utcnow().isoformat()}&quot;<br>        print(f&quot;Sending to Log Analytics: {message}&quot;)<br>        send_data_to_log_analytics(message)<br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><h3>Configuring Alerts Using Azure Monitor</h3><h3>1. Create a Data Collection Endpoint (DCE)</h3><ol><li><strong>Log in to the Azure Portal</strong>: Go to the Azure portal at <a href="https://portal.azure.com/">portal.azure.com</a>.</li><li><strong>Navigate to Azure Monitor</strong>:</li></ol><ul><li>In the left-hand menu, select <strong>Monitor</strong>.</li></ul><ol><li><strong>Create a Data Collection Endpoint</strong>:</li></ol><ul><li>In the Monitor blade, select <strong>Data Collection Endpoints</strong> under the <strong>Settings</strong> section.</li><li>Click <strong>+ Create</strong> to start a new endpoint.</li><li>Provide a name for the endpoint and select the <strong>Resource Group</strong> where you want to place it.</li><li>Configure other settings as needed, then click <strong>Review + create</strong> and <strong>Create</strong>.</li></ul><ol><li><strong>Note the Endpoint Information</strong>:</li></ol><ul><li>After the creation, go to the Data Collection Endpoint you just created and note down the <strong>Endpoint ID</strong> and <strong>Primary Key</strong>. You’ll need these for setting up the Data Collection Rule.</li></ul><h3>2. Create a Custom Data Collection Rule (DCR) with a Custom Table</h3><p><strong>Navigate to Data Collection Rules</strong>:</p><ul><li>In the Azure Monitor blade, select <strong>Data Collection Rules</strong> under <strong>Settings</strong>.</li></ul><p><strong>Create a New Data Collection Rule</strong>:</p><ul><li>Click <strong>+ Create</strong>.</li><li>Fill in the necessary details such as name, resource group, and region.</li><li>For <strong>Data Sources</strong>, select <strong>Custom Logs</strong>.</li></ul><p><strong>Define the Custom Table</strong>:</p><ul><li>Provide a name for the custom table.</li><li>You’ll need to specify the table schema in a JSON format, which defines the structure of the data to be collected. For example:</li></ul><pre>{   &quot;TableName&quot;: &quot;CustomEvents&quot;,   &quot;Columns&quot;: [     { &quot;Name&quot;: &quot;Time&quot;, &quot;Type&quot;: &quot;datetime&quot; },     { &quot;Name&quot;: &quot;Message&quot;, &quot;Type&quot;: &quot;string&quot; }   ] }</pre><ul><li>Click <strong>Review + create</strong> and <strong>Create</strong>.</li></ul><p><strong>Associate the Data Collection Endpoint</strong>:</p><ul><li>In the Data Collection Rule settings, associate the newly created DCE by entering the Endpoint ID and Primary Key you noted earlier.</li></ul><h3>3. Create an Alert Rule</h3><p><strong>Navigate to Alerts</strong>:</p><ul><li>In the Azure Monitor blade, select <strong>Alerts</strong>.</li></ul><p><strong>Create a New Alert Rule</strong>:</p><ul><li>Click <strong>+ Create</strong> and select <strong>Alert rule</strong>.</li><li>Define the <strong>Scope</strong> by selecting the resource you want to monitor (e.g., the Data Collection Rule or another resource).</li></ul><p><strong>Define the Condition</strong>:</p><ul><li>Set up the condition based on metrics or logs. For custom tables, you can use Kusto Query Language (KQL) to define the query that triggers the alert. For example:</li></ul><pre>CustomEvents <br>| where Time &gt; ago(1h) <br>| summarize Count = count() by Message <br>| where Count &gt; 10</pre><ul><li>This query triggers an alert if there are more than 10 events in the last hour.</li></ul><ol><li><strong>Set Up Alert Details</strong>:</li></ol><ul><li>Configure the <strong>Action Group</strong> to define what should happen when the alert is triggered (e.g., send an email, SMS, or invoke a webhook).</li><li>Provide a name and description for the alert rule.</li></ul><p><strong>Review and Create</strong>:</p><ul><li>Review the configuration and click <strong>Create</strong>.</li></ul><h3>4. Testing the Setup on a VM</h3><p><strong>Deploy the Script to the VM</strong>:</p><ul><li>Access your VM using a remote management tool like PuTTY.</li><li>Deploy the script you created earlier that interacts with the Azure Metadata Service and sends data to your custom table in Log Analytics.</li></ul><p><strong>Run the Script Multiple Times</strong>:</p><ul><li>Execute the script on the VM to simulate events and test the alert rule.</li><li>You can use a command like python your_script.py to run it.</li></ul><p><strong>Verify the Alerts</strong>:</p><ul><li>Check the Azure Monitor Alerts dashboard to see if your alert rule was triggered by the events generated by your scrip</li></ul><p><strong>Review Logs</strong>:</p><ul><li>Go to the Log Analytics workspace associated with your Data Collection Rule and verify that the custom table is receiving data as expected.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e06cbf3f891a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>