Share via

Java SDK: Can't create container instance with private IP

Radek 1 Reputation point
2021-12-21T16:20:03.957+00:00

I am trying to create a container instance using Java SDK. For containers with public IP Address it works fine but with private it breaks with error:

Missing required property ports in model IpAddress

I have went through documentation and SDK and I found only withInternalTcpPort() and withInternalUdpPort() and no means to set IP address (although I would like it be be auto-generated like when creating container in the UI).

Anything I have missed?

Azure Container Instances

1 answer

Sort by: Most helpful
  1. Radek 1 Reputation point
    2021-12-21T17:07:45.337+00:00

    So I have figured it out after I posted the question...
    For private IP you can't set DNS prefix because the SDK assumes that the IP is public and since there are no public IP addresses we get the error.

    Was this answer helpful?

    0 comments No comments

Your answer

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