@姣月 曹 , AFAIK, this feature of adding a range of ports to the Load balancer port forwarding configuration is not yet supported.
$vmConfig | Add-AzureEndpoint -Name "CUSTOMUDP" `
-Protocol udp `
-LocalPort 5001 `
-PublicPort 5001 `
-LBSetName "LBCUSTOMUDP" `
-ProbeProtocol tcp `
-ProbePort 5051
Each configuration needs a single public port forwarded to a target internal port.
----------
Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.