ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Core Namespace / ArcGISPortalManager Class / AddPortal Method
The Uri of the portal to be added
Example

In This Topic
    AddPortal Method
    In This Topic
    Add the specified portal represented by the provided portal Uri to the list of portals. This will result in the ArcGIS.Desktop.Core.Events.ArcGISPortalAddedEvent being published. This method should be called from within a QueuedTask or System.Threading.Task unless the caller is within ArcGIS.Desktop.Framework.Contracts.ConfigurationManager.OnApplicationInitializing in which case the main thread should be used.
    Syntax
    public ArcGISPortal AddPortal( 
       Uri portalUri
    )
    Public Function AddPortal( _
       ByVal portalUri As Uri _
    ) As ArcGISPortal

    Parameters

    portalUri
    The Uri of the portal to be added

    Return Value

    A ArcGISPortal for the provided portal Uri
    Exceptions
    ExceptionDescription
    Thrown when a method is called on the wrong Pro thread
    The portal Uri was invalid or there was an error adding the portal to the ArcGISPortalManager
    Example
    ArcGISPortalManager: Add a portal to the list of portals
    var portalUri = new Uri("http://myportal.esri.com/portal/", UriKind.Absolute);
    ArcGISPortalManager.Current.AddPortal(portalUri);
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also