MCPcopy Index your code
hub / github.com/simstudioai/sim / deliver

Function deliver

apps/sim/lib/data-drains/destinations/azure_blob.ts:172–199  ·  view source on GitHub ↗
({ body, contentType, metadata, signal })

Source from the content-addressed store, hash-verified

170 let clientsPromise: Promise<BlobClients> | null = null
171 return {
172 async deliver({ body, contentType, metadata, signal }) {
173 if (clientsPromise === null) clientsPromise = buildClients(config, credentials)
174 const { containerClient } = await clientsPromise
175 const blobName = buildObjectKey(config.prefix, metadata)
176 const blockBlobClient = containerClient.getBlockBlobClient(blobName)
177 await withAzureErrorContext('put-object', () =>
178 blockBlobClient.upload(body, body.byteLength, {
179 blobHTTPHeaders: { blobContentType: contentType },
180 metadata: {
181 simdrainid: metadata.drainId,
182 simrunid: metadata.runId,
183 simsource: metadata.source,
184 simsequence: metadata.sequence.toString(),
185 simrowcount: metadata.rowCount.toString(),
186 },
187 abortSignal: signal,
188 })
189 )
190 logger.debug('Azure Blob chunk delivered', {
191 accountName: config.accountName,
192 containerName: config.containerName,
193 blobName,
194 bytes: body.byteLength,
195 })
196 return {
197 locator: `azure://${config.accountName}/${config.containerName}/${blobName}`,
198 }
199 },
200 async close() {},
201 }
202 },

Callers

nothing calls this directly

Calls 5

buildObjectKeyFunction · 0.90
buildClientsFunction · 0.85
withAzureErrorContextFunction · 0.85
debugMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected