Hello,
I would like to use arcpy to share a map package (.mpk) in both ArcGIS Online and our local Portal.
I have been testing the SignInToPortal_server (username, password, portal_url) function but the 'portal_url' parameter seems meaningless (see bold text in the below documentation).
The Sign In To Portal tool reads the URL set in Desktop Administrator. Any user entered value is ignored. The default value is URL for the ArcGIS portal currently chosen by the user in Desktop Administrator.
Basically I would like to do the below but I can not get around the settings pre-stored in Desktop Administrator....
arcpy.SignInToPortal_server("username","password", "http://www.arcgis.com/")
# TO DO ->: Upload Map Package to ArcGIS.com
arcpy.SignOutFromPortal_server()
arcpy.SignInToPortal_server("username","password", "http://www.myLocalPortalURL.com/")
# TO DO->: Upload Map Package to Local Portal
arcpy.SignOutFromPortal_server()
Any ideas on how to change my portal URL programmatically?
Andrew
This does not really answer your question. But as a workaround, can you just set up another username bound to the alternate URL? The docs do seem to say that the third parameter is completely ignored.
Thanks for the suggestion Ellery, but unfortunately no matter what I do the function always seems to call the connected portal defined in ArcGIS Administrator (as seen in Fiddler). I think I will be exploring the REST API or ArcObjects to accomplish this.
Andrew