Skip to content

Commit 9feaeee

Browse files
committed
Refresh manage-zerocopy-sapbdc with builder-audience rewrite
Run through v1.1.0 audit pipeline. Holistic rewriter applied a builder-audience pass plus mechanical fixes for the original audit failures (1 blocking, 7 advisory). Also updated README.md to reference Snowflake-Labs instead of internal repo.
1 parent be318e8 commit 9feaeee

2 files changed

Lines changed: 85 additions & 94 deletions

File tree

skills/manage-zerocopy-sapbdc/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,13 @@ Before using this skill, ensure:
5959

6060
### Step 1: Download the Skill
6161

62-
The skill lives in the Snowflake-Solutions internal repository. Clone the whole repo and locate the skill folder:
62+
The skill lives in the Snowflake-Labs repository. Clone the repo and locate the skill folder:
6363

6464
```
65-
git clone git@github.com:Snowflake-Solutions/cortex-code-skills.git
65+
git clone https://github.com/Snowflake-Labs/cortex-code-skills.git
6666
cd cortex-code-skills/skills/manage-zerocopy-sapbdc
6767
```
6868

69-
For external (Snowflake-Labs) distribution, the skill will be published separately at `https://github.com/Snowflake-Labs/cortex-code-skills` (forthcoming).
70-
7169
### Step 2: Install
7270

7371
#### Cortex Code (CLI)
Lines changed: 83 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
---
22
name: manage-zerocopy-sapbdc
33
title: SAP BDC Zero-Copy Connector
4-
summary: Manage the lifecycle of the SAP BDC zero-copy connector: create, enroll, consume, publish, analyze, and troubleshoot.
4+
summary: "Manage SAP BDC zero-copy connector lifecycle: create, enroll, consume, publish, analyze, troubleshoot."
55
description: >-
6-
Manage the end-to-end lifecycle of the Snowflake and SAP BDC Zero-Copy
7-
Integration and connector. Use when: consuming SAP data products in Snowflake,
8-
publishing Snowflake databases to SAP BDC, analyzing shared SAP data, or
9-
troubleshooting SAP BDC connector issues. Triggers: SAP BDC, SAP connector,
10-
zerocopy connector, SAP data product, SAP BDC Connect, SAP publish, SAP share,
11-
SAP troubleshoot, catalog-linked database, LINKED_ZEROCOPY_CONNECTOR, SAP BDC
12-
share back.
6+
Use when working with the SAP BDC zero-copy integration in Snowflake —
7+
consuming SAP data products, publishing Snowflake databases back to SAP BDC,
8+
analyzing shared SAP data, or troubleshooting connector state errors.
9+
Triggers: SAP BDC, SAP connector, zerocopy connector, SAP data product,
10+
SAP BDC Connect, SAP publish, SAP share, SAP troubleshoot,
11+
catalog-linked database, LINKED_ZEROCOPY_CONNECTOR, SAP BDC share back.
1312
tools:
1413
- snowflake_sql_execute
1514
- snowflake_object_search
@@ -29,109 +28,103 @@ demo-url: ""
2928

3029
# SAP BDC <=> Snowflake Zero-Copy Integration
3130

32-
Manages the full lifecycle of the SAP BDC <=> Snowflake zero-copy integration and connector: setup, consume, publish, analyze, and troubleshoot.
31+
## Overview
3332

34-
## When to Use
33+
Manages the full lifecycle of the SAP BDC zero-copy connector in Snowflake: create the connector, enroll with SAP BDC, consume SAP data products as catalog-linked databases, publish Snowflake data back to SAP BDC, analyze shared data, and troubleshoot connector states.
3534

