title: How to perform a Non-Interactive MFA Login to Azure Subscription using Powershell
body: <p>Previously, I was able to login to the azure subscription via powershell using the below code.</p>
  
  <pre><code>$azureAccountName ="username"
  $azurePassword = ConvertTo-SecureString "Password" -AsPlainText -Force
  $psCred = New-Object System.Management.Automation.PSCredential($azureAccountName, $azurePassword)
  Login-AzureRmAccount -Credential $psCred
  </code></pre>
  
  <p>Recently, Microsoft introduced MFA (Multi-Factor Authentication) and now the above code fails as we now have to verify the login via a code received on the mobile number registered at the time of profile creation.
  I do not want the interactive login but the automatic one which my code was earlier able to do.</p>
  
  <p>Any suggestions?</p>