Posts

Azure - Orphaned Resources dashboard

Image
  Introduction Hello Everyone,  Back to one more article with Azure Orphaned resources. As we all working in azure and we keep creating the resources as many as want based on the requirement, but sometimes we forget to delete those resources which will cost you without knowing it. This cost may be a smaller but if you calculate it for a year then it'll be a huge.  So thought of creating the dashboard one, but before i create i wanted to know whether anyone published an article on how to fetch the same. Interestingly, I got lot of quite good articles but the content was same, So i've additionally added few tiles which will address the additional resource types. I took the developed one from the following site and added additional content.  Thanks to @ Dolev Shor for developing this workbook. https://github.com/dolevshor/azure-orphan-resources Additionaly, Clone the new tile from the workbook and use the below Resource graph query to create new dashboards. Snapshots: ...

Enable Azure VMInsights with Log Analytics Agent or Azure Monitoring Agent

Image
  Introduction Hello Everyone,  We all heard about the Azure VMInsights monitoring solution which will monitor the Azure VMs performances and event logs. It also gives the graphical view of the particular VM about the VM connections and properties which is more convienent.  I was going through it and thought of documenting the differences and how to enable the same. In order to enable VM Insights you have to use either the Azure monitoring agent  with Data collection Rule  or Log Analytics agent Lets get started with enabling VMinsights using the Log Analytics Agent, Once you select the Log Analytics agent based deployment then it'll start deploy the VMInsights solution, Dependency agent & MMA or AMA as per the previous choice And it creates the below table in LogAnalytics, InsightsMetrics -> LogicalDisk, Network, Computer, Memory, Processor VMComputer VMProcess VMConnection VMBoundPort Heartbeat ServiceMapComputer_CL ServiceMapProcess_CL Azure VMInsights...

Add Createdby/Deployedby/Caller/Owner email Tag to Azure resources automatically

  Introduction Hello Everyone, This post is about Tagging the Azure resources with Email address of the user who deployed the resources based on deployment Activity Log. I know there are lot of solutions available for owner tag but this solution is simple and i feel can be implemented easily.  Benefits: This solution is useful when it comes from multiple sources of deployment. The Creator tag can be added in the code but if someone uses the Azure portal or PowerShell & etc.. then it's difficult to identifythe resources deployed by.    I have used LogAnalytics Workspace to collect all subscription related logs and Azure Automation Account for applying the tags.   Prerequisites: Create a LogAnalytics Workspace Create an Azure Automation Runbook with Run As Account Provide Tag Contributor Rights to Automation Account Run As Account at Subscription Level  Create V1 based alert rules as V2 has different schema which i didn't include. Create a webhook an...

Azure - Audit/Append Azure Hybrid Benefit using Azure Policy

  Introduction Hello All, Happy to see you again in this post.  I hope you all know about the Azure hybrid benefit so i'm not doing to deep dive into this. In simple words, If you've Software assurance for the Windows VMs & SQL Servers you can utilize the existing licesense into Azure or Any other cloud.  As there is no policy available, the following policy will help you to audit the Hybrid Benefit for the Azure VMs and SQL Managed Instances and we can easily figure out what is complaint and not.   So i worked on creating the policy and here is the code that can be used for achieving the AHB audit. #Code stars here,    {     "mode": "All",     "policyRule": {       "if": {         "anyOf": [           {             "allOf": [               {                 "field":...

Azure - Customize Azure Log Search alerts using Automation Runbook

Image
 Introduction As you might know the Log Search Alert – V2 alert has been released and it’s rolled out globally. The v1 alerts were quite easy understand interms of what went wrong, but the v2 alerts have more information which can be ignored for the people who's working as NOC.  By default this cannot be customized as it's not that matured enough to do that, so i have created this runbook which does the customization for v1 & v2 alerts.  Benefits of this custom alert is, Both V1 & V2 alert is covered as part of this custom alert. All the existing alerts can also be routed through this custom script. All types of alerts like CPU, Disk, Memory & Event are supported by this custom alert. Additionally, Start & EndTime of the event, Search query, Fired data time & etc.. parameters are enabled for this custom alert. Finally, the Subject, Body of the email & affected details has been changed.   Following component...