36-
- User asks to create, connect, or enroll an SAP BDC zero-copy connector
37-
- User wants to consume or mount SAP BDC shared data products in Snowflake
38-
- User wants to publish Snowflake data back to SAP BDC as a data product
39-
- User asks to explore, query, or join data from mounted SAP data products
40-
- User needs to troubleshoot SAP BDC connector states, privileges, or connectivity
41-
- Do NOT use for: general Snowflake data sharing (non-SAP), SAP HANA direct connections, or SAP BTP non-BDC services
35+
Use this when you want to:
36+
37+
- Create, connect, or enroll an SAP BDC zero-copy connector
38+
- Consume or mount SAP BDC shared data products in Snowflake
39+
- Publish a Snowflake database back to SAP BDC as a data product
40+
- Explore, query, or join data from mounted SAP data products
41+
- Diagnose connector state errors, privilege gaps, or connectivity issues
42+
43+
Do NOT use for: general Snowflake data sharing (non-SAP), SAP HANA direct connections, or non-BDC SAP BTP services.
4244

4345
## Prerequisites
4446

45-
- An ORGADMIN must have accepted the SAP® BDC Connect for Snowflake Terms (Admin » Terms » Snowflake Marketplace section in Snowsight). This only needs to be done once per Snowflake organization.
46-
- SAP Business Data Cloud (BDC) setup must be complete
47-
- Role must have `CREATE ZEROCOPY CONNECTOR` on the target schema
48-
- For publishing: `CREATE SHARE` privilege on the account
47+
- An ORGADMIN must have accepted the SAP® BDC Connect for Snowflake Terms (Admin » Terms » Snowflake Marketplace section in Snowsight). One-time per Snowflake organization.
48+
- SAP Business Data Cloud (BDC) must be set up on the SAP side.
49+
- Role needs `CREATE ZEROCOPY CONNECTOR` on the target schema.
50+
- For publishing: `CREATE SHARE` on the account.
4951

5052
## Workflow
5153

52-
### Step 1: Ask User Intent
54+
### Step 1: Ask user intent
5355

54-
**Every time this skill is invoked**, present this menu:
56+
Each invocation, present this menu:
57+
58+
```
59+
What would you like to do?
5560
61+
1. Create a new zero-copy connector -> set up + enroll with SAP BDC
62+
2. Consume shared data products -> mount as catalog-linked databases
63+
3. Publish a data product -> share Snowflake DB back to SAP BDC
64+
4. Analyze shared data -> query/join mounted SAP data
65+
5. Troubleshoot -> fix state, privilege, connectivity issues
5666
```
57-
What would you like to do with the SAP BDC <=> Snowflake zero-copy connector?
5867

59-
1. Create a new zero-copy connector - Set up a new connector and enroll it with SAP BDC
60-
2. Consume shared data products - Mount shared SAP BDC data products as catalog-linked databases in Snowflake
61-
3. Publish a data product - Share a Snowflake database back to SAP BDC as a new data product
62-
4. Analyze shared data - Explore, query, and join data from SAP BDC data products already mounted in Snowflake
63-
5. Troubleshoot - Diagnose and fix connector state errors, privilege issues, and connectivity problems
68+
Route to: `create-connector/INSTRUCTIONS.md`, `consume/INSTRUCTIONS.md`, `publish/INSTRUCTIONS.md`, `analyze/INSTRUCTIONS.md`, or `troubleshoot/INSTRUCTIONS.md`.
69+
70+
## Connector States
71+
72+
| State | Allowed actions |
73+
|---|---|
74+
| NEW | CONNECT, DROP |
75+
| CONNECTING | wait |
76+
| CONNECTED | DISCONNECT (after disabling share-back + dropping CLDs), create CLDs, publish |
77+
| CONNECT_ERROR | CONNECT (retry), DROP |
78+
| DISCONNECTING | wait |
79+
| DISCONNECTED | CONNECT (reconnect), DROP |
80+
| DISCONNECT_ERROR | DISCONNECT (retry), DROP |
81+
| DELETED | none (no UNDROP) |
82+
83+
## Key SQL
84+
85+
```sql
86+
CREATE ZEROCOPY CONNECTOR <name> PARTNER = SAP_BDC;
87+
SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME();
88+
ALTER ZEROCOPY CONNECTOR <name> CONNECT WITH CONFIG = (INVITATION_LINK = '...');
89+
DESC ZEROCOPY CONNECTOR <name>;
90+
SHOW ZEROCOPY CONNECTORS IN SCHEMA <db>.<schema>;
91+
SELECT SYSTEM$ZEROCOPY_CONNECTOR_LIST_SHARES('<connector>');
92+
ALTER ZEROCOPY CONNECTOR <name> SET SHARE_BACK = TRUE;
93+
ALTER ZEROCOPY CONNECTOR <name> ADD SHARE <share>;
94+
ALTER ZEROCOPY CONNECTOR <name> DISCONNECT;
95+
DROP ZEROCOPY CONNECTOR <name>;
6496
```
6597

