@microsoft/rayfin-guide 1.36.0-alpha.1687 → 1.36.0-alpha.1818

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,6 +80,13 @@ To skip the prompt, pass `-t`/`--template <name>` using one of the names from `-
80
80
  npm create @microsoft/rayfin@latest my-app -- --template todoapp
81
81
  ```
82
82
 
83
+ > **Windows PowerShell:** some npm/Node.js versions drop the `--` separator, so `--template` is read by npm itself instead of being forwarded to Rayfin.
84
+ > Use `npm.cmd` instead of `npm` to avoid the issue on every Node.js version:
85
+ >
86
+ > ```powershell
87
+ > npm.cmd create @microsoft/rayfin@latest my-app -- --template todoapp
88
+ > ```
89
+
83
90
  ## Scaffold from an external git repository
84
91
 
85
92
  Pass any git URL to `-t`/`--template`:
@@ -181,6 +188,8 @@ registries:
181
188
  description: Our team's reusable starters
182
189
  url: https://github.com/example-org/rayfin-templates.git
183
190
  ref: v1.2.0
191
+ alphaRef: v1.3.0-alpha
192
+ betaRef: v1.3.0-beta
184
193
  path: catalogs/official
185
194
  ```
186
195
 
@@ -192,10 +201,17 @@ Each entry supports the following fields:
192
201
  | `url` | Yes | Git URL of the template repository (HTTPS, SSH, `git@`, or `file://`) |
193
202
  | `displayName` | No | Human-readable label (defaults to `name`) |
194
203
  | `description` | No | Short description shown in pickers and `--list-templates` |
