I am currently logging int Azure using
az login -u -p ""
The issue is that the email is MFA and a verification code is needed to be entered in. This login process is used for CICD. Is there a way I can automate this process without having to enter the verification code
Thank you for your valuable suggestion and for directing in the right direction, @fmarz10.
Service principals with various forms of credentials, such as passwords, secret keys, and certificates, can be used to do this. After adding the role you can automate login using
$azureAplicationId ="Your Azure AD Application Id" $azureTenantId= "Your Tenant Id" $azurePassword = ConvertTo-SecureString "strong password" -AsPlainText -Force $psCred = New-Object >System.Management.Automation.PSCredential($azureAplicationId , $azurePassword) Add-AzureRmAccount -Credential $psCred -TenantId $azureTenantId ->ServicePrincipal
REFERENCES
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.