Is possible to publish a Geoprocessing service using only python on ArcGIS pro

737
4
Jump to solution
03-10-2020 03:25 AM
Cristian_AndresGalindo_Londoño
Occasional Contributor III

In the process to publish a python tool, I came to the part of automate the deployment process. i start using python for it.

reading the documentation i found CreateGPSDDraft—ArcPy Functions | Documentation 

as well as Upload Service Definition—Help | Documentation 

The first function use a parameter connection_file_path ( A string that represents the path and file name to the ArcGIS Server connection file (.ags).)

The second function in the example 2 shows how to use the ags file for the connecttion.

How can I create the ags file using python in ArcGIS Pro?

Is it possible to make all this process publishing to an ArcGIS server having a user with proper rights and its password (no ags file)?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MaxSquires
Occasional Contributor
4 Replies
RobertBorchert
Frequent Contributor III

You may be able to use the Upload Service Definition Tool and bring that into a  model that you can export to a python script.

0 Kudos
Cristian_AndresGalindo_Londoño
Occasional Contributor III

The use of the proposed tool does not solve the main question: How can I create the ags file using python in ArcGIS Pro?

neither answer the second one: Is it possible to make all this process publishing to an ArcGIS server having a user with proper rights and its password (no ags file)?

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

I suggest using the ArcGIS API for Python to publish/upload SD files:  arcgis.gis.server module — arcgis 1.8.0 documentation.  In terms of the GIS Server connection files for CreateGPSDDraft—ArcPy Functions | Documentation and similar tools, the connection_file_path parameter is optional, i.e., you can create a draft SD without having to connect to a server.

MaxSquires
Occasional Contributor