title: How to Connect to Azure from Visual Studio Code Terminal
body: <p>I have installed the required software and Azure PowerShell cmdlets on local system. I tried to execute a powershell script by connecting to Azure from Visual Studio Code Terminal. Below is the error.</p>
  
  <pre><code>Import-Module Microsoft.Online.SharePoint.PowerShell 
  
  function PublishToAzure{ 
   Add-AzureAccount
  ......
  ......
  }
  </code></pre>
  
  <p>Error is..
  <strong>Add-AzureAccount : The handle is invalid</strong></p>
  
  <p><strong>Visual Studio Code</strong> Settings:</p>
  
  <pre><code>// Place your settings in this file to overwrite the default settings
  {  
  "terminal.integrated.shell.windows": "C:\\WINDOWS\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"
  }
  </code></pre>
  
  <p>Console of <strong>Windows Azure Active Directory Module for Windows PowerShell</strong> Properties
  Target is:</p>
  
  <pre><code>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command "Import-Module MSOnline"
  </code></pre>
  
  <p>System Properties: 64bit Win7 OS</p>