<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pubilishing to ArcGIS Online via Arcpy in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181438#M7470</link>
    <description>&lt;P&gt;Here you go...See the attachment for the code as a text file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Portal Update Service (updateService.py)&lt;BR /&gt;# Purpose:&lt;BR /&gt;#&lt;BR /&gt;# Author: John Spence, Spatial Data Administrator, City of Bellevue&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;# Created:&lt;BR /&gt;# Modified:&lt;BR /&gt;# Modification Purpose:&lt;BR /&gt;#&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# 888888888888888888888888888888888888888888888888888888888888888888888888888888&lt;BR /&gt;# ------------------------------- Configuration --------------------------------&lt;BR /&gt;# To be completed.&lt;BR /&gt;#&lt;BR /&gt;# ------------------------------- Dependencies ---------------------------------&lt;BR /&gt;# 1) Using PIP, install PyODBC if you have not previously.&lt;BR /&gt;# 2) This script assumes you are using MS SQL as your RDBMS.&lt;BR /&gt;#&lt;BR /&gt;# 888888888888888888888888888888888888888888888888888888888888888888888888888888&lt;/P&gt;&lt;P&gt;# Portal Signin Config&lt;BR /&gt;portalURL = r'&lt;A href="https://www.arcgis.com" target="_blank" rel="noopener"&gt;https://www.arcgis.com&lt;/A&gt;'&lt;BR /&gt;portalUSR = r''&lt;BR /&gt;portalPAS = r''&lt;/P&gt;&lt;P&gt;# Data Store Location&lt;BR /&gt;data_store_path_Proj = r'\\filestore\ArcGISPro\CrimeAnalysisMaps\TransparencyDashboard.aprx'&lt;BR /&gt;outputStorePath = r'D:\Temp\CrimeAnalysisMaps\temp'&lt;/P&gt;&lt;P&gt;# Configure default sharing otpions to the service&lt;BR /&gt;# Reference &lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/server/upload-service-definition.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/2.8/tool-reference/server/upload-service-definition.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;shareConfig = [('ArrestData', r'Open Data (PD)', 'SHARE_ONLINE', 'PRIVATE', 'NO_SHARE_ORGANIZATION', [], ['whoever@yourplace.gov'])]&lt;/P&gt;&lt;P&gt;# Standard Terms of User to be used for all published items.&lt;BR /&gt;standardTOU = '''&amp;lt;div style="font-family:&amp;amp;quot;Avenir Next W01&amp;amp;quot;, &amp;amp;quot;Avenir Next W00&amp;amp;quot;, &amp;amp;quot;Avenir Next&amp;amp;quot;, Avenir, &amp;amp;quot;Helvetica Neue&amp;amp;quot;, sans-serif; font-size:16px;"&amp;gt;&amp;lt;/div&amp;gt;'''&lt;/P&gt;&lt;P&gt;# Error Notification&lt;BR /&gt;errorNotify = ['whoever@yourplace.gov']&lt;/P&gt;&lt;P&gt;# Send confirmation of rebuild to&lt;BR /&gt;adminNotify = 'whoever@yourplace.gov'&lt;/P&gt;&lt;P&gt;# Configure the e-mail server and other info here.&lt;BR /&gt;mail_server = 'smtprelay.yourplace.gov'&lt;BR /&gt;mail_from = 'Data Service Sync&amp;lt;noreply@yourplace.gov&amp;gt;'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# ------------------------------------------------------------------------------&lt;BR /&gt;# DO NOT UPDATE BELOW THIS LINE OR RISK DOOM AND DISPAIR! Have a nice day!&lt;BR /&gt;# ------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;# Import Python Libraries&lt;BR /&gt;import arcpy&lt;BR /&gt;import os&lt;BR /&gt;import sys&lt;BR /&gt;import datetime&lt;BR /&gt;import time&lt;BR /&gt;import string&lt;BR /&gt;import re&lt;BR /&gt;import json&lt;BR /&gt;import collections&lt;BR /&gt;import urllib&lt;BR /&gt;import requests&lt;BR /&gt;import smtplib&lt;BR /&gt;import base64&lt;BR /&gt;import concurrent.futures&lt;/P&gt;&lt;P&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;# Function&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;def main():&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Function - main&lt;BR /&gt;# Purpose: Starts the whole thing.&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;starttime = datetime.datetime.now()&lt;BR /&gt;signinPortal(starttime)&lt;BR /&gt;getProject(data_store_path_Proj, starttime)&lt;/P&gt;&lt;P&gt;return()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def signinPortal(starttime):&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Function - signinPortal&lt;BR /&gt;# Purpose: Signs into Portal&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;portalInfo = arcpy.SignInToPortal(portalURL, portalUSR, base64.b64decode(portalPAS))&lt;BR /&gt;portalDesc = arcpy.GetPortalDescription()&lt;BR /&gt;portalID = portalDesc['id']&lt;/P&gt;&lt;P&gt;print ('\nStartup : {}\n'.format(starttime))&lt;BR /&gt;print ('******** Portal Check Completed ******** ')&lt;BR /&gt;if portalID == '0123456789ABCDEF':&lt;BR /&gt;print (' - Portal connection: Internal Portal')&lt;BR /&gt;else:&lt;BR /&gt;print (' - Portal connection: ArcGIS Online')&lt;BR /&gt;print ('\n\n')&lt;/P&gt;&lt;P&gt;return()&lt;/P&gt;&lt;P&gt;def getProject(data_store_path_Proj, starttime):&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Function - getProject&lt;BR /&gt;# Purpose: Prepares Proj Project for publishing.&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;arpx = arcpy.mp.ArcGISProject(data_store_path_Proj)&lt;BR /&gt;print ('Found Project: {}\n'.format(data_store_path_Proj))&lt;BR /&gt;for maps in arpx.listMaps():&lt;BR /&gt;serviceName = maps.name&lt;BR /&gt;serviceTitle = maps.metadata.title&lt;BR /&gt;serviceSummary = maps.metadata.summary&lt;BR /&gt;serviceDescription = maps.metadata.description&lt;BR /&gt;serviceCredits = maps.metadata.credits&lt;BR /&gt;serviceTags = maps.metadata.tags&lt;BR /&gt;serviceConstraints = maps.metadata.accessConstraints&lt;/P&gt;&lt;P&gt;if serviceTitle == '':&lt;BR /&gt;serviceTitle = serviceName&lt;BR /&gt;if serviceSummary == '':&lt;BR /&gt;serviceSummary = 'Pending update.'&lt;BR /&gt;if serviceDescription == '':&lt;BR /&gt;serviceDescription = 'Pending update.'&lt;BR /&gt;if serviceCredits == '':&lt;BR /&gt;serviceCredits = 'City of Bellevue'&lt;BR /&gt;if serviceTags == '':&lt;BR /&gt;serviceTags = 'TBD'&lt;BR /&gt;if serviceConstraints == '':&lt;BR /&gt;serviceConstraints = standardTOU&lt;/P&gt;&lt;P&gt;print (' - Map Service Name: {}'.format(serviceName))&lt;BR /&gt;print (' - Map Title: {}'.format(serviceTitle))&lt;BR /&gt;print (' - Map Summary: {}'.format(serviceSummary))&lt;BR /&gt;print (' - Map Description: {}'.format(serviceDescription))&lt;BR /&gt;print (' - Map Credits: {}'.format(serviceCredits))&lt;BR /&gt;print (' - Map Tags: {}'.format(serviceTags))&lt;BR /&gt;print (' - Map Constraints: {}\n'.format(serviceConstraints))&lt;/P&gt;&lt;P&gt;pendingMap = arpx.listMaps(serviceName)[0]&lt;/P&gt;&lt;P&gt;print (' Sending to Publishing...')&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;publishWebService(serviceName, outputStorePath, serviceTitle, serviceSummary,&lt;BR /&gt;serviceDescription, serviceCredits, serviceTags, serviceConstraints, pendingMap, starttime)&lt;BR /&gt;except Exception as publishWebServiceError:&lt;BR /&gt;print ('Failure! -- {}'.format(publishWebServiceError.args[0]))&lt;BR /&gt;sendErrorTitle = 'Portal Service Update Failure!'&lt;BR /&gt;sendErrorInfo = 'There was an error publishing the map for this project. \nDetails: {}'.format(publishWebServiceError.args[0])&lt;/P&gt;&lt;P&gt;payLoadMessage = ('''The {} service failed to update as expected. Please check the serivce and repair as soon as reasonable.\n\n{}\n\nStarted @ {}\nCompleted @ {}\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceName, sendErrorInfo, starttime, finishtime))&lt;BR /&gt;payLoadSubject = 'Failure! -- GIS Data Service Sync'&lt;BR /&gt;payloadPriority = '2'&lt;BR /&gt;emailContact = '{}'.format(adminNotify)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;/P&gt;&lt;P&gt;for errorSend in errorNotify:&lt;BR /&gt;payLoadMessage = ('''The {} service failed to update as expected. NSS has been notified and will reach out if your support is required.\n\n{}\n\nStarted @ {}\nCompleted @ {}\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceName, sendErrorInfo, starttime, finishtime))&lt;BR /&gt;payLoadSubject = 'Failure! -- {} GIS Data Service Sync'.format(serviceName)&lt;BR /&gt;payloadPriority = '2'&lt;BR /&gt;emailContact = '{}'.format(errorSend)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;except Exception as arpxReviewError:&lt;BR /&gt;finishtime = datetime.datetime.now()&lt;BR /&gt;print ('Failure! -- {}'.format(arpxReviewError.args[0]))&lt;BR /&gt;sendErrorTitle = 'Portal Service Update Failure!'&lt;BR /&gt;sendErrorInfo = 'There was an error in obtaining the map project for publishing. \nDetails: {}'.format(arpxReviewError.args[0])&lt;/P&gt;&lt;P&gt;payLoadMessage = ('''The {} service failed to update as expected. Please check the serivce and repair as soon as reasonable.\n\n{}\n\nStarted @ {}\nCompleted @ {}\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceName, sendErrorInfo, starttime, finishtime))&lt;BR /&gt;payLoadSubject = 'Failure! -- GIS Data Service Sync'&lt;BR /&gt;payloadPriority = '2'&lt;BR /&gt;emailContact = '{}'.format(adminNotify)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;/P&gt;&lt;P&gt;for errorSend in errorNotify:&lt;BR /&gt;payLoadMessage = ('''The {} service failed to update as expected. NSS has been notified and will reach out if your support is required.\n\n{}\n\nStarted @ {}\nCompleted @ {}\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceName, sendErrorInfo, starttime, finishtime))&lt;BR /&gt;payLoadSubject = 'Failure! -- {} GIS Data Service Sync'.format(serviceName)&lt;BR /&gt;payloadPriority = '2'&lt;BR /&gt;emailContact = '{}'.format(errorSend)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;return()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def publishWebService(serviceName, outputStorePath, serviceTitle, serviceSummary, serviceDescription,&lt;BR /&gt;serviceCredits, serviceTags, serviceConstraints, pendingMap, starttime):&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Function - publishWebService&lt;BR /&gt;# Purpose: Publishes the web service.&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;clearToPublish = 0&lt;BR /&gt;for shareSet in shareConfig:&lt;BR /&gt;if shareSet[0] == serviceName:&lt;BR /&gt;setPortalFolder = shareSet[1]&lt;BR /&gt;setMyContents = shareSet[2]&lt;BR /&gt;setPublic = shareSet[3]&lt;BR /&gt;setOrganization = shareSet[4]&lt;BR /&gt;setGroups = shareSet[5]&lt;BR /&gt;mailCustomer = shareSet[6]&lt;BR /&gt;clearToPublish = 1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if clearToPublish == 1:&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;BR /&gt;# Create Service Draft and set the properties.&lt;BR /&gt;sdDraft = pendingMap.getWebLayerSharingDraft("HOSTING_SERVER", "FEATURE", serviceName)&lt;BR /&gt;sdDraft.title = '{}'.format(serviceTitle)&lt;BR /&gt;sdDraft.summary = '{}'.format(serviceSummary)&lt;BR /&gt;sdDraft.description = '{}'.format(serviceDescription)&lt;BR /&gt;sdDraft.credits = '{}'.format(serviceCredits)&lt;BR /&gt;sdDraft.tags = '{}'.format(serviceTags)&lt;BR /&gt;sdDraft.useLimitations = '{}'.format(serviceConstraints)&lt;BR /&gt;sdDraft.portalFolder = '{}'.format(setPortalFolder)&lt;BR /&gt;sdDraft.overwriteExistingService = 'TRUE'&lt;BR /&gt;sdDraftFile = '{}.sddraft'.format(serviceName)&lt;/P&gt;&lt;P&gt;sdDraftFileOuput = os.path.join(outputStorePath, sdDraftFile)&lt;/P&gt;&lt;P&gt;# Create Service Definition Draft file&lt;BR /&gt;sdDraft.exportToSDDraft(sdDraftFileOuput)&lt;/P&gt;&lt;P&gt;# Stage Service&lt;BR /&gt;sdFileName = '{}.sd'.format(serviceName)&lt;BR /&gt;sdOutput = os.path.join(outputStorePath, sdFileName)&lt;BR /&gt;arcpy.StageService_server(sdDraftFileOuput, sdOutput)&lt;/P&gt;&lt;P&gt;# Prepping SD variables&lt;BR /&gt;inSdFile = sdOutput&lt;BR /&gt;inServer = 'HOSTING_SERVER'&lt;BR /&gt;inServiceName = serviceName&lt;BR /&gt;inCluster = ''&lt;BR /&gt;inFolderType = ''&lt;BR /&gt;inFolder = ''&lt;BR /&gt;inStartup = ''&lt;BR /&gt;inOverride = 'OVERRIDE_DEFINITION'&lt;BR /&gt;inMyContents = '{}'.format(setMyContents)&lt;BR /&gt;inPublic = '{}'.format(setPublic)&lt;BR /&gt;inOrganization = '{}'.format(setOrganization)&lt;BR /&gt;inGroups = setGroups&lt;/P&gt;&lt;P&gt;# Share to portal&lt;BR /&gt;print(' ...Uploading Service Definition')&lt;BR /&gt;arcpy.UploadServiceDefinition_server(inSdFile, inServer, inServiceName, inCluster, inFolderType, inFolder,&lt;BR /&gt;inStartup, inOverride, inMyContents, inPublic, inOrganization, inGroups)&lt;/P&gt;&lt;P&gt;finishtime = datetime.datetime.now()&lt;/P&gt;&lt;P&gt;if serviceTitle == 'Map' or serviceTitle == 'Map1':&lt;BR /&gt;serviceTitle = serviceName&lt;/P&gt;&lt;P&gt;# Prepare Message&lt;BR /&gt;for customerNotify in mailCustomer:&lt;BR /&gt;payLoadMessage = ('''The {} service has been successfully updated. If there was a schema modification, please check any related views to ensure they are still operating as expected\n\nStarted @ {}\nCompleted @ {}\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceTitle, starttime, finishtime))&lt;BR /&gt;payLoadSubject = 'Success! -- GIS Data Service Sync of {}'.format(serviceTitle)&lt;BR /&gt;payloadPriority = '4'&lt;BR /&gt;emailContact = '{}'.format(customerNotify)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;/P&gt;&lt;P&gt;payLoadMessage = ('''The {} service has been successfully updated. If there was a schema modification, please check any related views to ensure they are still operating as expected.\n\nStarted @ {}\nCompleted @ {}\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceTitle, starttime, finishtime))&lt;BR /&gt;payLoadSubject = 'Success! -- GIS Data Service Sync of {}'.format(serviceTitle)&lt;BR /&gt;payloadPriority = '4'&lt;BR /&gt;emailContact = '{}'.format(adminNotify)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;BR /&gt;clearToPublish = 0&lt;/P&gt;&lt;P&gt;else:&lt;BR /&gt;print (' This map is not configured to be published! Sending notification and moving on to the next map.')&lt;/P&gt;&lt;P&gt;payLoadMessage = ('''{} is not configured to publish. Please contact coordinate with the owner and run automation again.\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceName))&lt;BR /&gt;payLoadSubject = 'WARNING! -- Unexpected title attempted to publish {}'.format(serviceName)&lt;BR /&gt;payloadPriority = '3'&lt;BR /&gt;emailContact = '{}'.format(adminNotify)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;/P&gt;&lt;P&gt;print ('\n\n')&lt;/P&gt;&lt;P&gt;return()&lt;/P&gt;&lt;P&gt;def sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact):&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Function - main&lt;BR /&gt;# Purpose: Starts the whole thing.&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;print (' ----- Sending notification to {}'.format(emailContact))&lt;/P&gt;&lt;P&gt;server = smtplib.SMTP(mail_server)&lt;BR /&gt;email_target = emailContact&lt;BR /&gt;mail_priority = '{}'.format(payloadPriority)&lt;BR /&gt;mail_subject = '{}'.format(payLoadSubject)&lt;BR /&gt;mail_msg = '{}'.format(payLoadMessage)&lt;/P&gt;&lt;P&gt;send_mail = 'To: {0}\nFrom: {1}\nX-Priority: {2}\nSubject: {3}\n\n{4}'.format(email_target, mail_from, mail_priority, mail_subject, mail_msg)&lt;BR /&gt;server.sendmail(mail_from, email_target, send_mail)&lt;/P&gt;&lt;P&gt;server.quit()&lt;/P&gt;&lt;P&gt;print (' !-- Message Sent!')&lt;/P&gt;&lt;P&gt;return&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;# MAIN SCRIPT&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;if __name__ == "__main__":&lt;BR /&gt;main()&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jun 2022 13:37:07 GMT</pubDate>
    <dc:creator>John_Spence</dc:creator>
    <dc:date>2022-06-09T13:37:07Z</dc:date>
    <item>
      <title>Pubilishing to ArcGIS Online via Arcpy</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181427#M7468</link>
      <description>&lt;P&gt;Hello Everyone&lt;/P&gt;&lt;P&gt;Does anyone if it is possible to use ArcPy to publish feature layers up to ArcGIS Online from say an enterprise geodatabase as a source including overwriting the layer?&lt;/P&gt;&lt;P&gt;We are exploring ways to do open data without using our enterprise web services if possible. Including python, distributed collaboration from enterprise to name a few things&lt;/P&gt;&lt;P&gt;If not no worries just curious &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 13:15:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181427#M7468</guid>
      <dc:creator>ThomasIllingworth</dc:creator>
      <dc:date>2022-06-09T13:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Pubilishing to ArcGIS Online via Arcpy</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181436#M7469</link>
      <description>&lt;P&gt;That is what the Python API was built to do, work with online content.&amp;nbsp; The GIS module is the one to read up on.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 13:27:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181436#M7469</guid>
      <dc:creator>DavidAnderson_1701</dc:creator>
      <dc:date>2022-06-09T13:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Pubilishing to ArcGIS Online via Arcpy</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181438#M7470</link>
      <description>&lt;P&gt;Here you go...See the attachment for the code as a text file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Portal Update Service (updateService.py)&lt;BR /&gt;# Purpose:&lt;BR /&gt;#&lt;BR /&gt;# Author: John Spence, Spatial Data Administrator, City of Bellevue&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;# Created:&lt;BR /&gt;# Modified:&lt;BR /&gt;# Modification Purpose:&lt;BR /&gt;#&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# 888888888888888888888888888888888888888888888888888888888888888888888888888888&lt;BR /&gt;# ------------------------------- Configuration --------------------------------&lt;BR /&gt;# To be completed.&lt;BR /&gt;#&lt;BR /&gt;# ------------------------------- Dependencies ---------------------------------&lt;BR /&gt;# 1) Using PIP, install PyODBC if you have not previously.&lt;BR /&gt;# 2) This script assumes you are using MS SQL as your RDBMS.&lt;BR /&gt;#&lt;BR /&gt;# 888888888888888888888888888888888888888888888888888888888888888888888888888888&lt;/P&gt;&lt;P&gt;# Portal Signin Config&lt;BR /&gt;portalURL = r'&lt;A href="https://www.arcgis.com" target="_blank" rel="noopener"&gt;https://www.arcgis.com&lt;/A&gt;'&lt;BR /&gt;portalUSR = r''&lt;BR /&gt;portalPAS = r''&lt;/P&gt;&lt;P&gt;# Data Store Location&lt;BR /&gt;data_store_path_Proj = r'\\filestore\ArcGISPro\CrimeAnalysisMaps\TransparencyDashboard.aprx'&lt;BR /&gt;outputStorePath = r'D:\Temp\CrimeAnalysisMaps\temp'&lt;/P&gt;&lt;P&gt;# Configure default sharing otpions to the service&lt;BR /&gt;# Reference &lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/server/upload-service-definition.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/2.8/tool-reference/server/upload-service-definition.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;shareConfig = [('ArrestData', r'Open Data (PD)', 'SHARE_ONLINE', 'PRIVATE', 'NO_SHARE_ORGANIZATION', [], ['whoever@yourplace.gov'])]&lt;/P&gt;&lt;P&gt;# Standard Terms of User to be used for all published items.&lt;BR /&gt;standardTOU = '''&amp;lt;div style="font-family:&amp;amp;quot;Avenir Next W01&amp;amp;quot;, &amp;amp;quot;Avenir Next W00&amp;amp;quot;, &amp;amp;quot;Avenir Next&amp;amp;quot;, Avenir, &amp;amp;quot;Helvetica Neue&amp;amp;quot;, sans-serif; font-size:16px;"&amp;gt;&amp;lt;/div&amp;gt;'''&lt;/P&gt;&lt;P&gt;# Error Notification&lt;BR /&gt;errorNotify = ['whoever@yourplace.gov']&lt;/P&gt;&lt;P&gt;# Send confirmation of rebuild to&lt;BR /&gt;adminNotify = 'whoever@yourplace.gov'&lt;/P&gt;&lt;P&gt;# Configure the e-mail server and other info here.&lt;BR /&gt;mail_server = 'smtprelay.yourplace.gov'&lt;BR /&gt;mail_from = 'Data Service Sync&amp;lt;noreply@yourplace.gov&amp;gt;'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# ------------------------------------------------------------------------------&lt;BR /&gt;# DO NOT UPDATE BELOW THIS LINE OR RISK DOOM AND DISPAIR! Have a nice day!&lt;BR /&gt;# ------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;# Import Python Libraries&lt;BR /&gt;import arcpy&lt;BR /&gt;import os&lt;BR /&gt;import sys&lt;BR /&gt;import datetime&lt;BR /&gt;import time&lt;BR /&gt;import string&lt;BR /&gt;import re&lt;BR /&gt;import json&lt;BR /&gt;import collections&lt;BR /&gt;import urllib&lt;BR /&gt;import requests&lt;BR /&gt;import smtplib&lt;BR /&gt;import base64&lt;BR /&gt;import concurrent.futures&lt;/P&gt;&lt;P&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;# Function&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;def main():&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Function - main&lt;BR /&gt;# Purpose: Starts the whole thing.&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;starttime = datetime.datetime.now()&lt;BR /&gt;signinPortal(starttime)&lt;BR /&gt;getProject(data_store_path_Proj, starttime)&lt;/P&gt;&lt;P&gt;return()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def signinPortal(starttime):&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Function - signinPortal&lt;BR /&gt;# Purpose: Signs into Portal&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;portalInfo = arcpy.SignInToPortal(portalURL, portalUSR, base64.b64decode(portalPAS))&lt;BR /&gt;portalDesc = arcpy.GetPortalDescription()&lt;BR /&gt;portalID = portalDesc['id']&lt;/P&gt;&lt;P&gt;print ('\nStartup : {}\n'.format(starttime))&lt;BR /&gt;print ('******** Portal Check Completed ******** ')&lt;BR /&gt;if portalID == '0123456789ABCDEF':&lt;BR /&gt;print (' - Portal connection: Internal Portal')&lt;BR /&gt;else:&lt;BR /&gt;print (' - Portal connection: ArcGIS Online')&lt;BR /&gt;print ('\n\n')&lt;/P&gt;&lt;P&gt;return()&lt;/P&gt;&lt;P&gt;def getProject(data_store_path_Proj, starttime):&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Function - getProject&lt;BR /&gt;# Purpose: Prepares Proj Project for publishing.&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;arpx = arcpy.mp.ArcGISProject(data_store_path_Proj)&lt;BR /&gt;print ('Found Project: {}\n'.format(data_store_path_Proj))&lt;BR /&gt;for maps in arpx.listMaps():&lt;BR /&gt;serviceName = maps.name&lt;BR /&gt;serviceTitle = maps.metadata.title&lt;BR /&gt;serviceSummary = maps.metadata.summary&lt;BR /&gt;serviceDescription = maps.metadata.description&lt;BR /&gt;serviceCredits = maps.metadata.credits&lt;BR /&gt;serviceTags = maps.metadata.tags&lt;BR /&gt;serviceConstraints = maps.metadata.accessConstraints&lt;/P&gt;&lt;P&gt;if serviceTitle == '':&lt;BR /&gt;serviceTitle = serviceName&lt;BR /&gt;if serviceSummary == '':&lt;BR /&gt;serviceSummary = 'Pending update.'&lt;BR /&gt;if serviceDescription == '':&lt;BR /&gt;serviceDescription = 'Pending update.'&lt;BR /&gt;if serviceCredits == '':&lt;BR /&gt;serviceCredits = 'City of Bellevue'&lt;BR /&gt;if serviceTags == '':&lt;BR /&gt;serviceTags = 'TBD'&lt;BR /&gt;if serviceConstraints == '':&lt;BR /&gt;serviceConstraints = standardTOU&lt;/P&gt;&lt;P&gt;print (' - Map Service Name: {}'.format(serviceName))&lt;BR /&gt;print (' - Map Title: {}'.format(serviceTitle))&lt;BR /&gt;print (' - Map Summary: {}'.format(serviceSummary))&lt;BR /&gt;print (' - Map Description: {}'.format(serviceDescription))&lt;BR /&gt;print (' - Map Credits: {}'.format(serviceCredits))&lt;BR /&gt;print (' - Map Tags: {}'.format(serviceTags))&lt;BR /&gt;print (' - Map Constraints: {}\n'.format(serviceConstraints))&lt;/P&gt;&lt;P&gt;pendingMap = arpx.listMaps(serviceName)[0]&lt;/P&gt;&lt;P&gt;print (' Sending to Publishing...')&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;publishWebService(serviceName, outputStorePath, serviceTitle, serviceSummary,&lt;BR /&gt;serviceDescription, serviceCredits, serviceTags, serviceConstraints, pendingMap, starttime)&lt;BR /&gt;except Exception as publishWebServiceError:&lt;BR /&gt;print ('Failure! -- {}'.format(publishWebServiceError.args[0]))&lt;BR /&gt;sendErrorTitle = 'Portal Service Update Failure!'&lt;BR /&gt;sendErrorInfo = 'There was an error publishing the map for this project. \nDetails: {}'.format(publishWebServiceError.args[0])&lt;/P&gt;&lt;P&gt;payLoadMessage = ('''The {} service failed to update as expected. Please check the serivce and repair as soon as reasonable.\n\n{}\n\nStarted @ {}\nCompleted @ {}\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceName, sendErrorInfo, starttime, finishtime))&lt;BR /&gt;payLoadSubject = 'Failure! -- GIS Data Service Sync'&lt;BR /&gt;payloadPriority = '2'&lt;BR /&gt;emailContact = '{}'.format(adminNotify)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;/P&gt;&lt;P&gt;for errorSend in errorNotify:&lt;BR /&gt;payLoadMessage = ('''The {} service failed to update as expected. NSS has been notified and will reach out if your support is required.\n\n{}\n\nStarted @ {}\nCompleted @ {}\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceName, sendErrorInfo, starttime, finishtime))&lt;BR /&gt;payLoadSubject = 'Failure! -- {} GIS Data Service Sync'.format(serviceName)&lt;BR /&gt;payloadPriority = '2'&lt;BR /&gt;emailContact = '{}'.format(errorSend)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;except Exception as arpxReviewError:&lt;BR /&gt;finishtime = datetime.datetime.now()&lt;BR /&gt;print ('Failure! -- {}'.format(arpxReviewError.args[0]))&lt;BR /&gt;sendErrorTitle = 'Portal Service Update Failure!'&lt;BR /&gt;sendErrorInfo = 'There was an error in obtaining the map project for publishing. \nDetails: {}'.format(arpxReviewError.args[0])&lt;/P&gt;&lt;P&gt;payLoadMessage = ('''The {} service failed to update as expected. Please check the serivce and repair as soon as reasonable.\n\n{}\n\nStarted @ {}\nCompleted @ {}\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceName, sendErrorInfo, starttime, finishtime))&lt;BR /&gt;payLoadSubject = 'Failure! -- GIS Data Service Sync'&lt;BR /&gt;payloadPriority = '2'&lt;BR /&gt;emailContact = '{}'.format(adminNotify)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;/P&gt;&lt;P&gt;for errorSend in errorNotify:&lt;BR /&gt;payLoadMessage = ('''The {} service failed to update as expected. NSS has been notified and will reach out if your support is required.\n\n{}\n\nStarted @ {}\nCompleted @ {}\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceName, sendErrorInfo, starttime, finishtime))&lt;BR /&gt;payLoadSubject = 'Failure! -- {} GIS Data Service Sync'.format(serviceName)&lt;BR /&gt;payloadPriority = '2'&lt;BR /&gt;emailContact = '{}'.format(errorSend)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;return()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def publishWebService(serviceName, outputStorePath, serviceTitle, serviceSummary, serviceDescription,&lt;BR /&gt;serviceCredits, serviceTags, serviceConstraints, pendingMap, starttime):&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Function - publishWebService&lt;BR /&gt;# Purpose: Publishes the web service.&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;clearToPublish = 0&lt;BR /&gt;for shareSet in shareConfig:&lt;BR /&gt;if shareSet[0] == serviceName:&lt;BR /&gt;setPortalFolder = shareSet[1]&lt;BR /&gt;setMyContents = shareSet[2]&lt;BR /&gt;setPublic = shareSet[3]&lt;BR /&gt;setOrganization = shareSet[4]&lt;BR /&gt;setGroups = shareSet[5]&lt;BR /&gt;mailCustomer = shareSet[6]&lt;BR /&gt;clearToPublish = 1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if clearToPublish == 1:&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;BR /&gt;# Create Service Draft and set the properties.&lt;BR /&gt;sdDraft = pendingMap.getWebLayerSharingDraft("HOSTING_SERVER", "FEATURE", serviceName)&lt;BR /&gt;sdDraft.title = '{}'.format(serviceTitle)&lt;BR /&gt;sdDraft.summary = '{}'.format(serviceSummary)&lt;BR /&gt;sdDraft.description = '{}'.format(serviceDescription)&lt;BR /&gt;sdDraft.credits = '{}'.format(serviceCredits)&lt;BR /&gt;sdDraft.tags = '{}'.format(serviceTags)&lt;BR /&gt;sdDraft.useLimitations = '{}'.format(serviceConstraints)&lt;BR /&gt;sdDraft.portalFolder = '{}'.format(setPortalFolder)&lt;BR /&gt;sdDraft.overwriteExistingService = 'TRUE'&lt;BR /&gt;sdDraftFile = '{}.sddraft'.format(serviceName)&lt;/P&gt;&lt;P&gt;sdDraftFileOuput = os.path.join(outputStorePath, sdDraftFile)&lt;/P&gt;&lt;P&gt;# Create Service Definition Draft file&lt;BR /&gt;sdDraft.exportToSDDraft(sdDraftFileOuput)&lt;/P&gt;&lt;P&gt;# Stage Service&lt;BR /&gt;sdFileName = '{}.sd'.format(serviceName)&lt;BR /&gt;sdOutput = os.path.join(outputStorePath, sdFileName)&lt;BR /&gt;arcpy.StageService_server(sdDraftFileOuput, sdOutput)&lt;/P&gt;&lt;P&gt;# Prepping SD variables&lt;BR /&gt;inSdFile = sdOutput&lt;BR /&gt;inServer = 'HOSTING_SERVER'&lt;BR /&gt;inServiceName = serviceName&lt;BR /&gt;inCluster = ''&lt;BR /&gt;inFolderType = ''&lt;BR /&gt;inFolder = ''&lt;BR /&gt;inStartup = ''&lt;BR /&gt;inOverride = 'OVERRIDE_DEFINITION'&lt;BR /&gt;inMyContents = '{}'.format(setMyContents)&lt;BR /&gt;inPublic = '{}'.format(setPublic)&lt;BR /&gt;inOrganization = '{}'.format(setOrganization)&lt;BR /&gt;inGroups = setGroups&lt;/P&gt;&lt;P&gt;# Share to portal&lt;BR /&gt;print(' ...Uploading Service Definition')&lt;BR /&gt;arcpy.UploadServiceDefinition_server(inSdFile, inServer, inServiceName, inCluster, inFolderType, inFolder,&lt;BR /&gt;inStartup, inOverride, inMyContents, inPublic, inOrganization, inGroups)&lt;/P&gt;&lt;P&gt;finishtime = datetime.datetime.now()&lt;/P&gt;&lt;P&gt;if serviceTitle == 'Map' or serviceTitle == 'Map1':&lt;BR /&gt;serviceTitle = serviceName&lt;/P&gt;&lt;P&gt;# Prepare Message&lt;BR /&gt;for customerNotify in mailCustomer:&lt;BR /&gt;payLoadMessage = ('''The {} service has been successfully updated. If there was a schema modification, please check any related views to ensure they are still operating as expected\n\nStarted @ {}\nCompleted @ {}\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceTitle, starttime, finishtime))&lt;BR /&gt;payLoadSubject = 'Success! -- GIS Data Service Sync of {}'.format(serviceTitle)&lt;BR /&gt;payloadPriority = '4'&lt;BR /&gt;emailContact = '{}'.format(customerNotify)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;/P&gt;&lt;P&gt;payLoadMessage = ('''The {} service has been successfully updated. If there was a schema modification, please check any related views to ensure they are still operating as expected.\n\nStarted @ {}\nCompleted @ {}\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceTitle, starttime, finishtime))&lt;BR /&gt;payLoadSubject = 'Success! -- GIS Data Service Sync of {}'.format(serviceTitle)&lt;BR /&gt;payloadPriority = '4'&lt;BR /&gt;emailContact = '{}'.format(adminNotify)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;BR /&gt;clearToPublish = 0&lt;/P&gt;&lt;P&gt;else:&lt;BR /&gt;print (' This map is not configured to be published! Sending notification and moving on to the next map.')&lt;/P&gt;&lt;P&gt;payLoadMessage = ('''{} is not configured to publish. Please contact coordinate with the owner and run automation again.\n\n[SYSTEM AUTO GENERATED MESSAGE]'''.format(serviceName))&lt;BR /&gt;payLoadSubject = 'WARNING! -- Unexpected title attempted to publish {}'.format(serviceName)&lt;BR /&gt;payloadPriority = '3'&lt;BR /&gt;emailContact = '{}'.format(adminNotify)&lt;BR /&gt;sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact)&lt;/P&gt;&lt;P&gt;print ('\n\n')&lt;/P&gt;&lt;P&gt;return()&lt;/P&gt;&lt;P&gt;def sendNotification (payLoadMessage, payLoadSubject, payloadPriority, emailContact):&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;# Name: Function - main&lt;BR /&gt;# Purpose: Starts the whole thing.&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;print (' ----- Sending notification to {}'.format(emailContact))&lt;/P&gt;&lt;P&gt;server = smtplib.SMTP(mail_server)&lt;BR /&gt;email_target = emailContact&lt;BR /&gt;mail_priority = '{}'.format(payloadPriority)&lt;BR /&gt;mail_subject = '{}'.format(payLoadSubject)&lt;BR /&gt;mail_msg = '{}'.format(payLoadMessage)&lt;/P&gt;&lt;P&gt;send_mail = 'To: {0}\nFrom: {1}\nX-Priority: {2}\nSubject: {3}\n\n{4}'.format(email_target, mail_from, mail_priority, mail_subject, mail_msg)&lt;BR /&gt;server.sendmail(mail_from, email_target, send_mail)&lt;/P&gt;&lt;P&gt;server.quit()&lt;/P&gt;&lt;P&gt;print (' !-- Message Sent!')&lt;/P&gt;&lt;P&gt;return&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#-------------------------------------------------------------------------------&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;# MAIN SCRIPT&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;#-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;if __name__ == "__main__":&lt;BR /&gt;main()&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 13:37:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181438#M7470</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2022-06-09T13:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Pubilishing to ArcGIS Online via Arcpy</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181439#M7471</link>
      <description>&lt;P&gt;To add onto that, if you're using the Python API together with ArcPy, you can load a geodatabase layer into a spatial dataframe, and then publish that directly to a service.&lt;/P&gt;&lt;P&gt;Alternatively, you can use ArcPy to prepare a service definition, then use the Python API to publish it as a new item.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 13:46:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181439#M7471</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-06-09T13:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Pubilishing to ArcGIS Online via Arcpy</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181441#M7472</link>
      <description>&lt;P&gt;Here you go by way of code.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 13:52:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181441#M7472</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2022-06-09T13:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Pubilishing to ArcGIS Online via Arcpy</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181447#M7473</link>
      <description>&lt;P&gt;I should probably add a few notes...&lt;/P&gt;&lt;P&gt;The way I handle this kind of publishing is, and this is because it is hosted, I publish a private copy of the data (as shown by way of example in the code) and then create a view of the published service that is consumed by the end user/product. In a way, this provides a abstraction layer to how you are configured allowing a greater degree of control and/or reuse of the same data for multiple products if you need to slice and dice the data different. 1 "service" to rule them all. Thankfully, when you overwrite the service during publishing the view remains connected and configured. The only caveat to that would be if someone changes the schema on the core service. Then you need to recreate the views. 1 downside for a lot of upside.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 13:59:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181447#M7473</guid>
      <dc:creator>John_Spence</dc:creator>
      <dc:date>2022-06-09T13:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Pubilishing to ArcGIS Online via Arcpy</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181553#M7474</link>
      <description>&lt;P&gt;Thanks for sharing your code.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 17:34:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pubilishing-to-arcgis-online-via-arcpy/m-p/1181553#M7474</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-06-09T17:34:23Z</dc:date>
    </item>
  </channel>
</rss>

