Skip to content

Ulysses Neves

Microsoft Entra ID, authentication, and hybrid identity troubleshooting.

Menu
  • Home
  • Microsoft Azure
  • Microsoft AD FS
  • Microsoft 365
  • Contact
  • Troubleshooting Index
Menu

Creating a Resource Group using PowerShell and Azure CLI

Posted on July 28, 2019

In the previous post, we showed how to create and remove a Resource Group using the Azure portal. If you have not read it yet, use this link. Today we will talk about how to work with Resource Groups using PowerShell and Azure CLI.

Creating a Resource Group using PowerShell

To connect to Azure using PowerShell, you need to install the Azure module or access it directly in the Azure portal. To run the Azure module in local PowerShell, you need to be using version 5.1 of this software and also have .NET Framework 4.7.2 or later. More information can be found at this link.

To find your PowerShell version, run the command “$PSVersionTable.PSVersion”, as shown below:

You can install this module by opening PowerShell with elevated privileges and running the command “Install-Module -Name Az -AllowClobber”

Open PowerShell and connect to your Azure subscription with the command “Connect-AzAccount”.

Enter your Azure account credentials on the screen below.

Now let’s create a Resource Group using PowerShell. As an example, I ran the command “New-AzResourceGroup -Name “Lab2-ps” -Location “Central US” -Tag @{Department=”Marketing”}”

Syntax: New-AzureRmResourceGroup -Name resource group name -Location “Azure group location” -Tag @{tag name or type}

With the Resource Group created, you can view it in the Azure groups panel.

Creating a Resource Group using Azure CLI

Azure CLI is a shell for creating and running automated tasks in Azure. You can run it directly in the portal or download and install it on your device. You can use Azure CLI on Ubuntu 16, Windows 10, and macOS. For more information, use this link.

With Azure CLI installed, open Command Prompt and connect to your subscription using the command “az login”.

Enter the credentials for your Azure subscription.

The alt attribute for this image is empty. The filename is image-2.png

Now let’s create a Resource Group using Azure CLI. As an example, I ran the command “az group create –location westus -n “Lab2-azcli” –tags vendas

Syntax: az group create -Location “Azure group location” -n resource group name –tags tag name or type

For more options for the Resource Group creation command in Azure CLI, use this link.

With the Resource Group created, you can view it in the Azure groups panel.

Removing Resource Groups using PowerShell and Azure CLI

To remove the Resource Group using PowerShell, run the command “Remove-AzResourceGroup -Name Lab2-ps” and confirm.

Azure CLI

To remove the Resource Group using Azure CLI, run the command “az group delete -n lab2-azcli” and confirm.

Summary

In today’s post, we showed how to create and delete Resource Groups in Azure using the PowerShell and Azure CLI command-line tools.

In the next post, we will talk about how to prevent accidental deletion of resources in Azure using Resource Lock, how to control access to resources using Access Control (IAM), and policy options with Azure Policy.

Did you like the post? Please like and share.

Best regards,

Ulysses Neves

Related guides: Browse the Microsoft Identity Troubleshooting Index or the Microsoft Azure topic archive.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Conditional Access report-only: why a successful sign-in can show a policy failure October 9, 2026
  • Microsoft Entra SMS and Voice Retirement: An Admin Preparation Checklist September 24, 2026
  • Microsoft Defender for Identity domain investigation: six questions to ask first September 10, 2026
  • Microsoft Entra Kerberos key rotation: what changes—and what administrators should check September 6, 2026
  • Microsoft Authenticator Will Block Jailbroken Devices in 2026 — What You Need to Know March 17, 2026

Archives

  • October 2026
  • September 2026
  • March 2026
  • September 2024
  • April 2024
  • February 2024
  • December 2023
  • September 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019

Tags

#aaddownleveldevice #adfs #adfscertificate #adfscertificates #adfsmfaadapter #azureauth #azureCA #azuredevice #capolicy #cloudsummit2021 #conditionalaccess #conditionalaccesspolicy #deviceregistration #farmbehavior #gopasswordless #mfaserver #msidentity #namedlocation #securingazure #securingazuread #sslprivatekey #troubleshootingadfs #troubleshootingwaptrust #tshootadfs #waptrust #webapplicationproxy #WHFBcerttrust #whfbdeployment #WHfBhybridsetup #WHfBprovisioning #widdatabase adconnect AD FS authenticationstrength az500 azurepim Azure security cloudsecurity microsoft365 Microsoft Azure Microsoft Entra hybrid join Microsoft Entra ID Microsoft Entra MFA PowerShell WHfB
©2026 Ulysses Neves | Design: Newspaperly WordPress Theme
Ulysses Neves
Gerenciar Consentimento de Cookies
Para fornecer as melhores experiências, usamos tecnologias como cookies para armazenar e/ou acessar informações do dispositivo. O consentimento para essas tecnologias nos permitirá processar dados como comportamento de navegação ou IDs exclusivos neste site. Não consentir ou retirar o consentimento pode afetar negativamente certos recursos e funções.
Funcional Always active
O armazenamento ou acesso técnico é estritamente necessário para a finalidade legítima de permitir a utilização de um serviço específico explicitamente solicitado pelo assinante ou utilizador, ou com a finalidade exclusiva de efetuar a transmissão de uma comunicação através de uma rede de comunicações eletrónicas.
Preferências
O armazenamento ou acesso técnico é necessário para o propósito legítimo de armazenar preferências que não são solicitadas pelo assinante ou usuário.
Estatísticas
O armazenamento ou acesso técnico que é usado exclusivamente para fins estatísticos. O armazenamento técnico ou acesso que é usado exclusivamente para fins estatísticos anônimos. Sem uma intimação, conformidade voluntária por parte de seu provedor de serviços de Internet ou registros adicionais de terceiros, as informações armazenadas ou recuperadas apenas para esse fim geralmente não podem ser usadas para identificá-lo.
Marketing
O armazenamento ou acesso técnico é necessário para criar perfis de usuário para enviar publicidade ou para rastrear o usuário em um site ou em vários sites para fins de marketing semelhantes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Ver preferências
  • {title}
  • {title}
  • {title}