Transitioning to Updated Azure Storage Libraries in D365 Finance Customizations
If you’re customizing D365
Finance and still using older Azure storage libraries, it’s time to modernize
your approach. Microsoft has deprecated some libraries, and it’s essential to
switch to their updated counterparts for better performance, support, and
compatibility with the latest Azure features. This blog will guide you through
the changes and help you make a smooth transition.
Deprecated Libraries
Here are some commonly used
Azure storage libraries that are now deprecated:
- Microsoft.Azure.Storage.Blob
- Microsoft.WindowsAzure.Storage
- Microsoft.Azure.Storage.Queue
- Microsoft.Azure.Storage.File
Updated Libraries to Use
Replace the deprecated libraries
with the following updated ones:
- Azure.Storage.Blobs
- For working with Azure Blob storage.
- Azure.Storage.Queues
- For managing Azure Queue storage.
- Azure.Storage.Files.Shares
- For handling Azure File Shares.
- Azure.Storage.Common
- Provides shared functionality across the storage libraries.
Why Switch?
The updated libraries offer
several advantages:
- Improved Performance: The new libraries are optimized
for better speed and efficiency.
- Enhanced Security: They come with improved
authentication mechanisms like Azure Identity.
- Feature Updates: Access to the latest Azure features
and capabilities.
- Long-Term Support: Microsoft actively supports and
maintains these libraries.
How to Migrate
Switching to the updated
libraries may require changes to your code. Here’s a general approach:
- Identify Usage: Search your codebase for references to
deprecated libraries.
- Update Code: Replace methods and classes from the old
libraries with their new counterparts. Here’s an example:
Old Code (Using Microsoft.Azure.Storage.Blob):
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("my-container");
New Code (Using Azure.Storage.Blobs):
BlobServiceClient blobServiceClient = new BlobServiceClient(connectionString);
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient("my-container");
- Test Thoroughly: Ensure all functionalities work as
expected after migration.
Key Considerations
- Authentication: The updated libraries support Azure
Identity for authentication. Consider migrating to Managed Identity or
Azure Active Directory for better security.
- Breaking Changes: Be aware that the updated libraries
have different APIs, so some refactoring will be necessary.
- Documentation: Refer to the official Azure Storage
documentation for detailed guidance.
Leave a Comment