Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

Blog posts : "MICROSOFT AZURE"

Hashicorp Terraform dynamic block for_each loop with example

I use Terraform IAC (Infrastructure as a code) a lot to design Azure resources, While deploying Azure Resource NSG (Network Security Group), I was defining multiple roles inside NSG, Roles were mentioned inside the main.tf code script file. I wanted roles values to be moved to variables inside v…

Read more

Configure a Azure VM with Desired State Configuration in Automation Account

While working on one of the Azure Automation Accounts project I had to test and provide a demo of Desired State Configuration (DSC) on the Azure Virtual Machine, how it can be useful. There was a client requirment to not to use Group Policy for hardening, but the configuration must be done through D…

Read more

Writing and Using Terraform modules

This is a small example of Terraform module how to write and use it. A Terraform module is a folder/container for multiple resources that are used together. Every Terraform configuration has at least one module, known as its root module, which consists of the resources defined in the terraform .tf f…

Read more

Azure Terraform fixed Availibility Zones on Virtual Machine Scale Set

While working previously on Create an Azure virtual machine scale set and load balancer using Terraform, I was trying to deploy Virtual Machine scale sets in availibility zones and i was receiving below error. To deploy VMSS in availaibility zones (1 and 2), I was using argument zone = ["1", "2"]

Read more

Create an Azure virtual machine scale set and load balancer using Terraform

While working on one of the client requirement I got below assignement which wanted to be demonstrated either with Terraform or ARM. Although I am very good at writing script for both languages, I chose Terraform, as there was another requirement for other projects where I am already working on Te…

Read more

Why is my Azure recovery services vault not getting deleted?

While working on Azure Portal Get Azure virtual machine backup reports using Powershell I was trying to decommision few Azure Recovery Service Vault (Backup) resource by deleteing it, I went to Azure portal selected Recovery Service Vault from Resource Group and pressed delete button, but I was rec…

Read more

Create an Azure Automation account on using Portal PowerShell and AzureCLI

Azure Automation Account is Azure resource allows you to automate tasks against services and resources in Azure, on-premises and with other cloud providers such as Amazon Web Services (AWS). You can write and use runbooks to automate your tasks, or a Hybrid Runbook Worker if you have business or ope…

Read more

Azure Powershell : Operation returned an invalid status code 'BadRequest'

While working on few Azure Powershell scripts I was keep receiving an error 'BadRequest' whenever I was trying to create a new resource in Azure. I kept on trying to resolve an error but didn't find any proper solution to it. Initially the message was not much friendly so to dig down further I went …

Read more

Export certificates from Azure Key Vault using PowerShell

While working with Azure Key Vault Certificate Create Azure Key Vault Certificates on Azure Portal and Powershell, Next requirement was to download those certificates from Key Vault. On the Azure Portal choose the SSL Certificate you want to export. Click buttons Download in CER format or Download…

Read more

Create Azure Key Vault Certificates on Azure Portal and Powershell

I had one requirement to create a SSL certificates on Azure Key Vault, I have Key Vault already deployed with earlier written articles Create key vault and secrets with access policies in Microsoft Azure. I just wanted to create new SSL certificate in it so using managed Identity In the the future…

Read more

Get Azure virtual machine backup reports using Powershell

I found my junior colleague are gathering Azure virtual machines backup report manually so I thought to write and pull Azure Virtual Machine Backup (Recovery services vault) report including Backup status and Summary using Microsoft PowerShell script to ease the task.

To check the current backup…

Read more

Get the list Azure Reservation Catalog with PowerShell and AzureCLI

I wanted to design Azure Reservations solution, before desinging the solution I wanted to fetch Reservations catalog list (SKUs) available in the specified subscription for a location, so I can create a presentation and pitch to client which available reserved virtual machine we can use. This below …

Read more

Powershell get the list of Azure Reservations Virtual Machines instances

As I was working on the Azure Reservations - PowerShell List All Azure Resverations. There was another requirement to provide the list of Virtual Machines usage under Azure Reservations by clients (which VMs are utilized under reservations), earlier another team was doing it manually to get the r…

Read more

PowerShell List All Azure Resverations

Recently in one of the Azure project my client was utilizing Azure Reservations Instances (Azure RI) they wanted a Microsoft PowerShell script from me to pull the list report. Below is the screenshot of all configured reservations on the Azure Portal.

Microsoft Azure reservations All succeded scope subscription VM RI Virtual Machine Powershell az.reservations module subscription cost optimization.png

To work on Azure Reservations with Power…

Read more

Get started and configure certificate-based authentication in Azure

Connecting SSL certificate based login to Azure can help increased authentication security, if you maintain certificates very well. In my case I wrote few scripts and I wanted to automate  Azure. As my user account is configured with MFA (My scripts scheduling was failing due to this) and I didn't w…

Read more

How to view the service principal of a managed identity in the Azure portal, Powershell and AzureCLI

After enabling/deploying managed identity (service principal) on VMs, one of my junior colleague questioned me, where is service principal of managed identity is stored. Basically Service Principal (MSI) is a user account (Service Account ) and it is created under Azure Active Directory, but after f…

Read more

Use a Azure VM system assigned managed identity to access Azure Key Vault

While working one of the Azure project, I had a requirement to implement System Assigned Managed Identity to access Azure key vault secret programatically on Azure virtual machine inside the code without azure login. In my earlier written articles, to retrieve secret password from Azure Key Vault I …

Read more

Create a Virtual machine on Microsoft Azure

Although I have written PART 9: CREATING AND MANAGING VIRTUAL MACHINE (VM) USING MICROSOFT AZURE RESOURCE MANAGER PORTAL but it is the old article now, afterwords there are many updates came while creating an Azure Virtual Machine. New Azure VM updates are still easier to understand and configure, T…

Read more

Create an Azure App registrations in Azure Active Directory using PowerShell & AzureCLI

This is step by step guide to configure App Registration on Azure Active Directory (AzureAD). This guide includes three ways to create App Registration using Azure Portal, PowerShell and AzureCLI. 

Azure Portal

Within Azure AD portal you will find the App registrations pane that provide the …

Read more

Connect-AzureAD: One or more errors occurred. Could not load type 'System.Security.Cryptography.SHA256Cng'

While working on AzureAD (Azure Active Directory) with PowerShell module I was received below errors and my scripts where failing. I updated AzureAD module with Update-Module command to latest one but it was still throwing errors. After few testing I checked PowerShell version, it was latest Powe…

Read more

20 Blog Posts

Blog Search

Page Views

5887327

Follow me on Blogarama