Execute command from REST API in ACI

146 Views Asked by At

I'm trying to figure out how to run a command in an Azure Container Instance via the REST API. (https://learn.microsoft.com/en-us/rest/api/container-instances/containers/execute-command?view=rest-container-instances-2023-05-01&tabs=HTTP)

I can POST and get the WSS URL and password, but connecting then sending the password along returns > in HEX. I can decode some of the HEX sent from postman, and it's just the command I sent given back to me in binary.

I am trying to run rcon-cli which in theory returns a shell in which I can run commands to my app. However, due to the above 'command echoing' as I'm dubbing it, nothing happens. Is there any docs out there on this WebSocket server? Thank you!

I have tried the following:

  • Using application/json, to no avail. It simply uses application/octet-stream, which is expected.
  • Omitting the terminal size query parameter from the WSS URL. Unsure why there is a terminal size parameter in the first place.
  • Encoding what I send in HEX.
  • Creating a simple plain JS webapp

Here is a screenshot from postman of me trying to send the password. Sometimes it'll send me a >, sometimes it does nothing.

postman

0

There are 0 best solutions below