66-
**Route based on selection:**
67-
- Option 1 -> **Load** `create-connector/INSTRUCTIONS.md`
68-
- Option 2 -> **Load** `consume/INSTRUCTIONS.md`
69-
- Option 3 -> **Load** `publish/INSTRUCTIONS.md`
70-
- Option 4 -> **Load** `analyze/INSTRUCTIONS.md`
71-
- Option 5 -> **Load** `troubleshoot/INSTRUCTIONS.md`
72-
73-
## Connector Quick Reference
74-
75-
### Connector States
76-
| State | Description | Allowed Actions |
77-
|-------|-------------|-----------------|
78-
| NEW | Just created, no connection attempted | CONNECT, DROP |
79-
| CONNECTING | Connection in progress (async) | Wait |
80-
| CONNECTED | Active connection | DISCONNECT (must disable share-back and drop CLDs first), create CLDs, publish |
81-
| CONNECT_ERROR | Connection failed | CONNECT (retry), DROP |
82-
| DISCONNECTING | Disconnection in progress (async) | Wait |
83-
| DISCONNECTED | Connection dropped | CONNECT (reconnect), DROP |
84-
| DISCONNECT_ERROR | Disconnection failed | DISCONNECT (retry), DROP |
85-
| DELETED | Connector has been dropped (permanent, no UNDROP) | None |
86-
87-
### Key SQL Commands
88-
| Command | Purpose |
89-
|---------|---------|
90-
| `CREATE ZEROCOPY CONNECTOR <name> PARTNER = SAP_BDC` | Create connector |
91-
| `SELECT CURRENT_ORGANIZATION_NAME() \|\| '-' \|\| CURRENT_ACCOUNT_NAME()` | Derive account URL for SAP for Me registration |
92-
| `ALTER ZEROCOPY CONNECTOR <name> CONNECT WITH CONFIG = (INVITATION_LINK = '...')` | Establish connection |
93-
| `DESC ZEROCOPY CONNECTOR <name>` | Check connector state |
94-
| `SHOW ZEROCOPY CONNECTORS IN SCHEMA <db>.<schema>` | List all connectors |
95-
| `SELECT SYSTEM$ZEROCOPY_CONNECTOR_LIST_SHARES('<connector>')` | List available SAP data products |
96-
| `ALTER ZEROCOPY CONNECTOR <name> SET SHARE_BACK = TRUE` | Enable publishing |
97-
| `ALTER ZEROCOPY CONNECTOR <name> ADD SHARE <share>` | Associate share for publishing |
98-
| `ALTER ZEROCOPY CONNECTOR <name> DISCONNECT` | Disconnect (disable share-back and drop CLDs first) |
99-
| `DROP ZEROCOPY CONNECTOR <name>` | Drop connector (must be NEW/CONNECT_ERROR/DISCONNECT_ERROR/DISCONNECTED) |
100-
101-
### Required Privileges
98+
## Required Privileges
99+
102100
| Privilege | Scope | Purpose |
103-
|-----------|-------|---------|
101+
|---|---|---|
104102
| CREATE ZEROCOPY CONNECTOR | Schema | Create connector |
105-
| OPERATE | Connector | Connect, disconnect, and publish data product (SYSTEM$SAP_PUBLISH_DATA_PRODUCT) |
106-
| USAGE | Connector | Create CLD (also requires CREATE DATABASE on account), add/remove share (also requires OWNERSHIP on share) |
107-
| MODIFY | Connector | Set/unset properties (comment, share_back, etc.) |
108-
| MONITOR | Connector | Describe connector, show connectors, list shares (any privilege on the connector is sufficient) |
109-
| OWNERSHIP | Connector | Rename or drop the connector |
110-
| CREATE DATABASE | Account | Create catalog-linked database (also requires USAGE on connector) |
111-
| CREATE SHARE | Account | Publish data back to SAP BDC |
103+
| OPERATE | Connector | Connect, disconnect, publish |
104+
| USAGE | Connector | Create CLDs (+ CREATE DATABASE on account), add/remove shares (+ OWNERSHIP on share) |
105+
| MODIFY | Connector | Set properties (comment, share_back) |
106+
| MONITOR | Connector | DESC / SHOW / list shares |
107+
| OWNERSHIP | Connector | Rename or drop |
108+
| CREATE DATABASE | Account | Create catalog-linked database |
109+
| CREATE SHARE | Account | Publish back to SAP BDC |
112110

