Whenever a call to a method carrying a CRUD operation on an Azure Blob is found in the source code, this extension evaluates the name of the container in which the operation is made and a link is created from the caller of the method to that blob container. If the evaluation of the container name fails (either due to missing information in the source code or to limitations in the evaluation) a link is created to an Unknown container. For methods copying a blob from one container to another, a useSelectLink is created to the source container and both a useInsertLink and a useUpdateLink are created to the destination container.
The list of supported methods and the type of links created are listed in the following table:
LinkType | Methods from containerClient const {BlobServiceClient} = require("@azure/storage-blob"); const blobServiceClient = new BlobServiceClient(...); const containerClient = blobServiceClient.getContainerClient(...) | Methods from BlobClients (blockBlobClient, const {BlobServiceClient} = require("@azure/storage-blob") const blobServiceClient = new BlobServiceClient(...) const containerClient = blobServiceClient.getContainerClient(...) const blockBlobClient = containerClient.getBlockBlobClient(...) | Methods from BlobServices const azure = require('azure-storage') const blobService = azure.createBlobService(...) |
---|---|---|---|
useInsert | uploadBlockBlob | syncUploadFromURL, upload', uploadPages, uploadPagesFromURL, beginCopyFromURL | createAppendBlobFromBrowserFile, createAppendBlobFromLocalFile, createAppendBlobFromStream, createAppendBlobFromText, createBlobSnapshot, createBlobSnapshot, createBlockBlobFromLocalFile, createBlockBlobFromStream, createBlockBlobFromText, createBlockFromStream, createBlockFromText, createBlockFromURL, createOrReplaceAppendBlob, createPageBlob, createPageBlob, createPageBlobFromLocalFile, createPageBlobFromStream, createPagesFromStream, createWriteStreamToBlockBlob, createWriteStreamToBlockBlob, createWriteStreamToNewAppendBlob, createWriteStreamToNewPageBlob, startCopyBlob |
useUpdate | uploadBlockBlob | commitBlockList, stageBlock, stageBlockFromURL, syncUploadFromURL, upload, uploadBrowserData 'ploadData, uploadFile, uploadStream, uploadPages, uploadPagesFromURL, appendBlock, appendBlockFromURL, beginCopyFromURL, startCopyIncremental | appendBlockFromStream, appendBlockFromText, appendFromBrowserFile, appendFromLocalFile, appendFromStream, appendFromText, commitBlocks, createAppendBlobFromBrowserFile, createAppendBlobFromLocalFile, createAppendBlobFromStream, createAppendBlobFromText, createBlobSnapshot, createBlockBlobFromLocalFile, createBlockBlobFromStream, createBlockBlobFromText, createBlockFromStream, createBlockFromText, createBlockFromURL, createOrReplaceAppendBlob, createPageBlob, createPageBlob, createPageBlobFromLocalFile, createPageBlobFromStream, createPagesFromStream, createWriteStreamToBlockBlob, createWriteStreamToBlockBlob, createWriteStreamToExistingAppendBlob, createWriteStreamToExistingAppendBlob, createWriteStreamToExistingPageBlob, startCopyBlob |
useDelete | deleteBlob, deleteIfExists | clearPages, deleteBlobs, delete, deleteIfExists | deleteBlob, deleteBlobIfExists, deleteContainer, deleteContainerIfExists |
useSelect | getBlockList, query, createSnapshot, download, downloadToBuffer, downloadToFile, beginCopyFromURL, startCopyIncremental | createBlobSnapshot, createReadStream, getBlobToLocalFile, getBlobToStream, getBlobToText, startCopyBlob, createBlockFromURL |
When analyzing the following code, a blob container named my_container is created as well as useInsert and useUpdate links from the main function to that container:
const { BlobServiceClient } = require("@azure/storage-blob"); const blobServiceClient = new BlobServiceClient(account_url, defaultAzureCredential); async function main() { const containerClient = blobServiceClient.getContainerClient("my_container"); const content = "Hello world!"; const blockBlobClient = containerClient.getBlockBlobClient("blobName"); const uploadBlobResponse = await blockBlobClient.upload(content, content.length); }