Create GIS Server connection to ArcGIS online

1643
3
07-27-2016 12:37 PM
MichaelPorter1
New Contributor III


I can create a read only GIS Server connection to ArcGIS online with the URL:

http://services3.arcgis.com/A6Zjpzrub8ESZ3c7/arcgis/rest/services

but when I try and create a publish service with the same url it fails. Any ideas?

0 Kudos
3 Replies
KellyGerrow
Esri Frequent Contributor

Hi,

I think you are using ArcMap and trying to publish to ArcGIS Online. To do this, Sign into ArcGIS Online from File> Sign in and then follow the steps outlined in this documentation: Publish hosted feature layers—ArcGIS Online Help | ArcGIS

-Kelly

0 Kudos
MichaelPorter1
New Contributor III

Yes but what if I want to login programmatically so I can put in script? Only works if I connect as described below its fine but can't change user in script.

Sent from my iPhone

0 Kudos
KellyGerrow
Esri Frequent Contributor

Hi Michael,

There are a few ways to go about scripting publishing. You can try this by scripting direct rest calls using the rest API and using arcpy to create the SD file.

Check out the following github repo for a sample using arcpy and  Rest API calls ​This script generates a token for authentication and then add's an item and publishes the item.

-Kelly

0 Kudos