({ body, contentType, metadata, signal })
| 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 | }, |
nothing calls this directly
no test coverage detected