I'm having trouble publishing a survey from Survey123 Connect using an existing feature service. When trying to use a service account to create and publish the survey to the feature service, I keep getting "Error 401: Unauthorized". When I use my personal account to create and publish, it works fine. The service account can published a hosted survey fine.
The service account and I both have the same user type and role in our Portal (11.3). I've tried having my account own the feature service, as well as the service account own the feature service. The service account cannot publish even when it owns the feature service.
The feature service is published off of a feature class in a SQL Server EGDB. The feature class was created by my personal account in the database, but published as a feature service using the service account. The service account has edit permissions to the database feature class, and CAN edit and add new records to the published feature service inside a web map.
This is obviously a permissions problem but I can't figure out why or where. If the service account has database permissions to the feature class, owns the feature service and can make edits in a web map -- why can't it publish a survey?
Forms are tied to the owner of the account and only the owner can change them. (Remember a form is the json that is the actual form and the service - they are not really connected. ) This is a AGOL limitation. If you look in the My Survey Designs folder there is a .iteminfo file. Look in there and you will see the form owner and the itemid of the AGOL folder the form is in. You can change these to a different owner and then move the folder to a folder owned by the new owner. This means its pretty hard to flip back and forth it is more of a one time move. The latest 123 version I think can handle moving folders but I have not tested any of it yet.
Hope that helps.
Hi Doug. That's actually the reason we want to use a service account to publish the form; so that we can all login as the owner and work on it. BUT - the problem here is that I can't even publish the form to begin with. I get the unauthorized error when I try to publish a NEW survey with our service account login, collecting data into an existing feature service.
Have you set the submission URL? I would check the survey123 collaborate tab. Is your 123 up to date I see this posted but its old https://community.esri.com/t5/arcgis-survey123-questions/survey123-receiving-a-lot-of-401-unauthoriz...
Next I would turn on logging and see if you get any more info. https://doc.arcgis.com/en/survey123/desktop/get-answers/troubleshootgetanswers.htm#ESRI_SECTION1_C17...
Yep, submission URL is set. Logging just repeats the same error that the user is not authorized.
When I do the exact same steps with my personal account (same role in the Portal), it works and publishes fine.
It has to be something at the database level? The only difference in permissions at any point in the workflow is that my user owns the database feature class. But, the service account owns the feature service published off of the feature class. I'm so confused!