ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core Namespace / ArcGISPortal Class / PortalUri Property
Example

In This Topic
    PortalUri Property (ArcGISPortal)
    In This Topic
    Gets the portal Uri for this portal instance
    Syntax
    Public ReadOnly Property PortalUri As Uri
    public Uri PortalUri {get;}
    Example
    ArcGISPortalManager: Get the Current Active Portal
    {
      var active_portal = ArcGISPortalManager.Current.GetActivePortal();
      string uri = active_portal.PortalUri.ToString();
    }
    ArcGISPortalManager: Get a list of all your Portals
    {
      var portals = ArcGISPortalManager.Current.GetPortals();
      //Make a list of all the Uris
      var portalUris = portals.Select(p => p.PortalUri.ToString()).ToList();
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also