-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade Azure Storage SDK to a modern version #629
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of comments. I know you plan to do more testing, so I'll take another look once that is done.
const properties = await this.queueClient.getProperties() | ||
return { count: properties.approximateMessagesCount } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This likely applies in other places as well. In the original code, error handling logged the error. In the new code, it appears that error handling depends on how await
handles exceptions instead of using try
and catch
blocks to log the error in the same way as the original.
const properties = await this.queueClient.getProperties() | |
return { count: properties.approximateMessagesCount } | |
try { | |
const properties = await this.queueClient.getProperties() | |
return { count: properties.approximateMessagesCount } | |
} catch (error) { | |
this.logger.error(error) // Log the error | |
return null // Handle the error by returning null | |
} |
if (connectionString) { | ||
this.client = QueueServiceClient.fromConnectionString(connectionString, pipelineOptions) | ||
} else { | ||
this.client = new QueueServiceClient( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice update here for maintaining the old approach and setting up a more flexible long term approach.
const retryOperations = new AzureStorage.ExponentialRetryPolicyFilter() | ||
this.client = AzureStorage.createQueueService(connectionString).withFilter(retryOperations) | ||
constructor(connectionString, options) { | ||
const pipelineOptions = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the use of pipelineOptions
. Makes it easier to see the configs related to the queues.
} | ||
|
||
// This API can only be used for the 'deadletter' store because we cannot look up documents by type performantly | ||
async count(type, force = false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you talk about the reason this is deleted completely?
This change is a prerequisite to enable token-based authentication for the Azure Storage operations (blobs and queues). This change leaves the options to use the existing, connection string-based authentication though.