1

I'm using .Net SDK for ACI (Azure Container Instances) to run an exec command

In the response, I only get back this object which doesn't tell me how to get the actual result of the command e.g. exit code and message.

My question is: how to retrieve the exec command results in .NET?

This is my .NET code:

string command = "ls";
var commandResponse = containerGroup.ExecuteCommand("container1", command, 100, 100);

1 Answer 1

0

You can get the LogContent of the container in order to find out what happened. If you are interested only in the newest item, then you can pass 1 as tailLineCount. ContainerExecResponse has a WebSocketUri property as well, which may explain why you do not directly get the info you need in the response object. WebSockets are duplex channels of communication, differing from the request-response protocol-type and in the case of WebSockets, you establish a connection which may run for a very long time, occasionally responding. So here expecting an HTTP-like behavior seems to be a misunderstanding, at least if I look at the docs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.