0
votes

I have an ASP.NET MVC application that connects to Azure blob storage; locally everything is fine and I can connect to blob storage and access my containers and list blobs, but once deployed I get this error:

Azure.RequestFailedException: The remote name could not be resolved: 'MyAccountName.blob.core.windows.net'

Does anyone have an idea how to solve this error?
Here is the container code for connecting to the Azure Blob

    public ActionResult QuickPhotos()
    {
        string storageConnectionString = ConfigurationManager.ConnectionStrings["AZURE_STORAGE_CONNECTIONSTRING"].ConnectionString;
        string containerName = "infoimages";
        BlobContainerClient blobContainerClient = new BlobContainerClient(storageConnectionString, containerName);
        List<string> Images = new List<string>();
        foreach (BlobItem item in blobContainerClient.GetBlobs())
        {
            Images.Add("https://azureblob.interstellarseries.com/" + containerName +"/"+item.Name);
        }
        return View(Images);
    }
1
Could you share your code about connecting to blob storage?Pamela Peng
@PamelaPeng Updated Question with the code, sorry for the late replyMahmed Amer

1 Answers

0
votes

It looks like you have wrong account name in connection string,

you should have:AccountName=Your Account Name,

instead of: AccountName=Your Account name.blob.core.windows.net

For more details check with this link