Also note that you can access the ID of anything in your portal using the ArcGIS Python API. If you're running it from Pro, it might look like:
from arcgis.gis import GIS
gis = GIS("home")
search = gis.content.search('some service name or search term', max_items=-1)
[f'{i.id} | {i.title[:32]:32} | {i.type}' for i in search]
I think @DonMorrison1 has the proper solution to this, but if you needed to find the ID after the fact, being able to quickly search the portal and return it is useful as well.
- Josh Carlson
Kendall County GIS