MCPcopy
hub / github.com/simstudioai/sim / getBlobServiceClient

Function getBlobServiceClient

apps/sim/lib/uploads/providers/blob/client.ts:70–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68}
69
70export async function getBlobServiceClient(): Promise<BlobServiceClientType> {
71 if (_blobServiceClient) return _blobServiceClient
72
73 const { BlobServiceClient, StorageSharedKeyCredential } = await import('@azure/storage-blob')
74 const { accountName, accountKey, connectionString } = BLOB_CONFIG
75
76 if (connectionString) {
77 _blobServiceClient = BlobServiceClient.fromConnectionString(connectionString)
78 } else if (accountName && accountKey) {
79 const sharedKeyCredential = new StorageSharedKeyCredential(accountName, accountKey)
80 _blobServiceClient = new BlobServiceClient(
81 `https://${accountName}.blob.core.windows.net`,
82 sharedKeyCredential
83 )
84 } else {
85 throw new Error(
86 'Azure Blob Storage credentials are missing – set AZURE_STORAGE_CONNECTION_STRING or both AZURE_STORAGE_ACCOUNT_NAME and AZURE_STORAGE_ACCOUNT_KEY in your environment.'
87 )
88 }
89
90 return _blobServiceClient
91}
92
93/**
94 * Upload a file to Azure Blob Storage

Callers 13

uploadToBlobFunction · 0.85
getPresignedUrlFunction · 0.85
downloadFromBlobFunction · 0.85
downloadFromBlobStreamFunction · 0.85
headBlobObjectFunction · 0.85
deleteFromBlobFunction · 0.85
initiateMultipartUploadFunction · 0.85
getMultipartPartUrlsFunction · 0.85
getBlockBlobClientForFunction · 0.85
completeMultipartUploadFunction · 0.85
abortMultipartUploadFunction · 0.85
generateBlobPresignedUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected