Here are the steps to follow to create/add custom ports:
1. If its already not created, than you need to create custom port(s):
-->Goto security-->"Add custom Security Group"-->Give a Group name, say "group888"-->Add Rules (Select the Protocol(UDP/TCP)/PORT/Ingress/Egress)-->Done
2. Next step is to apply these custom ports to VM's (Existing or New VM's), You can click on the three vertical dots on the right of the VM summary view. Select the "Assign Security group" and select the appropriate security group.. These include adding or removing security groups.
Note: You can add the custom ports to existing or a new VM that's created.