I'm trying to execute a powershell script through the managed run commands.
It is working as expected, but when I add RunAsUser
and RunAsPassword
arguments as documented here, these arguments are ignored and the script still executes as systemprofile user.
I verified, the specified user has Virtual Machine Administrator Login role, so it has access to the VM and to any location on this one.
Am I missing something?
The Managed Run Command doesn't seem to work as it should. When running through RunAsUser and RunAsPassword, the command is always called as if the system user called it (so the specified user context is not loaded). I used PsExec of PSTools as a workaround, by getting the user password from key vault directly from the VM powershell script.
There's also another problem I found, when running the managed run command through RunAsUser, the command parameters are not taken into account. Here's a link to an opened issue I found.
It would be great to have something working as described in the microsoft azure documentation for the managed run command, hopefully the azure team will release a fix in the future?