简体   繁体   中英

Azure automation account - how to use custom service principal for login instead of run as account?

In Azure automation account - how to use already existing service principal for login in powershell runbook instead of run as account?

we dont get privilege to create service principal at our organisation.. so would like to use already existing service principal.

Just use the command below.

$azureAplicationId ="<client-id>"
$azureTenantId= "<tenant-id>"
$azurePassword = ConvertTo-SecureString "<client-secret>" -AsPlainText -Force
$psCred = New-Object System.Management.Automation.PSCredential($azureAplicationId , $azurePassword)
Connect-AzAccount -Credential $psCred -TenantId $azureTenantId -ServicePrincipal

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM