Defining ACI instance in C# with automatically generated Public IP

Christopher Dunderdale 1 Reputation point
2022-04-25T14:51:18.817+00:00

Hi - I've got two implementations for an Azure container Instance, one which automatically creates a public IP in the Container Instance Overview blade (or uses a default setting I'm not aware of) and one which does not allow me to set the public IP to be automatically generated.

In the code below the Azure CLI code deploys the container instance with an automatically assigned IP - I assume this is related to the --ip-address public call. In the F# equivalent code, I am required to supply a FQDN (or null), but the IP is not automatically assigned. Is there something obvious that I'm missing?

Just as a side - the F# code doesn't via the SDK does not produce a working ACI so I'm a bit puzzled what the problem is. It works perfectly with the Azure CLI and locally

UPDATE 1

Logging for ACI instances is only present the first time you create it (for some reason) - getting an additional error here which might help, but begs the question why it works in CLI, but not here. I've also tried tail -f /home with the same error and I know that the folder exists.

Error: Failed to start container <ContainerName>, Error response: to create containerd task: failed to create container <ContainerID>: guest RPC failure: failed to create container: failed to run runc create/exec call for container <ContainerID> with container_linux.go:349: starting container process caused "exec: \"tail -f /dev/null\": stat tail -f /dev/null: no such file or directory": exit status 1: unknown

UPDATE 2
I've been comparing the ARM templates between the CLI and SDK. Just noticed something different in the way the commands are defined for CLI compared to SDK. I've uploaded both. below. the Command part of the definition. This might be nothing, but thought I should point it out.
Azure CLI:
"command":
[
"tail",
"-f",
"/dev/null"
],

F# Code

"command": [
"tail -f /home"
],

196244-fsharp.txt
196195-azure-cli.txt

Azure CLI Code

az container create --name [containerName] --image [ImageName] --ip-address public -g [RG] --azure-file-volume-account-key [StorageKey] --azure-file-volume-account-name [StorageAccountName] --azure-file-volume-share-name [FileShareName] --azure-file-volume-mount-path /specialfileshare --command-line "tail -f /dev/null"

F# Equivalent
196146-mstsc-hizsayh4fe.png

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
709 questions
.NET F#
.NET F#
.NET: Microsoft Technologies based on the .NET software framework.F#: A strongly typed, multi-paradigm programming language developed by the F# Software Foundation, Microsoft, and open contributors.
106 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.