Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-02-2023, 03:10 PM
paxil paxil is online now
Registered User
 
Join Date: 03-18-2014
Location: Richmond, VA
Posts: 12
Azure module not recognized in PowerShell action

When this is executed from windows server powershell command line manually, it works fine, but when executed through VBP, it fails saying 'Get-AzCloudService' command not recognized. User is logged in using the same creds too.

Get-AzCloudService -ResourceGroupName "%RESOURCE_GROUP%" -CloudServiceName "%CLOUD_SERVICE_NAME%"


Failure message:
>C:\Users\<****>\AppData\Local\Temp\Vis8CFA.tmp.ps 1 : Failed to build because The term 'Get-AzCloudService' is not </message>
<message>recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if </message>
<message>a path was included, verify that the path is correct and try again.</message>
<message>At line:1 char:1</message>
<message>+ & C:\Users\<****>\AppData\Local\Temp\Vis8CFA.tmp.ps1 </message>
<message>+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~</message>
<message> + CategoryInfo : NotSpecified: ( [Write-Error], WriteErrorException</message>
<message> + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException, Vis8CFA.tmp.ps1</message>
<message> </message>
<message>Process completed with exit code 1</message>

Last edited by paxil; 10-02-2023 at 03:17 PM.
Reply With Quote
  #2  
Old 10-02-2023, 03:48 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Must be running from a different PS profile. What do you get from your PowerShell instance and from Visual Build for this?

$PSVersionTable
$Profile
Get-AzCloudService
Reply With Quote
  #3  
Old 10-03-2023, 07:21 AM
paxil paxil is online now
Registered User
 
Join Date: 03-18-2014
Location: Richmond, VA
Posts: 12
PS C:\Windows\system32> $PSVersionTable

Name Value
---- -----
PSVersion 5.1.17763.4840
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.4840
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

PS C:\Windows\system32> $Profile
C:\Users\lg*****sv\Documents\WindowsPowerShell\Mic rosoft.PowerShell_profile.ps1
PS C:\Windows\system32> Get-AzCloudService

ResourceGroupName Name Location ProvisioningState
----------------- ---- -------- -----------------
GEHC-CX-IC-DEV-US-EA-WR-01-01 neal-cloud-wr eastus Succeeded

So I connect with this lg**** user to this server, who is an admin, but then login as a user with AD credentials in Azure using the az login command and then a az account set. That is all successful until I get to the Get-AzCloudService command in VBP.
Reply With Quote
  #4  
Old 10-03-2023, 07:43 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Please post or send the .bld file and build log file, with the Log the command-line that is used option on the Advanced tab of the PowerShell action checked.

https://www.kinook.com/Forum/showthread.php?t=3044
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 04:26 PM.


Copyright © 1999-2023 Kinook Software, Inc.