Hi @NK, SatishKumar ,
As explained in this Azure document, runbooks that run in Azure sandboxes don't support calling processes, such as executables (.exe files like kubectl) or subprocesses. The reason for this is that an Azure sandbox is a shared process run in a container that might not be able to access all the underlying APIs. For scenarios requiring third-party software or calls to subprocesses, you should execute a runbook on a Hybrid Runbook Worker. So, you may try to use the Hybrid Runbook Worker feature of Azure Automation to run runbooks calling kubectl directly on the machine hosting it and against resources in the environment to manage those local resources. Runbooks are stored and managed in Azure Automation and then delivered to one or more assigned machines.
Or as suggested by @Konstantinos Passadis , you may use module's like Microsoft.PowerShell.KubeCtl but if you go with them then you might not be able to directly use kubectl command in your runbook running in Azure sandbox but you might have to use the PowerShell cmdlet's provided by the module. Please check below screenshots to find all such kubectl related PowerShell Azure Automation modules and also what are the PowerShell cmdlets supported by Microsoft.PowerShell.KubeCtl and how to use them.