Specify a port range when creating a container instance

David Griffith 6 Reputation points

How can I specify a port range when creating a container instance? There is an option to add up to 5 ports but it only takes an array of integers. How can I expose ports 49152-65535?

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
455 questions
1 vote

2 answers

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 12,396 Reputation points Microsoft MVP

    Hi @David Griffith

    Refer to the below url it is explained expose multiple port on azure container instance.

    If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.

    No comments

  2. Stan-19835 21 Reputation points

    I know this question is answered a long time ago, but I found this as the first hit on Google. So I thought to answer it still anyway.

    Unfortunately it doesn't look like it's possible to open a port range in the traditional way. The documentation states: (for the az command).

    A list of ports to open. Space-separated list of ports.
    default value: [80]

    And for the yml reference

    Port object
    Name Type Required Value
    protocol enum No The protocol associated with the port. - TCP or UDP
    port integer Yes The port number.

    Conclusion. It doesn't look like it's possible and you'll just have to paste in the ports manually into your yml file or az command.

    No comments