Hey Jared,
If you're running the UpdateCursor on a hosted feature service, you will want to specify the URL to the feature service (i.e. https://portal.esri.com/arcgis/rest/services/Airports/FeatureServer/0).
Also, unless the service is shared with Everyone, whether the service is hosted in AGOL or Portal, you will need to generate a token. Below is an example on how to generate one for each.
import arcpy, requests, json
requests.packages.urllib3.disable_warnings()
username = 'admin'
password = 'gis12345'
tokenURL = 'https://www.arcgis.com/sharing/rest/generateToken'
params = {'f': 'pjson', 'username': username, 'password': password, 'referer': 'http://www.arcgis.com'}
r = requests.post(tokenURL, data = params, verify=False)
response = json.loads(r.content)
token = response['token']
username = 'portaladmin'
password = 'gis12345'
tokenURL = 'https://portal.esri.com:7443/arcgis/sharing/rest/generateToken/'
params = {'f': 'pjson', 'username': username, 'password': password, 'referer': 'https://portal.esri.com'}
r = requests.post(tokenURL, data = params, verify=False)
response = json.loads(r.content)
token = response['token']
fc = "https://portal.esri.com/arcgis/rest/services/Hosted/Airports/FeatureServer/0?token={0}".format(token)
with arcpy.da.SearchCursor(fc, ["*"]) as cursor:
for row in cursor:
print(row[0])
del cursor
with arcpy.da.SearchCursor(fc, ["*"]) as cursor:
for row in cursor:
print(row[0])
del cursor