3

I need to run kubectl commands in Azure Automation Runbook. I tried installing it from PowerShellGallery but the deployment failed with error :

"Unable to process template language expressions for resource '/subscriptions/XXX/resourceGroups/XXX/providers/Microsoft.Automation/automationAccounts/XXX/runbooks/install-kubectl' at line '17' and column '5'. 'The language expression property 'Version' doesn't exist, available properties are 'Name, Uri, Type, Description'"

I didn't find it in module gallery either.

Is there any way to run kubectl in Azure Automation runbook or any other way then kubectl to get nodes and assign roles in cluster using PowerShell.

  • try using [this](https://github.com/felixfbecker/PSKubectl) powershell module – 4c74356b41 Sep 27 '19 at 05:32
  • I tried to import PSKubectl in my automation account but got error " Import failed with the following error: Orchestrator.Shared.AsyncModuleImport.ModuleImportException: An error occurred during module validation. When importing the module to an internal PowerShell session, it was not able to be loaded by PowerShell. There is likely an issue with the contents of the module that results in PowerShell's not being able to load it. Please verify that the module imports successfully in a local PowerShell session, correct any issues, and then try importing again." – rewati upadhyay Sep 30 '19 at 03:39
  • did you do what it prompts you to do? – 4c74356b41 Oct 01 '19 at 05:40

0 Answers0