azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Unable to update azurerm.profile module in azure automation

Open mani0070 opened this issue 10 years ago • 6 comments

Cmdlet(s)

PowerShell Version

Instructions: to get PowerShell version, type $PSVersionTable and look for the value associated with PSVersion PS C:\Users\mani> $PSVersionTable

Name Value


PSVersion 5.1.14393.206
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.206
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Module Version

OS Version

Instructions: to get OS version, type $PSversionTable and look for value associated with BuildVersion

Description

Debug Output

Instructions: to get Debug Output, set $DebugPreference="Continue" and then execute the cmdlet or script causing the issue

Script/Steps for Reproduction

Set-AzureRmAutomationModule -AutomationAccountName -ResourceGroupName -Name AzureRM.profile -ContentLinkUri https://www.powershellgallery.com/api/v2/package/AzureRM.profile -ContentLinkVersion 2.2.0 -Verbose Below is error message BadRequest: {"Message":"The account is unauthorized to create or update a global module."} (raised by: Set-AzureRmAutomati onModule)

mani0070 avatar Oct 10 '16 10:10 mani0070

@safeermohammed @eamonoreilly Can you take a look?

markcowl avatar Oct 11 '16 01:10 markcowl

Can you do a Get-AzureRmAutomationModule on AzureRm.profile and check if IsGlobal = true?

If yes, Please use New-AzureRmAutomationModule cmdlet to create the module in your account.

safeermohammed avatar Oct 11 '16 16:10 safeermohammed

Get-AzureRmAutomationModule returns below Name : AzureRM.Profile IsGlobal : True Version : 1.0.3 SizeInBytes : 982675 ActivityCount : 13 CreationTime : 24/11/2015 19:30:38 +00:00 LastModifiedTime : 23/09/2016 16:47:11 +01:00 ProvisioningState : Created

executing above command I don't get any powershell error message. below is the output ResourceGroupName : dilabsauto AutomationAccountName : dilabs Name : AzureRM.profile IsGlobal : False Version : SizeInBytes : 0 ActivityCount : 0 CreationTime : 11/10/2016 21:27:35 +01:00 LastModifiedTime : 11/10/2016 21:27:35 +01:00 ProvisioningState : Creating

But I see error message in the portal image

Error extracting the activities from module AzureRM.profile. Extraction failed with the following error: Orchestrator.Shared.AsyncModuleImport.ModuleImportException: An internal error occurred during module import while attempting to store module content. This could be a transitory network condition - please try the operation again.

mani0070 avatar Oct 11 '16 20:10 mani0070

If you are updating all the Azure*RM Modules then use the Update-ModulesInAutomationToLatestVersion script from PowerShellGallery. It is recommended to update all modules.

Note:

  1. Please Click Runbooks => Browse Gallery => Click on Filter => Set the Gallery Source to PowerShellGallery => Click OK in Filter Screen => Search for Update-ModulesInAutomationToLatestVersion.
  2. Please make sure the AzureRM.Profile and AzureRM.Automation are of same version if not Update-ModulesInAutomationToLatestVersion will not work.
  3. This Update-ModulesInAutomationToLatestVersion needs RunAsAccount.

safeermohammed avatar Oct 12 '16 17:10 safeermohammed

Thanks for the update Below are the warnings I get image

mani0070 avatar Oct 12 '16 21:10 mani0070

Closing this issue as there has been no activity for the last few months.

@mani0070 please feel free to reopen this issue if you find it is still a problem.

cormacpayne avatar Mar 04 '17 01:03 cormacpayne