0

I am trying to connect to a container instance and run a command on it using

IContainerGroup.ExecuteCommandAsync("dockerImage", "Command","Command".Length, 1);

This returns a password and a webhookUri. What am I supposed to do with that information?

It doesn't appear that my "Command" worked. I have tried something as simple as

"/bin/sh -c \"touch fileTest.txt\"" 

but that doesn't work.

I am at a loss.

ArbiterUnknown
  • 113
  • 2
  • 13

1 Answers1

0

There are two questions in your description. One is how to do with the WebSocket the code returned. Another is the command that executes in the ACI doesn't work.

A1: You need to access the WebSocket URI and send the password, then it will return the result of the command which you execute in the ACI via the C# code. You can take a look at WebSocket in C# here.

A2: To execute commands in the ACI, it does not support arguments, so you just can execute the single command such as ls and pwd. ACI is quick to start and good to run the application, but it's not good to interact.

For the second question, if you want more controls and interactions with your application, the AKS is better than ACI.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39