Upgrade classic Azure Storage to new ARM code-wise for .Net Web Application

Merrick Fonnesbeck 25 Reputation points
2024-08-09T19:12:22.9933333+00:00

I received an email recently stating that we needed to move our classic storage accounts to Azure resource manager by the end of the month. I've looked a bit into this and moving the accounts doesn't seem to be a big problem. It's the code that we use to access and work with blobs in those accounts that I am concerned with.

We have a .Net Framework 4.7.2 web application using MVC that accesses and gets blob information , blobs within a directory, creates new blobs, deletes blobs, and renames blobs using Microsoft.WindowsAzure.Storage SDK library 8.2.1.0. I cannot seem to find definitive information on the path moving forward to upgrade these libraries and how to work with the new structures in Azure. I need some guidance please.

I found a reference to Microsoft Azure Resource Manager client library for .NET, which uses a tenant Id, client and secret ids to connect to the Azure containers, which is completely difference from what we use now. Making me question what we need to really do. Currently we use a connection string in our configuration files that contains the endpoints protocol, account name, and account key.

Please guide me and pass along the documentation and resources that might aid us in this conversion. Thank you.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,916 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Nehruji R 8,066 Reputation points Microsoft Vendor
    2024-08-12T13:54:49.81+00:00

    Hello Merrick Fonnesbeck,

    Greetings! Welcome to Microsoft Q&A Platform.

     

    Migrating from Azure Classic Storage to Azure Resource Manager (ARM) has to make changes like not only moving your storage accounts but also updating your code to use newer SDKs and authentication methods.

     

    On August 31, 2024, we'll retire classic Azure storage accounts and they'll no longer be accessible. Before that date, you must migrate your storage accounts to Azure Resource Manager.

     

    If your Cloud Service is only using the older Microsoft.WindowsAzure.Storage.Blob library to upload/download files and is not dynamically creating, updating, or deleting storage accounts, then you should be able to continue using the library after the migration cut-off date of August 31st.

    However, it is still recommended to update your applications to use Azure Resource Manager APIs for account management, as this will ensure that your applications are using the latest and most secure APIs for managing storage accounts.

    If you do decide to update your applications to use Azure Resource Manager APIs, you can follow the guidance provided in the documentation to make the necessary changes to your code, scripts, or templates. This will involve updating your code to use the latest Azure Storage SDK, which supports both classic and ARM storage accounts.

    If you choose not to update your applications to use Azure Resource Manager APIs, you should still be able to continue using the older Microsoft.WindowsAzure.Storage.Blob library to upload/download files, but you may not be able to take advantage of the latest features and security enhancements provided by Azure Storage.

     

    Next you need to replace the Microsoft.WindowsAzure.Storage SDK with the latest Azure SDKs. The old Microsoft.WindowsAzure.Storage namespace is replaced with Azure.Storage.Blobs once updated. The NuGet package is Azure.Storage.Blobs.https://learn.microsoft.com/en-us/dotnet/api/overview/azure/storage.blobs-readme?view=azure-dotnet.

     

    You can use the connection string containing the account name, key, and endpoints to access Azure Storage, works well for basic scenarios but comes with security risks, especially if the connection string is compromised. If it required, you can use the Azure Active Directory (AAD) for authentication. By using AAD, you get control over who and what can access your resources. Access can be managed through role-based access control (RBAC), and credentials are handled more securely. With AAD, you can assign specific roles to users, groups like read-only access, contributor access.

     

    A similar issue is discussed in the Answer section of the following SO thread: https://stackoverflow.com/questions/64185751/how-to-replace-microsoft-windowsazure-storage-with-microsoft-azure-storage-blob, https://stackoverflow.com/questions/66521400/azure-migrating-classic-storage-account-to-arm.

     

    Similar post: https://learn.microsoft.com/en-us/answers/questions/1458544/migrating-storage-account-classic-to-arm.

     

    Here is the doc for your reference: https://learn.microsoft.com/en-us/azure/storage/common/classic-account-migration-overview, https://learn.microsoft.com/en-us/azure/storage/common/classic-account-migrate?tabs=azure-portal

     

    Hope this answer helps! please let us know if you have any further queries. I’m happy to assist you further.

    Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.