@Bhuvaneshwari Balasubramaniam Firstly, Apologies for the delay response!
Welcome to Microsoft Q&A Forum, Thank you for posting your query here!
Yes, the Microsoft.Azure.Management.Fluent
package is deprecated. You can use the Azure.Identity
package to authenticate and authorize access to Azure resources. Here is an example code snippet to authenticate and authorize access to Azure resources using the Azure.Identity
package:
using Azure.Identity;
using Azure.Storage.Blobs;
using System;
string storageAccountName = "<your-storage-account-name>";
string tenantId = "<your-tenant-id>";
string clientId = "<your-client-id>";
string clientSecret = "<your-client-secret>";
var credential = new ClientSecretCredential(tenantId, clientId, clientSecret);
var blobServiceClient = new BlobServiceClient(new Uri($"https://{storageAccountName}.blob.core.windows.net"), credential);
var keys = blobServiceClient.Account.GetAccountInfo().Keys;
foreach (var key in keys)
{
Console.WriteLine(key.Value);
}using Azure.Identity; using Azure.Security.KeyVault.Secrets; using Azure.Storage.Blobs;
In this example, we are using the DefaultAzureCredential
class to authenticate and authorize access to Azure resources. The SecretClient
class is used to retrieve the storage account key from the Azure Key Vault. Finally, we are using the BlobServiceClient
class to interact with the storage account.
Additional information: Manage storage account access keys
If you get any error message or code, please share the screenshot. Please let us know if you have any further queries. I’m happy to assist you further. Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.