195
- | `ref` | No | Git tag, branch, or full commit SHA to pin to (defaults to the repository's default branch) |
204
+ | `ref` | No | Stable/default Git tag, branch, or full commit SHA to pin to (defaults to the repository's default branch) |
205
+ | `alphaRef` | No | Git ref used by alpha CLI versions; falls back to `ref` |
206
+ | `betaRef` | No | Git ref used by beta CLI versions; falls back to `ref` |
196
207
  | `path` | No | Subdirectory inside the repo where the manifest lives |
197
208
  | `templateName` | No | For a multi-template repo, the entry `name` or `path` to pre-select so consumers skip the picker |
198
209
 
210
+ The running CLI's package version selects the ref. Stable releases use `ref`,
211
+ versions such as `1.2.0-alpha.3` use `alphaRef`, and versions such as
212
+ `1.2.0-beta.2` use `betaRef`. If the matching channel ref is omitted, the CLI
213
+ uses `ref`. Other prerelease labels also use `ref`.
214
+
199
215
  ### Conflict handling
200
216
 
201
217
  The CLI loads registries in tier order (bundled → user-global → project-local).
@@ -4,10 +4,14 @@ sidebar_position: 5
4
4
 
5
5
  # Add Azure DevOps
6
6
 
7
- Call the [Azure DevOps REST API](https://learn.microsoft.com/en-us/rest/api/azure/devops/) from a function **as the signed-in user**, using `AudienceType.ADO`.
7
+ Call the [Azure DevOps REST API](https://learn.microsoft.com/en-us/rest/api/azure/devops/) from a deployed function using `AudienceType.ADO`.
8
+
9
+ Grant the [application identity](../index.md#application-authentication) access to your Azure DevOps organization and the permissions required by the project or resource you call.
8
10
 
9
11
  Provide your Azure DevOps **organization** (and project, if the call needs one) — e.g. `https://dev.azure.com/<org>`. The token is a standard bearer token — send it with `fetch`:
10
12
 
13
+ `AppSchema` below is your app's data schema — the same type you pass to `RayfinClient<AppSchema>`. See [Writing functions](../writing-functions.md#accessing-data-and-request-context).
14
+
11
15
  ```ts
12
16
  import {
13
17
  UserDataFunctions,
@@ -22,8 +26,8 @@ const ORG = "https://dev.azure.com/<org>";
22
26
 
23
27
  udf.func(
24
28
  "listProjects",
25
- async (ctx: RayfinContext): Promise<unknown> => {
26
- const token = ctx.getToken(AudienceType.ADO);
29
+ async (ctx: RayfinContext<AppSchema, AudienceType.ADO>): Promise<unknown> => {
30
+ const token = ctx.Tokens.ADO;
27
31
  const res = await fetch(`${ORG}/_apis/projects?api-version=7.1`, {
28
32
  headers: { Authorization: `Bearer ${token}` },
29
33
  });
@@ -32,7 +36,7 @@ udf.func(
32
36
  }
33
37
  return res.json();
34
38
  },
35
- [udf.connection({ audienceType: AudienceType.ADO })],
39
+ [],
36
40
  );
37
41
  ```
38
42
 
@@ -4,58 +4,24 @@ sidebar_position: 3
4
4
 
5
5
  # Add an Azure resource
6
6
 
7
- Connect a function to an **Azure service** — Key Vault, Cosmos DB, Blob Storage, or Event Grid — and call it **as the signed-in user**.
7
+ Connect a deployed function to **Azure Blob Storage**.
8
8
 
9
- These are Azure resources, not Fabric items, so their endpoints come from the **Azure portal** (there is no Fabric lookup). Each pattern declares the connection, reads the token with `ctx.getToken()`, and wraps it with the [`ContextTokenCredential`](./index.md#wrapping-the-token-for-azure-sdk-clients) helper for the Azure SDK. See [Connecting to external resources](./index.md) for the shared model.
9
+ Grant the [application identity](../index.md#application-authentication) the storage data permissions required by your operations.
10
10
 
11
- ## Key Vault
11
+ The storage account is an Azure resource, not a Fabric item, so its endpoint comes from the **Azure portal** (there is no Fabric lookup).
12
+ The pattern declares the audience in the `RayfinContext` annotation, reads the token from `ctx.Tokens`, and wraps it with the [`ContextTokenCredential`](./index.md#wrapping-the-token-for-azure-sdk-clients) helper for the Azure SDK.
13
+ See [Connecting to external resources](./index.md) for the shared model.
12
14
 
13
- Read secrets from Azure Key Vault using `AudienceType.KeyVault`.
15
+ `AppSchema` below is your app's data schema — the same type you pass to `RayfinClient<AppSchema>`.
16
+ See [Writing functions](../writing-functions.md#accessing-data-and-request-context).
14
17
 
15
- ```bash
16
- cd rayfin/functions
17
- npm install @azure/keyvault-secrets @azure/identity
18
- ```
19
-
20
- ```ts
21
- import {
22
- UserDataFunctions,
23
- AudienceType,
24
- type RayfinContext,
25
- } from "@microsoft/fabric-user-data-functions";
26
- import { SecretClient } from "@azure/keyvault-secrets";
27
-
28
- const udf = new UserDataFunctions();
29
-
30
- udf.func(
31
- "getVaultSecret",
32
- async (
33
- ctx: RayfinContext,
34
- kvUrl: string,
35
- secretName: string,
36
- ): Promise<string> => {
37
- const credential = new ContextTokenCredential(
38
- ctx.getToken(AudienceType.KeyVault),
39
- );
40
- const client = new SecretClient(kvUrl, credential);
41
- const secret = await client.getSecret(secretName);
42
- return secret.value ?? "";
43
- },
44
- [udf.connection({ audienceType: AudienceType.KeyVault })],
45
- );
46
- ```
47
-
48
- Provide the vault URL (e.g. `https://my-vault.vault.azure.net/`).
49
-
50
- > To read secrets stored with Rayfin itself (rather than an external Key Vault), use [`ctx.getSecret()`](../secrets.md) instead — no connection required.
51
-
52
- ## Cosmos DB
18
+ ## Blob Storage
53
19
 
54
- Connect to Azure Cosmos DB using `AudienceType.CosmosDB`. Pass the credential as `aadCredentials`:
20
+ Connect to Azure Blob / Table / Queue storage using `AudienceType.Storage`:
55
21
 
56
22
  ```bash
57
23
  cd rayfin/functions
58
- npm install @azure/cosmos
24
+ npm install @azure/storage-blob @azure/identity
59
25
  ```
60
26
 
61
27
  ```ts
@@ -64,53 +30,17 @@ import {
64
30
  AudienceType,
65
31
  type RayfinContext,
66
32
  } from "@microsoft/fabric-user-data-functions";
67
- import { CosmosClient } from "@azure/cosmos";
33
+ import { BlobServiceClient } from "@azure/storage-blob";
68
34
 
69
35
  const udf = new UserDataFunctions();
70
36
 
71
- udf.func(
72
- "readItems",
73
- async (
74
- ctx: RayfinContext,
75
- endpoint: string,
76
- databaseId: string,
77
- containerId: string,
78
- ): Promise<unknown[]> => {
79
- const credential = new ContextTokenCredential(
80
- ctx.getToken(AudienceType.CosmosDB),
81
- );
82
- const client = new CosmosClient({ endpoint, aadCredentials: credential });
83
- const { resources } = await client
84
- .database(databaseId)
85
- .container(containerId)
86
- .items.readAll()
87
- .fetchAll();
88
- return resources;
89
- },
90
- [udf.connection({ audienceType: AudienceType.CosmosDB })],
91
- );
92
- ```
93
-
94
- Provide the account endpoint and the database / container names.
95
-
96
- ## Blob Storage
97
-
98
- Connect to Azure Blob / Table / Queue storage using `AudienceType.Storage`:
99
-
100
- ```bash
101
- cd rayfin/functions
102
- npm install @azure/storage-blob
103
- ```
104
-
105
- ```ts
106
- import { BlobServiceClient } from "@azure/storage-blob";
107
-
108
37
  udf.func(
109
38
  "listBlobs",
110
- async (ctx: RayfinContext, accountUrl: string): Promise<string[]> => {
111
- const credential = new ContextTokenCredential(
112
- ctx.getToken(AudienceType.Storage),
113
- );
39
+ async (
40
+ ctx: RayfinContext<AppSchema, AudienceType.Storage>,
41
+ accountUrl: string,
42
+ ): Promise<string[]> => {
43
+ const credential = new ContextTokenCredential(ctx.Tokens.Storage);
114
44
  const service = new BlobServiceClient(accountUrl, credential);
115
45
  const names: string[] = [];
116
46
  for await (const container of service.listContainers()) {
@@ -118,54 +48,10 @@ udf.func(
118
48
  }
119
49
  return names;
120
50
  },
121
- [udf.connection({ audienceType: AudienceType.Storage })],
51
+ [],
122
52
  );
123
53
  ```
124
54
 
125
55
  Provide the storage account URL (e.g. `https://<account>.blob.core.windows.net`).
126
56
 
127
57
  > `AudienceType.Storage` also covers **OneLake** files — that Fabric case is documented in [Add a Fabric resource → OneLake files](./add-fabric-resource.md#onelake-files).
128
-
129
- ## Event Grid
130
-
131
- Publish events to an Azure Event Grid topic using `AudienceType.EventGrid`. The topic endpoint is in the Azure portal → your topic → **Overview** → _Topic Endpoint_.
132
-
133
- ```bash
134
- cd rayfin/functions
135
- npm install @azure/eventgrid
136
- ```
137
-
138
- ```ts
139
- import {
140
- UserDataFunctions,
141
- AudienceType,
142
- type RayfinContext,
143
- } from "@microsoft/fabric-user-data-functions";
144
- import { EventGridPublisherClient } from "@azure/eventgrid";
145
-
146
- const udf = new UserDataFunctions();
147
-
148
- const TOPIC_ENDPOINT =
149
- "https://<topic>.<region>.eventgrid.azure.net/api/events";
150
-
151
- udf.func(
152
- "publishEvent",
153
- async (ctx: RayfinContext, subject: string): Promise<string> => {
154
- const client = new EventGridPublisherClient(
155
- TOPIC_ENDPOINT,
156
- "EventGrid",
157
- new ContextTokenCredential(ctx.getToken(AudienceType.EventGrid)),
158
- );
159
- await client.send([
160
- {
161
- eventType: "Rayfin.Function.Event",
162
- subject,
163
- dataVersion: "1.0",
164
- data: { source: "user-data-function" },
165
- },
166
- ]);
167
- return "published";
168
- },
169
- [udf.connection({ audienceType: AudienceType.EventGrid })],
170
- );
171
- ```
@@ -4,11 +4,18 @@ sidebar_position: 2
4
4
 
5
5
  # Add a Fabric resource
6
6
 
7
- Connect a function to a **Microsoft Fabric item** — a Lakehouse, Warehouse, SQL Database, OneLake files, or an Eventhouse (KQL) — and call it **as the signed-in user**.
7
+ Connect a deployed function to a **Microsoft Fabric item** — a Lakehouse, Warehouse, SQL Database, or OneLake files.
8
8
 
9
- **Before you start:** you need the item's coordinates (SQL endpoint, OneLake path, or Kusto query URI). See [Get Fabric info](./get-fabric-info.md) for how to pull them from the Fabric REST API.
9
+ For the app's Rayfin DB, use [`ctx.getDataClient()`](../writing-functions.md#accessing-data-and-request-context) instead.
10
10
 
11
- All the patterns below follow the same model: declare the connection, read the token with `ctx.getToken()`, use it. See [Connecting to external resources](./index.md) for the shared model and the [`ContextTokenCredential`](./index.md#wrapping-the-token-for-azure-sdk-clients) helper referenced here.
11
+ Grant the [application identity](../index.md#application-authentication) the required access to the workspace, item, or database for the operation you need.
12
+
13
+ **Before you start:** you need the item's coordinates (SQL endpoint or OneLake path).
14
+ See [Get Fabric info](./get-fabric-info.md) for how to pull them from the Fabric REST API.
15
+
16
+ All the patterns below follow the same model: declare the audience in the `RayfinContext` annotation, read the token from `ctx.Tokens`, use it. See [Connecting to external resources](./index.md) for the shared model and the [`ContextTokenCredential`](./index.md#wrapping-the-token-for-azure-sdk-clients) helper referenced here.
17
+
18
+ `AppSchema` below is your app's data schema — the same type you pass to `RayfinClient<AppSchema>`. See [Writing functions](../writing-functions.md#accessing-data-and-request-context).
12
19
 
13
20
  ## SQL databases
14
21
 
@@ -16,7 +23,7 @@ Covers Fabric **Lakehouse** (SQL analytics endpoint), **Warehouse**, **SQL Datab
16
23
 
17
24
  - **Package:** `mssql@^12.6.0` (which pulls `tedious >= 19.2.2`). Older `tedious` (`<= 19.1.2`) has a LOGIN7 FeatureExt bug that causes "socket hang up" errors against Fabric endpoints.
18
25
  - **Encryption:** `encrypt: true` (not `'strict'`). This matches ODBC `Encrypt=yes`.
19
- - **Auth:** `azure-active-directory-access-token` with the token from `ctx.getToken(AudienceType.Sql)`.
26
+ - **Auth:** `azure-active-directory-access-token` with the token from `ctx.Tokens.Sql`.
20
27
 
21
28
  Install the driver in the functions project:
22
29
 
@@ -52,10 +59,10 @@ const DATABASE = "<item-guid-or-db-name>";
52
59
  udf.func(
53
60
  "queryData",
54
61
  async (
55
- ctx: RayfinContext,
62
+ ctx: RayfinContext<AppSchema, AudienceType.Sql>,
56
63
  query: string,
57
64
  ): Promise<Record<string, unknown>[]> => {
58
- const token = ctx.getToken(AudienceType.Sql);
65
+ const token = ctx.Tokens.Sql;
59
66
  const pool = await sql.connect({
60
67
  server: SQL_SERVER,
61
68
  database: DATABASE,
@@ -69,7 +76,7 @@ udf.func(
69
76
  await pool.close();
70
77
  return result.recordset;
71
78
  },
72
- [udf.connection({ audienceType: AudienceType.Sql })],
79
+ [],
73
80
  );
74
81
  ```
75
82
 
@@ -79,7 +86,7 @@ Read and write files in a Lakehouse's OneLake storage using `AudienceType.Storag
79
86
 
80
87
  The OneLake DFS URL has the form `https://onelake.dfs.fabric.microsoft.com/<workspaceId>/<itemId>/Files/<path>` — get it from `oneLakeFilesPath` via [Get Fabric info](./get-fabric-info.md#lakehouse), or construct it from the workspace and item GUIDs.
81
88
 
82
- Call the DFS endpoint directly with the delegated token — no SDK required:
89
+ Call the DFS endpoint directly with the app-identity token — no SDK required:
83
90
 
84
91
  ```ts
85
92
  import {
@@ -92,8 +99,11 @@ const udf = new UserDataFunctions();
92
99
 
93
100
  udf.func(
94
101
  "readFile",
95
- async (ctx: RayfinContext, fileUrl: string): Promise<string> => {
96
- const token = ctx.getToken(AudienceType.Storage);
102
+ async (
103
+ ctx: RayfinContext<AppSchema, AudienceType.Storage>,
104
+ fileUrl: string,
105
+ ): Promise<string> => {
106
+ const token = ctx.Tokens.Storage;
97
107
  const res = await fetch(fileUrl, {
98
108
  headers: { Authorization: `Bearer ${token}` },
99
109
  });
@@ -102,59 +112,16 @@ udf.func(
102
112
  }
103
113
  return await res.text();
104
114
  },
105
- [udf.connection({ audienceType: AudienceType.Storage })],
115
+ [],
106
116
  );
107
117
  ```
108
118
 
109
- ## Eventhouse and KQL
110
-
111
- Query a Fabric **Eventhouse** (KQL database) or a standalone Azure Data Explorer cluster using `AudienceType.Kusto`.
112
-
113
- Get the cluster's **query URI** from the Eventhouse's `properties.queryServiceUri` — see [Get Fabric info → Eventhouse](./get-fabric-info.md#eventhouse).
114
-
115
- `azure-kusto-data` accepts a token provider, so hand it a callback that returns `ctx.getToken`:
116
-
117
- ```ts
118
- import {
119
- UserDataFunctions,
120
- AudienceType,
121
- type RayfinContext,
122
- } from "@microsoft/fabric-user-data-functions";
123
- import { Client, KustoConnectionStringBuilder } from "azure-kusto-data";
124
-
125
- const udf = new UserDataFunctions();
126
-
127
- // Read these from the Eventhouse item — see "Get Fabric info".
128
- const CLUSTER_URI = "https://<cluster>.z5.kusto.fabric.microsoft.com";
129
- const DATABASE = "<kql-database-name>";
130
-
131
- udf.func(
132
- "queryKusto",
133
- async (ctx: RayfinContext, query: string): Promise<unknown[]> => {
134
- const kcsb = KustoConnectionStringBuilder.withTokenProvider(
135
- CLUSTER_URI,
136
- async () => ctx.getToken(AudienceType.Kusto),
137
- );
138
- const client = new Client(kcsb);
139
- const response = await client.execute(DATABASE, query);
140
- return response.primaryResults[0].toJSON().data;
141
- },
142
- [udf.connection({ audienceType: AudienceType.Kusto })],
143
- );
144
- ```
145
-
146
- Install the SDK in the functions project:
147
-
148
- ```bash
149
- cd rayfin/functions
150
- npm install azure-kusto-data
151
- ```
152
-
153
119
  ## Fabric REST API
154
120
 
155
- Call the [Fabric REST API](https://learn.microsoft.com/en-us/rest/api/fabric/) as the calling user — for example to list items or read item metadata from inside a function — using `AudienceType.Fabric`.
121
+ Call the [Fabric REST API](https://learn.microsoft.com/en-us/rest/api/fabric/) as the app identity — for example to list items or read item metadata from inside a function — using `AudienceType.Fabric`.
122
+ Check that the specific API supports application identities and that the app identity has the required access.
156
123
 
157
- The API base is fixed at `https://api.fabric.microsoft.com/v1`; `ctx.getToken(AudienceType.Fabric)` returns a token scoped for it. Send it as a bearer token with `fetch`:
124
+ The API base is fixed at `https://api.fabric.microsoft.com/v1`; `ctx.Tokens.Fabric` returns a token scoped for it. Send it as a bearer token with `fetch`:
158
125
 
159
126
  ```ts
160
127
  import {
@@ -169,8 +136,11 @@ const FABRIC_API = "https://api.fabric.microsoft.com/v1";
169
136
 
170
137
  udf.func(
171
138
  "listWorkspaceItems",
172
- async (ctx: RayfinContext, workspaceId: string): Promise<unknown> => {
173
- const token = ctx.getToken(AudienceType.Fabric);
139
+ async (
140
+ ctx: RayfinContext<AppSchema, AudienceType.Fabric>,
141
+ workspaceId: string,
142
+ ): Promise<unknown> => {
143
+ const token = ctx.Tokens.Fabric;
174
144
  const res = await fetch(`${FABRIC_API}/workspaces/${workspaceId}/items`, {
175
145
  headers: { Authorization: `Bearer ${token}` },
176
146
  });
@@ -179,8 +149,8 @@ udf.func(
179
149
  }
180
150
  return res.json();
181
151
  },
182
- [udf.connection({ audienceType: AudienceType.Fabric })],
152
+ [],
183
153
  );
184
154
  ```
185
155
 
186
- > This is the same API used in [Get Fabric info](./get-fabric-info.md) — the difference is that there you call it at **authoring time** (with an `az` token) to gather endpoints, whereas here the **function** calls it at runtime with the user's delegated token.
156
+ > This is the same API used in [Get Fabric info](./get-fabric-info.md) — the difference is that there you call it at **authoring time** (with an `az` token) to gather endpoints, whereas here the **deployed function** calls it at runtime with the app identity's token and resource permissions.
@@ -4,10 +4,14 @@ sidebar_position: 4
4
4
 
5
5
  # Add Azure AI Foundry
6
6
 
7
- Call an **Azure AI Foundry** (Azure OpenAI / Azure AI) resource from a function **as the signed-in user**, using `AudienceType.AzureAI`.
7
+ Call an **Azure AI Foundry** (Azure OpenAI / Azure AI) resource from a deployed function using `AudienceType.AzureAI`.
8
+
9
+ Grant the [application identity](../index.md#application-authentication) the permissions required by your Azure AI resource and API.
8
10
 
9
11
  Provide the resource **endpoint** (Azure AI Foundry → your resource → _Endpoint_). The token is a standard bearer token — send it with `fetch`, or wrap it with the [`ContextTokenCredential`](./index.md#wrapping-the-token-for-azure-sdk-clients) helper for an Azure AI SDK client.
10
12
 
13
+ `AppSchema` below is your app's data schema — the same type you pass to `RayfinClient<AppSchema>`. See [Writing functions](../writing-functions.md#accessing-data-and-request-context).
14
+
11
15
  ```ts
12
16
  import {
13
17
  UserDataFunctions,
@@ -22,8 +26,11 @@ const AI_ENDPOINT = "https://<resource>.services.ai.azure.com";
22
26
 
23
27
  udf.func(
24
28
  "callAzureAi",
25
- async (ctx: RayfinContext, prompt: string): Promise<unknown> => {
26
- const token = ctx.getToken(AudienceType.AzureAI);
29
+ async (
30
+ ctx: RayfinContext<AppSchema, AudienceType.AzureAI>,
31
+ prompt: string,
32
+ ): Promise<unknown> => {
33
+ const token = ctx.Tokens.AzureAI;
27
34
  const res = await fetch(`${AI_ENDPOINT}/...`, {
28
35
  method: "POST",
29
36
  headers: {
@@ -37,7 +44,7 @@ udf.func(
37
44
  }
38
45
  return res.json();
39
46
  },
40
- [udf.connection({ audienceType: AudienceType.AzureAI })],
47
+ [],
41
48
  );
42
49
  ```
43
50
 
@@ -4,12 +4,14 @@ sidebar_position: 1
4
4
 
5
5
  # Finding resource coordinates
6
6
 
7
- Every connection recipe needs a real endpoint — the SQL server, the OneLake path, the Key Vault URI, the Kusto query URI, and so on.
7
+ Every connection recipe needs a real endpoint, such as the SQL server or the OneLake path.
8
8
  This page explains **how to obtain those values from a Fabric item** so you (or an agent authoring a function) can fill them in with real data instead of guessing.
9
9
 
10
- **You only need the workspace and item _display names_ to start** — for example, "lakehouseA in workspaceB". Everything else (the workspace ID, item ID, SQL endpoint, OneLake path, Kusto URI) is derivable from here. Resolve those values rather than asking for anything you can look up.
10
+ **You only need the workspace and item _display names_ to start** — for example, "lakehouseA in workspaceB".
11
+ Everything else (the workspace ID, item ID, SQL endpoint, OneLake path) is derivable from here.
12
+ Resolve those values rather than asking for anything you can look up.
11
13
 
12
- > **Why this matters:** don't hardcode a guessed endpoint. `ctx.getToken()` gives you an access token, but you still have to point the SDK at the correct URL — and that URL comes from the Fabric item's metadata, not from `process.env`.
14
+ > **Why this matters:** don't hardcode a guessed endpoint. `ctx.Tokens` gives you an access token, but you still have to point the SDK at the correct URL — and that URL comes from the Fabric item's metadata, not from `process.env`.
13
15
 
14
16
  ## Ways to get coordinates
15
17
 
@@ -36,7 +38,7 @@ az account get-access-token \
36
38
  --query accessToken -o tsv
37
39
  ```
38
40
 
39
- > This is an **authoring-time** lookup — you are gathering coordinates to write into the function. At **runtime** the function itself uses `ctx.getToken(AudienceType.X)` (or, for the Fabric API specifically, `ctx.getToken(AudienceType.Fabric)` — see [Add a Fabric resource → Fabric REST API](./add-fabric-resource.md#fabric-rest-api)).
41
+ > This is an **authoring-time** lookup — you are gathering coordinates to write into the function. At **runtime** the function itself declares the audience on its `RayfinContext` annotation and reads `ctx.Tokens.<Audience>` (for the Fabric API specifically, `ctx.Tokens.Fabric` — see [Add a Fabric resource → Fabric REST API](./add-fabric-resource.md#fabric-rest-api)).
40
42
 
41
43
  ## Step 1 — find the workspace and item ID
42
44
 
@@ -52,7 +54,7 @@ List items of a given type in a workspace (to resolve a display name to its ID):
52
54
  GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items?type=Lakehouse
53
55
  ```
54
56
 
55
- `type` accepts any Fabric item type — `Lakehouse`, `Warehouse`, `SQLDatabase`, `Eventhouse`, `KQLDatabase`, and so on.
57
+ `type` accepts any Fabric item type — for these recipes, use `Lakehouse`, `Warehouse`, or `SQLDatabase`.
56
58
  Each entry returns `id`, `displayName`, and `type`. Take the `id` of the item you want.
57
59
 
58
60
  ## Step 2 — GET the item to read its coordinates
@@ -120,25 +122,6 @@ GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/sqlDatabases/{s
120
122
 
121
123
  - **Server** → `properties.serverFqdn`, **database** → `properties.databaseName`. Both are also embedded in `properties.connectionString`.
122
124
 
123
- ### Eventhouse
124
-
125
- ```http
126
- GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/eventhouses/{eventhouseId}
127
- ```
128
-
129
- ```json
130
- {
131
- "type": "Eventhouse",
132
- "properties": {
133
- "queryServiceUri": "https://xxxxx.z5.kusto.fabric.microsoft.com",
134
- "ingestionServiceUri": "https://ingest-xxxxx.z5.kusto.fabric.microsoft.com",
135
- "databasesItemIds": ["<kql-database-item-id>"]
136
- }
137
- }
138
- ```
139
-
140
- - **Cluster / query URI** → `properties.queryServiceUri`. Use with [Eventhouse and KQL](./add-fabric-resource.md#eventhouse-and-kql). Each KQL database inside the eventhouse is listed in `databasesItemIds`.
141
-
142
125
  ## Coordinate lookup table
143
126
 
144
127
  | You need | Item type | Endpoint | Field |
@@ -147,7 +130,6 @@ GET https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/eventhouses/{ev
147
130
  | SQL server (Warehouse) | Warehouse | `.../warehouses/{id}` | `properties.connectionString` |
148
131
  | SQL server + database (SQL DB) | SQL Database | `.../sqlDatabases/{id}` | `properties.serverFqdn` / `properties.databaseName` |
149
132
  | OneLake Files / Tables URL | Lakehouse | `.../lakehouses/{id}` | `properties.oneLakeFilesPath` / `oneLakeTablesPath` |
150
- | Kusto query URI | Eventhouse | `.../eventhouses/{id}` | `properties.queryServiceUri` |
151
133
  | Item GUID (any item) | any | `.../items?type={Type}` | `id` |
152
134
 
153
135
  For item types not listed here, browse the [Fabric REST API item reference](https://learn.microsoft.com/en-us/rest/api/fabric/) — each item's **Get** operation returns its coordinates under `properties`.