I have a workflow where I update data on a nightly basis. The same data that I am updating also feeds a web mapping service that is served up through ArcGIS Server (AGS) (10.7.1).
The issue that I am running into is that the service is putting a lock on my source data and therefore cannot update it.
I did find an article where you could turn off Lock Database Schema. Instead of updating the feature class row by row I just recreate the feature locally and then overwrite the feature class that sits on our server. Unfortunately, this did not prevent my feature class from still being locked.
Disable schema locking on a map service—ArcGIS Server Administration (Windows) | Documentation for ArcGIS Enterprise
When I manually stop the service, my script runs perfectly and the feature class in question is updated. So naturally I started investigating how one would stop an AGS service using Python. I came across the following article.
How To: Stop GIS Services Using ArcGIS API for Python
The problem that I encounter is that I cannot actually connect to my AGS.
from arcgis.gis import GIS
import arcgis.gis.admin
gis = GIS("https://XYZ/MyWebAdaptor/admin", "MyLogin", "MyPassword", verify_cert=False)
I get multiple errors all relating to a login error.
Exception: A general error occurred: Could not login. Please ensure you have valid credentials and set your security login question.
I used the exact same URL and login information to access my AGS in ArcGIS Pro. I also use the same login information to login into AGS Manager.
I'm not sure what I am missing when I can use the same information to login multiple ways but when using python, it does not recognize the login.
Any assistance or suggestions would be greatly appreciated.
Thank you.
~DJB