Azure Resources - Gary-Moore/developmentwiki GitHub Wiki

Get-AzureRmResourceGroup

The Get-AzureRmResourceGroup cmdlet gets Azure resource groups in the current subscription. You can get all resource groups, or specify a resource group by name or by other properties. By default, this cmdlet gets all resource groups in the current subscription.

Get-AzureRmResourceGroup -Name "EngineerBlog"

https://docs.microsoft.com/en-us/powershell/module/azurerm.resources/get-azurermresourcegroup?view=azurermps-6.1.0

Remove-AzureRmResourceGroup

The Remove-AzureRmResourceGroup cmdlet removes an Azure resource group and its resources from the current subscription. To delete a resource, but leave the resource group, use the Remove-AzureRmResource cmdlet.

Remove-AzureRmResourceGroup -Name "ContosoRG01"

Remove without confirmation

Get-AzureRmResourceGroup -Name "ContosoRG01" | Remove-AzureRmResourceGroup -Verbose -Force

https://docs.microsoft.com/en-us/powershell/module/azurerm.resources/remove-azurermresourcegroup?view=azurermps-6.2.0

Deploying Resource Groups

New-AzureRmResourceGroupDeployment

The New-AzureRmResourceGroupDeployment cmdlet adds a deployment to an existing resource group. This includes the resources that the deployment requires.

An Azure resource is a user-managed Azure entity, such as a database server, database, website, virtual machine, or Storage account. An Azure resource group is a collection of Azure resources that are deployed as a unit, such as the website, database server, and databases that are required for a financial website. A resource group deployment uses a template to add resources to a resource group and publishes them so that they are available in Azure. To add resources to a resource group without using a template, use the New-AzureRmResource cmdlet.

New-AzureRmResourceGroupDeployment -ResourceGroupName "ContosoEngineering" -TemplateFile "D:\Azure\Templates\EngineeringSite.json" -TemplateParameterFile "D:\Azure\Templates\EngSiteParms.json" -TemplateVersion "2.1"

https://docs.microsoft.com/en-us/powershell/module/azurerm.resources/new-azurermresourcegroupdeployment?view=azurermps-6.1.0

Test-AzureRmResourceGroupDeployment

The Test-AzureRmResourceGroupDeployment cmdlet determines whether an Azure resource group deployment template and its parameter values are valid. https://docs.microsoft.com/en-us/powershell/module/azurerm.resources/test-azurermresourcegroupdeployment?view=azurermps-6.2.0