113111
## Examples
114112

115-
### Example 1: Create and enroll a connector
116-
User: `$manage-zerocopy-sapbdc create a new zero-copy connector and enroll it with SAP BDC`
117-
Assistant: Asks for database/schema/connector name, runs CREATE ZEROCOPY CONNECTOR, provides Partner ID for SAP 4 Me registration, then connects with invitation link.
118-
119-
### Example 2: Consume a data product
120-
User: `$manage-zerocopy-sapbdc mount the Workforce Persons data product from SAP`
121-
Assistant: Lists available shares, creates a catalog-linked database, confirms tables are accessible and semantic views are generated.
122-
123-
### Example 3: Publish Snowflake data to SAP
124-
User: `$manage-zerocopy-sapbdc publish my ANALYTICS_DB.SALES schema to SAP BDC`
125-
Assistant: Enables share-back, creates Iceberg tables, generates CSN Interop JSON, creates share, publishes data product.
126-
127-
### Example 4: Troubleshoot
128-
User: `$manage-zerocopy-sapbdc my connector is stuck in CONNECT_ERROR`
129-
Assistant: Runs DESC ZEROCOPY CONNECTOR, checks privileges, validates invitation link, provides remediation steps.
113+
- `$manage-zerocopy-sapbdc create a new zero-copy connector and enroll it with SAP BDC` -> prompts for db/schema/name, runs `CREATE ZEROCOPY CONNECTOR`, returns Partner ID for SAP for Me, connects with invitation link.
114+
- `$manage-zerocopy-sapbdc mount the Workforce Persons data product from SAP` -> lists shares, creates CLD, confirms tables and semantic views.
115+
- `$manage-zerocopy-sapbdc publish my ANALYTICS_DB.SALES schema to SAP BDC` -> enables share-back, creates Iceberg tables, generates CSN Interop JSON, creates share, publishes.
116+
- `$manage-zerocopy-sapbdc my connector is stuck in CONNECT_ERROR` -> runs DESC, checks privileges, validates invitation link, suggests fixes.
130117

131-
## Stopping Points
118+
## Common Mistakes
132119

133-
- After Step 1: Route to selected sub-skill
120+
- **Skipping the ORGADMIN terms acceptance**`CREATE ZEROCOPY CONNECTOR` will fail until the SAP® BDC Connect for Snowflake Terms are accepted in Snowsight.
121+
- **Trying to DISCONNECT while CLDs or share-back are active** — disable `SHARE_BACK`, remove shares, and drop catalog-linked databases first.
122+
- **Using a stale invitation link** — links expire; regenerate from SAP for Me before retrying CONNECT.
123+
- **Wrong role for CLD creation** — needs both `USAGE` on the connector and `CREATE DATABASE` on the account.
124+
- **Trying to UNDROP a connector**`DROP ZEROCOPY CONNECTOR` is permanent. Recreate and re-enroll.
125+
- **Publishing without `CREATE SHARE`** — share-back fails silently at the SAP side if the share wasn't owned by the role with OPERATE on the connector.
126+
- **Confusing organization-level vs account-level setup** — terms acceptance is org-wide, but connector creation, privileges, and CLDs are per-account.
134127

135128
## Output
136129

137-
Depends on selected use case — see sub-skill outputs.
130+
Depends on selected use case — see the routed sub-skill's `INSTRUCTIONS.md`.

0 commit comments

Comments
 (0)