arcpy, Licensing

347
4
09-15-2021 10:41 AM
Status: Closed
Labels (1)
SteveLewis
Occasional Contributor

Provide the ability to run integrated ArcPy 3.6 operations from database IDEs using tools such as XP_CmdShell.  You can do this with ArcPy 2.7, can't do this with ArcPy 3.6.  

Tags (3)
4 Comments
ShaunWalbridge
Status changed to: Needs Clarification

Can you provide some additional context on what you'd like to accomplish? I'm not familiar with XP_CmdShell and how ArcPy is used in conjunction with a database IDE.

SteveLewis

In SQL Server Management Studio SSMS, we run our store procedures nightly that take several horus to run.  Integrated between SQL and ArcPy as integrated processes.  

.ArcPy 2.7 has worked for years.  
EXEC xp_cmdshell 'C:\Python27\ArcGISx6410.8\python.exe F:\CIA_Python\PROD\PythonScripts\VMS_OBS_COMBINE_LINES.py';

-- This ArcPy 3.6 which does not work with XPCmdShell because it throws licensing issues with or without ArcPro open. This box also has ArcGIS Enterprise installed. 

EXEC xp_cmdshell 'f:\Progra~1\ArcGIS\Pro\bin\Python\scripts\propy.bat N:\CIA_Python\PROD\PythonScripts\VMS_OBS_COMBINE_LINES.py'

 

Tried to clone Python.  That didn;t work, 

Tried

from arcgis.gis import GIS
 
gis = GIS("pro")
 
def print_profile_info(gis):
    print("Successfully logged into '{}' via the '{}' user".format(
           gis.properties.portalHostname,
           gis.properties.user.username))

print_profile_info(gis)

 

ShaunWalbridge
Status changed to: Open

@SteveLewis Thanks for providing some additional context. It looks like this issue may be specific to your environment and require some debugging to determine the nature of the problem. Can you log a support ticket for this case? In the samples given the Python 2.7 environment is running against the Server installation, where the Python 3 environment is running against Pro. It may be that these are licensed differently, or it may be that xp_cmdshell launches these processes as a different user than the authenticated user, and the job needs to be set up to reflect the need to authenticate as the running Pro user. I did install SQL Server Management Studio SSMS, but didn't see anything related to xp_cmdshell built into that package, so imagine there are additional steps to recreate the specific configuration being used, and support is the best avenue to try and tease out where the licensing issue is being hit.

ShaunWalbridge
Status changed to: Closed