Thursday, December 19, 2024
Migrate from Deprecated Libraries to Azure.Storage.Blobs Before March 2025 in Dynamics 365 FO
Posted by
In the Finance and Operations (FO) platform, several libraries related to Azure Blob Storage are currently in use. Microsoft has announced the deprecation and replacement of these libraries with the Azure.Storage.Blobs library to improve platform security and eliminate dependencies on outdated NuGet packages.
The libraries impacted include:
- WindowsAzure.Storage (v9.3.3)
- Microsoft.WindowsAzure.StorageClient.dll (v6.0.6002.18488)
- Microsoft.WindowsAzure.Storage.dll (v9.3.2.0)
- Microsoft.Azure.Storage.Common.dll (v11.xx)
- Microsoft.Azure.Storage.Blob.dll (v11.2.3)
The change aligns with Microsoft's latest platform updates and policies regarding deprecated libraries.
Reason for Deprecation
Microsoft aims to:
- Improve security and streamline storage account access.
- Remove dependencies on outdated packages listed above.
You can read the official announcement Migration from deprecated libraries.
Migration Timeline
Phase 1: Release and Feedback (October 2024–November 2024)
- New libraries will be available for testing. Users can provide feedback during this phase.
Phase 2: Deprecation Timeline (March 2025)
- The older libraries must be replaced before release 10.0.43 (PU67).
Phase 3: Stop Shipping Old Libraries (June 2025)
- With release 10.0.44 (PU68), the old libraries will no longer be shipped.
Migration Steps
1. Identify Existing Library Usage
Review your customizations and their dependencies to identify references to the impacted libraries. This includes checking AOT > References and any custom logic that may rely on the deprecated libraries:
WindowsAzure.Storage
Microsoft.WindowsAzure.StorageClient
Microsoft.WindowsAzure.Storage
Microsoft.Azure.Storage.Common
Microsoft.Azure.Storage.Blob
2. Replace the Deprecated Library
Switch to the following updated libraries:
- Azure.Storage.Blobs
- Azure.Storage.Common
These new libraries provide better security, performance, and a modern API for blob storage.
3. Update Code for Compatibility
Replace existing code with new SDK methods. Below is an example snippet for uploading and downloading files using the Azure.Storage.Blobs library:
Example: Uploading a Blob
using Azure.Storage.Blobs;
public static void uploadBlob()
{
str connectionString = "<connection_string>";
str containerName = "sample-container";
str blobName = "sample-file";
str filePath = @"C:\temp\sample-file.txt";
CLRObject containerMetadata = new System.Collections.Generic.Dictionary<str, str>();
try
{
// Get a reference to a container and create it
BlobContainerClient containerClient = new BlobContainerClient(connectionString, containerName);
containerClient.Create(
Azure.Storage.Blobs.Models.PublicAccessType::None,
containerMetadata,
null,
System.Threading.CancellationToken::None);
// Get a reference to a blob in a container
BlobClient blobClient = containerClient.GetBlobClient(blobName);
// Upload local file
blobClient.Upload(filePath);
info(strFmt("File '%1' successfully uploaded to container '%2'.", blobName, containerName));
}
catch (Exception::CLRError)
{
// Handle CLRError
error("An error occurred during the blob upload process.");
}
}
Example: Downloading a Blob
using Azure.Storage.Blobs;
public static void downloadBlob()
{
str connectionString = "<connection_string>";
str containerName = "sample-container";
str blobName = "sample-file";
str downloadPath = @"C:\temp\sample-download.txt";
try
{
// Get a reference to a container
BlobContainerClient containerClient = new BlobContainerClient(connectionString, containerName);
// Get a reference to a blob
BlobClient blobClient = containerClient.GetBlobClient(blobName);
// Download the blob's contents and save it to a file
blobClient.DownloadTo(downloadPath);
info(strFmt("File '%1' downloaded successfully to '%2'.", blobName, downloadPath));
}
catch (Exception::CLRError)
{
// Handle CLRError
error("An error occurred during the blob download process.");
}
}
For more detailed examples, refer to Azure Storage SDK samples.
Impact on Finance and Operations Apps
The migration will affect:
- Custom solutions leveraging blob storage integrations.
- ISVs and customers maintaining legacy implementations using any of the deprecated libraries listed earlier.
What to Do Next?
-
Review your references and locate dependencies on the deprecated libraries. Identify references by reviewing AOT > References or custom code that relies on these libraries.
-
Replace and test the code with the new libraries (
Azure.Storage.Blobs
). -
Prepare for release 10.0.43 (PU67) in March 2025, as support for the old package will end.
Final Notes
This migration is a necessary step to maintain compatibility with Microsoft's evolving platform standards. Transitioning to the Azure.Storage.Blobs library will:
- Improve security for Finance and Operations applications.
- Offer compatibility with the latest APIs that are actively maintained and designed for improved efficiency.
While these changes may not directly impact end users, they ensure that file storage integrations continue to function reliably and securely. Refer to the service updates schedule for the timeline of upcoming updates.
Feel free to connect with me on LinkedIn.