publish_web_layer
Publish a selected layer as a hosted feature service to your active ArcGIS Online or Enterprise portal. Creates or overwrites portal content using your existing ArcGIS Pro sign-in.
Instructions
Publish a layer as a hosted feature service to ArcGIS Online / Enterprise, using whichever portal is currently active in ArcGIS Pro. Always confirm with the user before calling this — it creates or overwrites content on their portal account.
Publishes over REST via the ArcGIS API for Python (reusing your existing Pro sign-in — no separate login needed), not the classic arcpy.server pipeline, which doesn't work reliably from this bridge. Can take up to ~30-60s for typical layers; this is normal, don't treat a slow response as a failure.
Args: layer: Exact layer name as shown in the Contents pane service_name: Name for the hosted feature service (must be unique in the target folder) summary: Short description shown on the portal item (optional) tags: Comma-separated tags for the portal item (optional) public: Share publicly if True; private (owner-only) if False (default: False) overwrite: Overwrite an existing service with the same name if True (default: False)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | ||
| layer | Yes | ||
| public | No | ||
| summary | No | ||
| overwrite | No | ||
| service_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |