Hello Mihaly Balint ,
Thank you for reaching out to Azure Community Forum.
To allow users to view the IP associated with VMs, you should add the "Microsoft.Network/publicIPAddresses/read" action to the custom role.
Please mark this as answer if this helps.
-Kanika