When working with arrays and PSObject in PowerShell, there are several efficient methods for creating and managing array elements. Below are examples that highlight both the creation of arrays and the addition of elements in different ways.
To create an empty array in PowerShell, you have two main options:
Using[System.Collections.ArrayList]
This method initializes an ArrayList, w…
I had a requirement to provide a solution for monitoring ESXi servers' CPU, memory, and datastore usage to non-IT or developer users without giving them direct access to vCenter or ESXi servers. The solution needed to avoid using any additional applications or tools. Previously, I had set up a system pipeline where the data was delivered in CSV or Excel format. However, I thought it would be more …
I faced a scenario where I needed to automate the execution of a shell script on VMware (Broadcom) ESXi servers, version 7. The task involved renaming /etc/rc.local.d/local.sh to a .bak extension and restarting all services using /sbin/services.sh restart, which was necessary to resolve VM disconnection issues. Normally, this task is straightforward if you have the root username and password of ES…
This article demonstrates how to deploy an Azure ARM template using Terraform. I encountered several scenarios where resources deployed through Terraform, Bicep, or the REST API didn't function as expected. However, when I deployed the same resources using an ARM template, they worked flawlessly.
For example, in one case involving Scheduled Query Rules with Action Groups or Log Analytics, the d…
In this article, this example shows how to deploy resource group in Azure subscription. While deploying resource group with PowerShell you need to use New-AzSubscriptionDeployment cmdlet. Below is the output after deploying Resource Group in the subscription.
.\091-Complete_ARM_Template> # Create a hashtable for parameters
$templateParameters = @{
rgLocation = 'eastus'
rgName =…
This is another way of deploying resources/services on Azure using azapi provider using HashiCorp Terraform.
AzAPI is a lightweight, flexible provider that leverages the Azure ARM REST APIs, empowering you to manage any Azure resource type with any desired API version. This enables access to the latest Azure features and functionality. Key Benefits:
Compatibility with any API version
Design…
This article is a continuation of my previous post, where I deployed CPU quota usage alerts for a subscription using Azure ARM templates. In this post, I'll demonstrate how to deploy Action Groups and Subscription Quota Alerts for CPU usage using Bicep.
Compared to ARM templates, I find Bicep to be more user-friendly, intuitive, and concise. If you're familiar with Terraform, you'll find Azure …
This article is about Implementing of CPU Quota Usage Alert for Azure Subscription. As part of my recent assignment, I successfully created a CPU quota usage alert for an Azure subscription using Azure Resource Manager (ARM) templates. The deployment enables real-time monitoring of CPU quota usage, providing proactive alerts to prevent potential resource exhaustion.
I was receiving Error: POST https://api.github.com/user/repos: 401 Requires authentication [] while applying and deploying repository on github.com with Terraform. This error occurs because terraform is not able to authenticate to GitHub.com API and not able to perform the action.
Streamline your infrastructure as code (IaC) workflows by integrating your GitHub repository with HashiCorp Terraform Cloud (HCP). This powerful combination enables automatic execution of Terraform plans and applies based on changes made to your infrastructure code, ensuring that every update to your repository triggers the necessary Terraform actions.