Add-AzureRmAccount

This article will discuss the syntax and usage of the Add-AzureRmAccount PowerShell command with an example of how to use this command.

Add-AzureRmAccount

You can use this command to add an authenticated Azure account to use for the Azure Resource Manager command requests.

Syntax of the Add-AzureRmAccount

Below is the syntax of the Add-AzureRmAccount PowerShell command.

Add-AzureRmAccount 
-Environment <String>
-Subscription <String>
-Tenant <String>

Example

You can execute the below Azure PowerShell command to add an authenticated Azure account to use for the Azure Resource Manager command requests.

PS C:\windows\system32> 
$Account = "fewlines4biju@hotmailo.com"
$Environment = "AzureCloud"
$SubscriptionName = "Visual Studio Enterprise"
$TenantId = "5d9d690a-0310-474d-ae8b-42df2d549228"
Add-AzureRmAccount -Environment $Environment -Subscription $SubscriptionName -Tenant $TenantId

After executing the above command, I got the expected output as below. Check out the screenshot below for your reference.

Add-AzureRmAccount

After executing this command, there might be a chance you will face Parameter set cannot be resolved using the specified named parameters error.

Conclusion

This article discussed the syntax and usage of the Add-AzureRmAccount PowerShell command with an example of how to use this command. Thanks for reading this article !!!