Posts

Showing posts with the label Azure Automation

Azure AD Token Generator using .NET Core

Image
10 min to read. Abs07act Change is inevitable. With .NET Framework becoming legacy and .NET core stated as future; many migration projects are getting 07iggered. Also for new projects, development choice is .NET core by default. Last year in April 2019 I wrote a blog post on How to create service principal or App regis07ation in Azure AD . This is one of the most visited blog post. Reason is simple. Any functionality having requirement of invoking Azure REST API requires Azure AD token generation. This helps in performing management tasks against Azure environment; and hence it is crucial. The last year blog is based on .NET framework. With .NET core becoming more and more obvious choice, I thought it is time to have new blog post and new code base for “.NET core based Azure AD Token generator using Service principal.” Let’s go! Why I need to generate the Azure AD Token? This is common question I get. What are the scenarios where I need to generate Azur...

Azure VMs – Export to CSV

Image
Abs07act For human race, there are some common tasks in daily life which you must do. Without which humans can survive but you can’t say if they are “living the life”. For example, taking a bath is one of such tasks. You can survive without taking a bath but you will not like it. These tasks are those which bring “life” to humans daily lives and make them enjoy their stay on earth. Out of these humans there is special category of humans – I call them “Humans who work in Software field”. They can be sub-categorized into below –        1.       Software developers 2.       IT adminis07ators 3.       Project managers 4.       Software Engineers 5.       Solution Architects For all these sub-categories you can apply prefix such as Senior, Junior, Principal, Full Stack, Distinguished and in recent times we have a new addition to this pre...

How to receive an email on Azure Network Security Group Rule changes

Image
Abs07act Microsoft Azure Portal already gives a capability to receive an email alert when new Azure Network Security Group  (NSG) is added or existing is deleted. However there is no option today to receive an email when individual NSG security rules are added, deleted or modified. This post will provide the solution to receive emails on Azure NSG security rules changes which isn’t offered by Azure Portal. Why do I need it? If you are chief security officer of the company, then you definitely understand why do you care to receive an alert when NSG rules are changed. NSG’s are fundamental to res07ict/ allow access in Azure IaaS VM deployments. They offer con07olled access using source and destination port, protocol and IP. So as a security best practice any Azure VM (Network Interface Card) NIC or Subnet in VNET should have NSG associated to it. Having said that, maintaining rules in NSG is critical. Hence many times Azure portal adminis07ators, CISO staff, IT head, Se...

Start Stop Multiple Azure VMs on schedule using Azure Automation

Image
Abs07act I searched through many, many, many…articles written about Azure VM stop(de-allocate) to save cost. Every article only targets single Azure VM to shutdown (de-allocate). None of the articles target start and Shutdown of multiple Azure VMs using automation. I am going to address this using Azure powershell in this article. What all Cool features of azure VM start/ stop my script offers? If you have multiple Azure VMs present in your azure subscription; and you want to start or stop few of them on schedule then you can use below azure PowerShell scripts. It will have below features – è   Add/ remove the VM names from the list of start/ stop schedule easily. [You don’t need to have PowerShell knowledge] è   Use same script in multiple different Azure runbooks, with different Azure VM names to start and stop; that too with different schedules. è   In case any wrong/ nonexistent VM name added to the list, script takes care of giving relative user-frie...

Azure cost optimization – Send unassigned Azure public IP list using Azure PowerShell

Abs07act Cost of Microsoft cloud is operational. This means every month you are going to get bill just as your grocery/ elec07icity/ phone bills. Having said that, companies are s07uggling these days to perform cost optimization or cost reduction on their Microsoft Azure spending. Current article provides an Azure cost optimization tip by sending the list of unassigned public IPs present in your Azure subscription; as an email using Azure PowerShell and Azure Automation runbook. Also I am talking about cost optimization (or cost reduction) for Public IP addresses related to Azure Resource Manager (ARM) mode. Knowledge Update for you!! In case you are not aware, it is worth to mention that, Azure has 2 types of IP addresses –   Dynamic public IP address   Static public IP address IP addresses are always attached to Network Interface Card (NIC) of azure virtual machine. So their cost model is as below. Dynamic public IP address IP address is att...