Creates an instance of BlobChangeFeedClient.
A Client string pointing to Azure Storage blob service, such as "https://myaccount.blob.core.windows.net". You can append a SAS if using AnonymousCredential, such as "https://myaccount.blob.core.windows.net?sasString".
Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the @azure/identity
package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
Optional. Options to configure the HTTP pipeline.
Example using DefaultAzureCredential from @azure/identity
:
const account = "<storage account name>";
const defaultAzureCredential = new DefaultAzureCredential();
const blobChangeFeedClient = new BlobChangeFeedClient(
`https://${account}.blob.core.windows.net`,
defaultAzureCredential
);
Example using an account name/key:
const account = "<storage account name>"
const sharedKeyCredential = new StorageSharedKeyCredential(account, "<account key>");
const blobChangeFeedClient = new BlobChangeFeedClient(
`https://${account}.blob.core.windows.net`,
sharedKeyCredential
);
Creates an instance of BlobChangeFeedClient.
A Client string pointing to Azure Storage blob service, such as "https://myaccount.blob.core.windows.net". You can append a SAS if using AnonymousCredential, such as "https://myaccount.blob.core.windows.net?sasString".
Call newPipeline() to create a default pipeline, or provide a customized pipeline.
Returns an async iterable iterator to list all the change feed events in the specified account.
.byPage() returns an async iterable iterator to list the change feed events in pages.
Example using for await
syntax:
let i = 1;
for await (const event of blobChangeFeedClient.listChanges()) {
console.log(`Event ${i++}, type: ${event.eventType}`);
}
Example using iter.next()
:
let i = 1;
const iter = blobChangeFeedClient.listChanges();
let eventItem = await iter.next();
while (!eventItem.done) {
console.log(`Event ${i++}, type: ${eventItem.eventType}`);
eventItem = await iter.next();
}
Example using byPage()
:
// passing optional maxPageSize in the page settings
let i = 1;
for await (const eventPage of blobChangeFeedClient.listChanges().byPage({ maxPageSize: 20 })) {
if (eventPage.events) {
for (const event of eventPage.events) {
console.log(`Event ${i++}, type: ${event.eventType}`);
}
}
}
Example using paging with a marker:
let i = 1;
let iterator = blobChangeFeedClient.listChanges().byPage({ maxPageSize: 2 });
let eventPage = (await iterator.next()).value;
if (eventPage.events) {
for (const container of eventPage.events) {
console.log(`Event ${i++}, type: ${event.eventType}`);
}
}
// Gets next marker
let marker = eventPage.continuationToken;
// Passing next marker as continuationToken
iterator = blobChangeFeedClient
.listChanges()
.byPage({ continuationToken: marker, maxPageSize: 10 });
eventPage = (await iterator.next()).value;
if (eventPage.events) {
for (const container of eventPage.events) {
console.log(`Event ${i++}, type: ${event.eventType}`);
}
}
Options to list change feed events.
An asyncIterableIterator that supports paging.
Creates an instance of BlobChangeFeedClient from connection string.
Account connection string or a SAS connection string of an Azure storage account.
[ Note - Account connection string can only be used in NODE.JS runtime. ]
Account connection string example -
DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net
SAS connection string example -
BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString
Optional. Options to configure the HTTP pipeline.
Generated using TypeDoc
BlobChangeFeedClient.
https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-change-feed?tabs=azure-portal