powershell - How to Connect to Azure from Visual Studio Code Terminal -
i have installed required software , azure powershell cmdlets on local system. tried execute powershell script connecting azure visual studio code terminal. below error.
import-module microsoft.online.sharepoint.powershell function publishtoazure{ add-azureaccount ...... ...... }
error is.. add-azureaccount : handle invalid
visual studio code settings:
// place settings in file overwrite default settings { "terminal.integrated.shell.windows": "c:\\windows\\sysnative\\windowspowershell\\v1.0\\powershell.exe" }
console of windows azure active directory module windows powershell properties target is:
c:\windows\system32\windowspowershell\v1.0\powershell.exe -noexit -command "import-module msonline"
system properties: 64bit win7 os
you may connect , manage azure resources within vs code's terminal window installing microsoft azure cli 2.0. (https://aka.ms/installazurecliwindows).
after cli 2.0 installed in environment, add cli 2.0 components environment path.
for example, environment windows 10 , vs code v1.13.0. ran cli 2.0 msi installer windows. in vs code terminal session, add path powershell environment via command:
$env:path += ';c:\program files (x86)\microsoft sdks\azure\cli2\wbin'
to work within azure subscription(s), first login via command
az login
follow prompts browse url complete login azure account , authorize cli session. additional on cli 2.0 commands may found @ link, https://aka.ms/cli
i know thread old , answer bit late hope helps someone.
cheers, carnegiej
Comments
Post a Comment