0

I try to configure TFS for Continuous Delivery to Azure by this article In article TFS published package to Azure with Powershell script. When build starts I get errors like ObjectNotFound: (Set-AzureDeployment:String) [], CommandNotFoundException. Looks like I didn't install Azure cmdlets, but I install all from Web Platform Installer. And when I try to run script locally on server - it works and deploys package.

In article Powershell starts by adding InvokeProcess to template with Filename="PowerShell".

I think I just don't run Powreshell correctly. Maybe somebody has some ideas which command should I use?

rocky
  • 7,506
  • 3
  • 33
  • 48
dbondarev
  • 75
  • 7

2 Answers2

2

Find a solution

Powershell cann't find Azure module. Add this before Import-Module Azure command in script

$env:PSModulePath=$env:PSModulePath+";"+"C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell"
rocky
  • 7,506
  • 3
  • 33
  • 48
dbondarev
  • 75
  • 7
  • A different path works for me - $env:PSModulePath = $env:PSModulePath + ";" + "${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\PowerShell\ServiceManagement" – fszlin Oct 09 '14 at 18:35
0

Could be that you installed the cmdlets on the user profile. Try re-install after logging in with the account running the build service.

Giulio Vian
  • 8,248
  • 2
  • 33
  • 41