Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Get-AutomationPSCredential when installed on an Azure Automation Hybrid Worker #134

Closed
michaeljprentice opened this issue Mar 29, 2017 · 4 comments

Comments

@michaeljprentice
Copy link

The error returned, if an Asset isn't downloaded to the server while the addon is installed;

:[localhost]:AzureAutomationAuthoringToolkit: Warning - Local value for
PSCredential asset "onpremexcCred" not found

Fix is to uninstall the Addon from the Hybrid Worker. Thanks to sn0m55 for pointing it out

https://social.msdn.microsoft.com/Forums/en-US/ac204c88-7f95-48b6-8ab6-656253735aa2/getautomationpscredential-hybrid-worker?forum=azureautomation

@eamonoreilly
Copy link
Contributor

Hi Michael,
The toolkit emulates the internal activities (like Get-AutomationPSCredential) so that runbooks can be authored and tested locally. Since these activities are also used by the hybrid worker when running runbooks from the service, they conflict, as you have seen above. The solution to this is to not put the toolkit into the program files\windowspowershell\modules which unfortunately the default when installing from the PowerShell gallery. Instead if you install it into your own scope by using Install-Module AzureAutomationAuthoringToolkit -Scope CurrentUser then the hybrid worker will not find these emulated activities and instead use the ones required for it to work correctly.
Hopefully this helps you getting the add-on going again and please let me know if this does not solve your issue.
Sorry you hit this,
Eamon

@eamonoreilly
Copy link
Contributor

Closing issue since the workaround should help here and I also updated the PowerShellGallery download page to let customers know they should use the -Scope CurrentUser when installing the add-on.
Thanks for the feedback,
Eamon

@Ashish-Jovial
Copy link

Hi Michael,
The toolkit emulates the internal activities (like Get-AutomationPSCredential) so that runbooks can be authored and tested locally. Since these activities are also used by the hybrid worker when running runbooks from the service, they conflict, as you have seen above. The solution to this is to not put the toolkit into the program files\windowspowershell\modules which unfortunately the default when installing from the PowerShell gallery. Instead if you install it into your own scope by using Install-Module AzureAutomationAuthoringToolkit -Scope CurrentUser then the hybrid worker will not find these emulated activities and instead use the ones required for it to work correctly.
Hopefully this helps you getting the add-on going again and please let me know if this does not solve your issue.
Sorry you hit this,
Eamon

I tried this but didn't work for me.

@eamonoreilly
Copy link
Contributor

Can you run 'Get-Module -ListAvailable | where {$_.Name -match 'AzureAutomationAuthoringToolkit'} | Format-List' and make sure that the module is only installed in the current user directory. You will need to open up a new PowerShell ISE session to make sure that existing modules are unloaded also if you already had it installed.
Thanks,
Eamon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants