Problems with Microsoft Az Modules

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
MWinkler
Posts: 3
Joined: Thu May 31, 2018 7:28 am

Problems with Microsoft Az Modules

Post by MWinkler » Thu Nov 21, 2019 8:34 am

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.170
OS: Windows 10 Pro (64 Bit)
Build: v10.0.18362.0

*** Please add details and screenshots as needed below. ***

I want to use the Az Modules from MS - i imported Az.Resources (1.7.1) and Az.Accounts (1.6.4) succesfully and everything works in ISE and std. Powershell5.

Unfortunately i cannot use both modules at the same time in PowerShell Studio - if i change to "V5 - 64Bit" Profile the CMDlets in Az.Resources (ie. Get-AzADUser) not recognized but all of the Az.Accounts CMDLets (ie. Connect-AzAccount) are working. If i change to V2 Profile - the behaviour is vice-versa (all Az.Resources CMDs working and all Az.Accounts are not recognized)

What i tried so far (without success):
  • rebuild the PowerShell Studio Cache serveral times
  • import both modules in Cache Editor
  • Remove both modules in Cache Editor
  • click on Build Cache in Cache Editor
  • Reinstall both modules in Powershell itself
thanks for help in advance.

User avatar
brittneyr
Site Admin
Posts: 236
Joined: Thu Jun 01, 2017 7:20 am

Re: Problems with Microsoft Az Modules

Post by brittneyr » Thu Nov 21, 2019 8:47 am

If you have imported both modules and built the cache from the cache editor, please try reloading the cache from the ribbon:
SPS_Reload-Cache.png
SPS_Reload-Cache.png (29.3 KiB) Viewed 977 times
Brittney Ryn
SAPIEN Technologies, Inc.

User avatar
mxtrinidad
Site Admin
Posts: 369
Joined: Sun Mar 03, 2013 12:42 pm

Re: Problems with Microsoft Az Modules

Post by mxtrinidad » Thu Nov 21, 2019 9:22 am

The latest version of Az module is: Az 3.0.0
Microsoft Azure PowerShell - Cmdlets to manage resources in Azure. This module is compatible with WindowsPowerShell and PowerShell Core.

Minimum PowerShell version: 5.1 (not Windows PowerShell v2).

For more information check the Az module link on the PowerShell Gallery: www.powershellgallery.com/packages/Az/3.0.0

After completing the "Reload Cache", go back to the Object Browser and verify that both modules have the correct version.
Az_01_2019-11-21_11-14-30.png
Az_01_2019-11-21_11-14-30.png (155.23 KiB) Viewed 971 times
Az_02_2019-11-21_11-14-30.png
Az_02_2019-11-21_11-14-30.png (226.69 KiB) Viewed 971 times
Module should be updated and cmdlets available.

User avatar
MWinkler
Posts: 3
Joined: Thu May 31, 2018 7:28 am

Re: Problems with Microsoft Az Modules

Post by MWinkler » Fri Nov 22, 2019 1:14 am

The latest version of Az module is: Az 3.0.0
Az 3.0.0 is the parent module to Az.Accounts 1.6.4 and Az.Resources 1.7.1 and i want to keep it simple, but as you mentioned i installed the parent Az 3.0.0 (no changes to version numbers in Az.Accounts and Az.Resources) with:

Code: Select all

Install-Module -Name Az -RequiredVersion 3.0.0 -Scope AllUsers -Force -AllowClobber
...after that, rebuild the cache:
[attachment=]2019-11-22 08_57_33-SAPIEN PowerShell Studio 2019.png[/attachment]
2019-11-22 09_00_53-SAPIEN PowerShell Studio 2019.png
2019-11-22 09_00_53-SAPIEN PowerShell Studio 2019.png (3.62 KiB) Viewed 931 times
...and reload the cache - same result:
with profile "V5 - 64Bit" - Get-AzADUser is "unknown" and Connect-AzAccount working
with profile "V2 - 64Bit" - Get-AzADUser works and Connect-AzAccount is "unknown"
2019-11-22 09_17-17-SAPIEN PowerShell Studio 2019.png
2019-11-22 09_17-17-SAPIEN PowerShell Studio 2019.png (6.3 KiB) Viewed 929 times
In Object Browser the problem is also visible - with profile "V5 - 64Bit" there is no Arrow left to the module Az.Resources but an arrow left to the module Az.Accounts (and clickable) - if i switch to "V2 - 64Bit" the problem reverses (arrow Az.Resources - no arrow left to Az.Accounts)
Attachments
2019-11-22 08_57_33-SAPIEN PowerShell Studio 2019.png
2019-11-22 08_57_33-SAPIEN PowerShell Studio 2019.png (11.91 KiB) Viewed 931 times

User avatar
mxtrinidad
Site Admin
Posts: 369
Joined: Sun Mar 03, 2013 12:42 pm

Re: Problems with Microsoft Az Modules

Post by mxtrinidad » Fri Nov 22, 2019 7:08 am

In the previous post, there's a note on Az module "minimum requirement", which is Windows PowerShell v5.1.
So, this means that Windows PowerShell v2.0 is not supported.

Only Windows PowerShell v5.1 and greater (PowerShell Core -> PowerShell v7) are supported.

User avatar
MWinkler
Posts: 3
Joined: Thu May 31, 2018 7:28 am

Re: Problems with Microsoft Az Modules

Post by MWinkler » Sat Nov 23, 2019 6:34 am

mxtrinidad wrote:
Fri Nov 22, 2019 7:08 am
Only Windows PowerShell v5.1 and greater (PowerShell Core -> PowerShell v7) are supported.
Good to know, but unfortunately this does not solve my problem - i´m using Powershell V5 (exactly v 5.1.18362.145) and as i mentioned, both modules (and all other Az modules) are working fine in Powershell ISE and Standard Powershell - only the Sapien Software does not work.

Any ideas that solves the problem with PowerShell Studio?

User avatar
brittneyr
Site Admin
Posts: 236
Joined: Thu Jun 01, 2017 7:20 am

Re: Problems with Microsoft Az Modules

Post by brittneyr » Mon Nov 25, 2019 8:03 am

To clarify, is the script that is using the Az modules not able to run in PowerShell Studio? Or are you missing the intellisense for the Az modules, but the script still runs?
Brittney Ryn
SAPIEN Technologies, Inc.

User avatar
mxtrinidad
Site Admin
Posts: 369
Joined: Sun Mar 03, 2013 12:42 pm

Re: Problems with Microsoft Az Modules

Post by mxtrinidad » Mon Nov 25, 2019 8:41 am

Seems to work fine in PowerShell Studio!
Az_01_2019-11-25_10-14-25.png
Az_01_2019-11-25_10-14-25.png (575.21 KiB) Viewed 648 times
Az_02_2019-11-25_10-17-25.png
Az_02_2019-11-25_10-17-25.png (196.34 KiB) Viewed 648 times
Try using the Cache Editor! Look for the Az module(s), and make sure the correct version of the module in question is selected,
Then, do the build cache and verify that the version has been updated.