Login-AzureRmAccount and Select-AzureRmSubscription

前端 未结 3 751
甜味超标
甜味超标 2021-01-21 20:33

I have installed AzureRm and Azure module on Windows server 2012 R2. I can run other cmdlets from this module (eg.AddAzureRmAccount, Get-AzureRmSubscription) but Login-AzureRmAc

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-21 20:54

    NOTE: Please use azure RM login to connect via service principal as :

    $applicationId = "$securePassword = "ServicePrincipal Passowrd" | ConvertTo-SecureString -AsPlainText -Force
    $credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $applicationId, $securePassword
    Connect-AzureRmAccount -ServicePrincipal -Credential $credential -TenantId "ServicePrincipal Tenant ID"
    

提交回复
热议问题