Closed MaximoTrinidad closed 7 years ago
OK!
I found where the problem with AzureRM.Profile ver 2.1.0 still showing.
I just realized that there was another folder, beside WindowsPowerShell\Modules, where I got more Azure modules loaded:
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager
This raise my concerned on duplicate modules been loaded on a system and some cmdlets stopped working due to version collision.
So, my questions would be, which source should I use for updating my AzureRM modules? And, if the SDK version should warn that Modules already exist?
I'll move the Azure SDK folder out and try to re-installing AzureRM.Profile using PowerShell Gallery. I want to make sure ver.4.0.0 will be loaded.
Hope this will work!
@MaximoTrinidad Hey Maximo, there are two main locations that the modules can be found:
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell
.msi
(from either the Web Platform Installer or the direct link in our GitHub release)C:\Program Files\WindowsPowerShell\Modules
Install-Module
Azure.*
and AzureRM.*
folders from this pathMoving forward, we recommend using the PowerShell Gallery to get the Azure PowerShell modules. We are looking to push out updates to AzureRM
more often since we no longer need to update every module we ship in AzureRM
, which will speed up the install/update.
# Installing the Azure PowerShell modules for the first time
Install-Module -Name AzureRM -Repository PSGallery
# Updating the modules in AzureRM
Update-Module -Name AzureRM
Hi @cormacpayne,
Thanks for responding!
I got the Azure SDK moved and was able to install and use the AzureRM.Profile v.4.0.0 from the Gallery.
I'm starting to have other issues with other cmdlet where a working script won't work.
PS [85] > Get-AzureRmVMSourceImage `
>> -PublisherName Canonical `
>> -Offer UbuntuServer `
>> -Skus 17.10-DAILY `
>> -Version latest
Get-AzureRmVMSourceImage : The term 'Get-AzureRmVMSourceImage' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ Get-AzureRmVMSourceImage `
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-AzureRmVMSourceImage:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
One step at the time! I will run again the 'Install-Module -Name AzureRM -repository PSGallery' and hope this will clear my issues moving forward.
Thanks again, Max
@MaximoTrinidad this might be a result of still having multiple modules installed on your machine in different locations. Would you mind commenting with the result of Get-Module -ListAvailable
?
@cormacpayne
Man! This is painful. Well, finally I'm getting myself learning from Azure Classic to AzureRM, having a good working scripts just to end up redoing them again.
Apparently, now the new version of AzureRM.Compute no longer have the cmdlet Get-AzureRmVMSourceImage which I use to build VM's.
Keep in mind, I have use some of the example on MS Doc for building VM and I found they are out-dated but still figured out the missing code. Now, I got to go back and test my scripts for differences.
Not bad thing, but its tedious!
Just when I was ready to blog about my experience. This is changing fast.
Let me share my Get-Module results: (I included the path and I moved my AzureSDK to another drive)
PS [431] > Get-Module -ListAvailable *AzureRm.* | Select name, version, path
Name Version Path
---- ------- ----
AzureRM.AnalysisServices 0.5.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.AnalysisSer...
AzureRM.ApiManagement 5.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.ApiManageme...
AzureRM.ApplicationInsights 0.1.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Application...
AzureRM.Automation 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Automation\...
AzureRM.Backup 4.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Backup\4.0....
AzureRM.Batch 4.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Batch\4.0.1...
AzureRM.Billing 0.14.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Billing\0.1...
AzureRM.Cdn 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Cdn\4.0.0\A...
AzureRM.CognitiveServices 0.9.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.CognitiveSe...
AzureRM.Compute 4.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Compute\4.0...
AzureRM.Consumption 0.3.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Consumption...
AzureRM.ContainerInstance 0.1.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.ContainerIn...
AzureRM.ContainerRegistry 0.3.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.ContainerRe...
AzureRM.DataFactories 4.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.DataFactori...
AzureRM.DataFactoryV2 0.3.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.DataFactory...
AzureRM.DataLakeAnalytics 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.DataLakeAna...
AzureRM.DataLakeStore 5.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.DataLakeSto...
AzureRM.DevTestLabs 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.DevTestLabs...
AzureRM.Dns 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Dns\4.0.0\A...
AzureRM.EventGrid 0.2.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.EventGrid\0...
AzureRM.EventHub 0.5.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.EventHub\0....
AzureRM.HDInsight 4.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.HDInsight\4...
AzureRM.Insights 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Insights\4....
AzureRM.IotHub 3.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.IotHub\3.0....
AzureRM.KeyVault 4.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.KeyVault\4....
AzureRM.LogicApp 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.LogicApp\4....
AzureRM.MachineLearning 0.16.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.MachineLear...
AzureRM.MachineLearningCompute 0.2.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.MachineLear...
AzureRM.MarketplaceOrdering 0.2.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Marketplace...
AzureRM.Media 0.8.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Media\0.8.0...
AzureRM.Network 5.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Network\5.0...
AzureRM.NotificationHubs 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Notificatio...
AzureRM.OperationalInsights 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Operational...
AzureRM.PowerBIEmbedded 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.PowerBIEmbe...
AzureRM.profile 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.profile\4.0...
AzureRM.RecoveryServices 4.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.RecoverySer...
AzureRM.RecoveryServices.Backup 4.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.RecoverySer...
AzureRM.RecoveryServices.SiteRecovery 0.2.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.RecoverySer...
AzureRM.RedisCache 4.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.RedisCache\...
AzureRM.Relay 0.3.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Relay\0.3.0...
AzureRM.Resources 5.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Resources\5...
AzureRM.Scheduler 0.16.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Scheduler\0...
AzureRM.ServerManagement 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.ServerManag...
AzureRM.ServiceBus 0.5.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.ServiceBus\...
AzureRM.ServiceFabric 0.3.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.ServiceFabr...
AzureRM.SiteRecovery 5.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.SiteRecover...
AzureRM.Sql 4.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Sql\4.0.1\A...
AzureRM.Storage 4.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Storage\4.0...
AzureRM.StreamAnalytics 4.0.1 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.StreamAnaly...
AzureRM.Tags 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Tags\4.0.0\...
AzureRM.TrafficManager 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.TrafficMana...
AzureRM.UsageAggregates 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.UsageAggreg...
AzureRM.Websites 4.0.0 C:\Users\max_t\Documents\WindowsPowerShell\Modules\AzureRM.Websites\4....
AzureRM.AnalysisServices 0.5.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.AnalysisServices\0....
AzureRM.ApiManagement 5.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.ApiManagement\5.0.1...
AzureRM.ApplicationInsights 0.1.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.ApplicationInsights...
AzureRM.Automation 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Automation\4.0.0\Az...
AzureRM.Backup 4.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Backup\4.0.1\AzureR...
AzureRM.Batch 4.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Batch\4.0.1\AzureRM...
AzureRM.Billing 0.14.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Billing\0.14.0\Azur...
AzureRM.Cdn 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Cdn\4.0.0\AzureRM.C...
AzureRM.CognitiveServices 0.9.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.CognitiveServices\0...
AzureRM.Compute 4.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Compute\4.0.1\Azure...
AzureRM.Consumption 0.3.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Consumption\0.3.0\A...
AzureRM.ContainerInstance 0.1.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.ContainerInstance\0...
AzureRM.ContainerRegistry 0.3.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.ContainerRegistry\0...
AzureRM.DataFactories 4.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.DataFactories\4.0.1...
AzureRM.DataFactoryV2 0.3.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.DataFactoryV2\0.3.0...
AzureRM.DataLakeAnalytics 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.DataLakeAnalytics\4...
AzureRM.DataLakeStore 5.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.DataLakeStore\5.0.0...
AzureRM.DevTestLabs 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.DevTestLabs\4.0.0\A...
AzureRM.Dns 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Dns\4.0.0\AzureRM.D...
AzureRM.EventGrid 0.2.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.EventGrid\0.2.0\Azu...
AzureRM.EventHub 0.5.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.EventHub\0.5.0\Azur...
AzureRM.HDInsight 4.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.HDInsight\4.0.1\Azu...
AzureRM.Insights 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Insights\4.0.0\Azur...
AzureRM.IotHub 3.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.IotHub\3.0.0\AzureR...
AzureRM.KeyVault 4.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.KeyVault\4.0.1\Azur...
AzureRM.LogicApp 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.LogicApp\4.0.0\Azur...
AzureRM.MachineLearning 0.16.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.MachineLearning\0.1...
AzureRM.MachineLearningCompute 0.2.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.MachineLearningComp...
AzureRM.MarketplaceOrdering 0.2.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.MarketplaceOrdering...
AzureRM.Media 0.8.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Media\0.8.0\AzureRM...
AzureRM.Network 5.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Network\5.0.0\Azure...
AzureRM.NotificationHubs 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.NotificationHubs\4....
AzureRM.OperationalInsights 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.OperationalInsights...
AzureRM.PowerBIEmbedded 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.PowerBIEmbedded\4.0...
AzureRM.profile 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.profile\4.0.0\Azure...
AzureRM.RecoveryServices 4.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.RecoveryServices\4....
AzureRM.RecoveryServices.Backup 4.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.RecoveryServices.Ba...
AzureRM.RecoveryServices.SiteRecovery 0.2.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.RecoveryServices.Si...
AzureRM.RedisCache 4.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.RedisCache\4.0.1\Az...
AzureRM.Relay 0.3.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Relay\0.3.0\AzureRM...
AzureRM.Resources 5.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Resources\5.0.0\Azu...
AzureRM.Scheduler 0.16.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Scheduler\0.16.0\Az...
AzureRM.ServerManagement 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.ServerManagement\4....
AzureRM.ServiceBus 0.5.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.ServiceBus\0.5.0\Az...
AzureRM.ServiceFabric 0.3.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.ServiceFabric\0.3.0...
AzureRM.SiteRecovery 5.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.SiteRecovery\5.0.1\...
AzureRM.Sql 4.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Sql\4.0.1\AzureRM.S...
AzureRM.Storage 4.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Storage\4.0.1\Azure...
AzureRM.StreamAnalytics 4.0.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM.StreamAnalytics\4.0...
AzureRM.Tags 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Tags\4.0.0\AzureRM....
AzureRM.TrafficManager 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.TrafficManager\4.0....
AzureRM.UsageAggregates 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.UsageAggregates\4.0...
AzureRM.Websites 4.0.0 C:\Program Files\WindowsPowerShell\Modules\AzureRM.Websites\4.0.0\Azur...
PS [543] >
Please feel free to reach out! :)
@MaximoTrinidad would you mind pointing me at the module version you were using that had the Get-AzureRmVMSourceImage
cmdlet, as well as any document that uses it? I am unable to find any version of AzureRM.Compute
that contains this cmdlet. I can find Set-AzureRmVMImageSource
all the way back in the 1.0.0 release of Azure PowerShell, but can never find Get-AzureRmVMImageSource
.
Also, would you mind linking to the out-dated docs from any Microsoft site you're using? We'll work with the docs team to get those updated.
@cormacpayne
Sure!
Documentation that I follow until I discovered it will failed because it was missing the code for:
Set-AzureRmVMOSDisk
Azure Documentation pages missing code are:
The quick create VM wasn't really a quick as it was missing the Set-AzureRmVMOSDisk piece to complete the demo sample.
My version completed with:
## - Adapted from Microsoft Sample:
$vmCfg = New-AzureRmVMConfig `
-VMName mx1W2k1601 -VMSize Standard_DS2 `
| Set-AzureRmVMOperatingSystem -Windows `
-ComputerName mx1W2k1601 `
-Credential $MyCred `
-ProvisionVMAgent `
-EnableAutoUpdate `
| Set-AzureRmVMSourceImage -PublisherName MicrosoftWindowsServer `
-Offer WindowsServer `
-Skus 2016-Datacenter `
-Version latest `
| Add-AzureRmVMNetworkInterface -Id $mx1NicAdapter01.Id;
## - **Added missing code** below before creating VM: (Needed in both Windows and Ubuntu samples)
## - Splatting sample:
$vmname = 'mx1W2k1601';
$OSDiskName = 'mx1Disk1';
$MyRMStorAcct = Get-AzureRmStorageAccount;
$OSDiskUri = $MyRMStorAcct.PrimaryEndpoints.Blob.ToString() + "vhds/" + $vmName + $osDiskName + ".vhd";
$newOsDiskParams = @{
'Name' = 'OSDisk'
'CreateOption' = 'fromImage'
}
Set-AzureRmVMOSDisk @newOsDiskParams `
-VM $vmCfg -VhdUri $osDiskUri;
Bottom line! I got the issue of the AzureRM.Profile fixed after getting rid of the other Azure Modules. Everything else is back to normal.
Thanks for helping!
@MaximoTrinidad awesome, thanks for this information!
@sdwheeler Hey Sean, would you mind looking at the comments above from Maximo? It looks like some of our samples might be outdated.
@cormacpayne - @neilpeterson - Neil is the author of those sample scripts.
Neil can you look at these samples?
Cmdlet(s)
Issues with:
PowerShell Version
Instructions: to get PowerShell version, type
$PSVersionTable
and look for the value associated withPSVersion
Module Version
Not Sure! As this is part of the problem. It's showing version 2.1.0 when in fact it seems to have installed 4.0.0.
Even when I have use 'Uninstall-Module AzureRM.Profile -Force. It still showing version 2.1.0 in the list.
OS Version
Instructions: to get OS version, type
$PSversionTable
and look for value associated withBuildVersion
Description
First, this last weekend I successfully create some AzureRM automation script in Windows PowerShell. Then, on Monday I updated my AzureRM modules just end up finding that I can't use some of my automation cmdlets erroring out.
Of course, I'm suspecting changes has been made. I've tried to install AzureRm.Profile ver 4.0.0 and finished without any error. Except, that when executing the following command:
It still shows ver.2.1.0 and I can't get rid of AzureRM.Profile ver. 2.1.0 even when it telling me is removed.
Debug Output
Instructions: to get Debug Output, set
$DebugPreference="Continue"
and then execute the cmdlet or script causing the issueScript/Steps for Reproduction
This maybe tough to repo as, maybe some cmdlets may have been deprecated. On my successful script the following cmdlets did work after login to AzureRM:
See image where is shows that I have remove the module but still shows up.
Additional observation:
Using File Explorer I did a search for anything AzureRM.Profile. Look at what I found:
Is this correct? Look at the date of this file "11/08/2017".