Queues working with Azure Storage (Classic) but not with modern - azure

Doing some work with Azure and queues, and I can get it to work with a classic storage account, but not the standard (newer) storage account.
"Modern" Azure storage account
Classic Storage Account
If I run this code against each of them...:
CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
var documentProcessQueue = queueClient.GetQueueReference("documentprocessrequest");
documentProcessQueue.CreateIfNotExists();
...It works for Classic, but with "modern" I get this error:
An unhandled exception of type
'Microsoft.WindowsAzure.Storage.StorageException' occurred in
Microsoft.WindowsAzure.Storage.dll
Additional information: The remote name could not be resolved:
'xxxxxxdocstest.queue.core.windows.net'
What am I missing? Am I doing something wrong, or does queues simply not work with "moderns" storage accounts (sounds unlikely)?
I am using the latest version of the Azure SDK. I have tested the connectionstrings to the storage accounts with other things, like uploading a blog, and they do work.
EDIT:
I created a "modern" Azure Storage account like the below screenshot (and tested with this one, same error) - and I changed the first image to reflect this account.

Basically you're getting this error is because you created a Blob Storage kind of storage account which only supports blobs. Please see this link to learn more about account kinds: https://azure.microsoft.com/en-in/documentation/articles/storage-create-storage-account/.
At this moment, it is not possible to convert this account into a regular (standard) storage account. Thus you would need to create a new storage account and transfer any blobs that you may have in this account to a newer account.
When you create the new storage account, please ensure that the redundancy type of that account is not ZRS or Premium LRS as storage accounts with these redundancy type only support blobs again.

Related

Blob storage compatibility with Azure Functions

I have some e-mail attachments being saved to Azure Blob.
I am now trying to write a Azure Functions App that would connect to that blob storage, run some scripts and re-save the file.
However, when selecting a storage account for the function, I couldn't select my blob storage account.
I went on the website and it said this:
When creating a function app, you must create or link to a general-purpose Azure Storage account that supports Blob, Queue, and Table storage. Some storage accounts don't support queues and tables. These accounts include blob-only storage accounts and Azure Premium Storage.
I'm wondering, is there any workaround this? and if not, perhaps any other suggestions? I'm becoming a little lost in all the options, and which one to actually choose.
Thanks!
EDIT: Might I add I writing the function Python
I think you are overlooking the fact that you can have multiple storage accounts. In order for an Azure Function to work you need a storage account. That storage account is used to store runtime information of the Azure Function for internal purposes like state management. This storage account is subject to restrictions as you already found out. There is no workaround for that.
However, if the function you are writing needs to access another storage account it is free to do so. You just have to provide details to connect to that specific storage account. In that case you also have a clear seperation between the storage account that is used by the azure function for its internal operations and the storage account your application needs to connect and which you have total control about withouth having to worry that you break things by deleting internal used blobs/tables/queues.
You can have a blob triggered function that gets triggered when changes occur on your specific blob storage. That doesn't need to be the storage account that the azure function internally uses, which is created/selected when creating the azure function.
Here is a sample that shows how to add a blob triggered azure function in Python. MyStorageAccountAppSetting refers to an app setting that holds the connection string to the storage account that you use for storage.
The snippet from the website you are quoting is for storing the function app code itself and any related modules. It does not pertain to what your function can access when the code of your function executes.
When your function executes it will need to use the Azure Blob Storage SDK/modules to connect to your blob storage account and read the email attachments. Here's a quickstart guide for using Azure Storage with Python: Quickstart with Azure Storage Blobs SDK for Python
General-purpose v2 storage accounts support the latest Azure Storage features and incorporate all of the functionality of general-purpose v1 and Blob storage accounts here
There are more integration options with GPv2 accounts including Azure Function Triggers. See: Azure Blob storage bindings for Azure Functions
Further refer: Types of storage accounts
If Blob, based on your need, you can choose an access tier based on the frequency of access for the data (e-mail attachments)Access tiers for Azure Blob Storage - hot, cool, and archive. If General purpose storage account, its standard performance tier.

What kind of Azure Storage Account did I create?

I created a new Storage account in the Azure portal and choosed an existing Resource Group. It did not create a classic storage account but some kind of resource group-ish storage account that doesn´t have all the options a classic storage account has.
As an example, I could create the "files" folder through code, but I can´t use the code: "blockBlob.UploadFromStream(fileStream);", it gives me error 400 bad request. The same code works when I upload to a classic storage account.
What kind of storage account is seen in my image? Which is more correct, to create a classic storage account (blue icon in image) or the one I did (green/white/grey icon in image)?
First, I would suggest you have a look at David's reply in this thread to know the difference between new Azure storage account and classic Azure storage account.
it gives me error 400 bad request.
There are a lot of issues to caused 400 error. I would suggest your check your code to find out detailed issues. Please test use your code to create container (container name must meet the limitations) to see whether it will work. It is better if you could provide key code.
You created an Azure Resource Manager storage account of type Premium storage in region "North Europe" within your given resource group.
There is not really a right or wrong. As almost always it depends on your use-case.
I want to suggest these docs and samples for getting started with code addressing block blobs and Azure storage in general. Run and explore this code against the storage emulator and/or live storage accounts (classic/ARM standard/ARM premium). May be this helps finding a bug or a misconfiguration in your project.
Azure Blob Storage Samples for .NET
Azure Storage Samples
The issue here has nothing to do with Classic vs Resource Manager. It's related to the fact that the storage account is of type "Premium."
Premium storage accounts are exclusively used for Azure disks (attached durable storage), which are Page Blobs.
Premium storage doesn't support generic blobs/tables/queues. For that, you'd need a non-premium storage account.

Azure Cloud Service(classic) does not autoscale with new Storage Account

I deployed WorkerRole to Azure Cloud Service (classic) in new portal. With this, I also created Azure Storage account for queue.
Try to add AutoScale rule, the storage account is not listed. Tried to select Other Resource and put Resource Identifier of storage, there's no Metric name listed.
Is it by design that classic Cloud Service and new Storage account not working together?
Storage account data (e.g. blobs, queues, containers, tables) are accessible simply with account name + key. Any app can work with them.
However, to manage/enumerate available storage accounts, there are Classic-created and ARM-created accounts, each with different API's.
The original Azure Service Management (ASM) API doesn't know anything about ARM resources. There's a fairly good chance that, since you're deploying to a Classic cloud service, it's using ASM only and will not be able to enumerate ARM-created storage accounts.
If you create a Classic storage account (which has zero difference in functionality), you should be able to see it as an option for auto-scale.
I have a bit more details on the differences in this answer.
At this time, it is not possible to autoscale anything based on a new "v2" storage account. It has nothing to do with the fact that you are using the classic Azure Cloud Service. I am having the same issue with using Azure App Services. In the end, I just created a classic storage account to use for the autoscaling. There is no difference in how you interact with the different types of storage accounts.

Azure Storage account consistently only adding Blob storage, missing Table/Queue/Files

Whenever I create a new Storage (classic) account through the Azure portal I consistently have issues whereby the Table/Queue/File storage is not created at all, leaving the account with only Blob storage, like this:
Instead of like this (separate account):
I have tried this multiple times and all have had the same result. I don't see how I can be getting this wrong as there is only 4 options on the form to create the account, and none of them govern the content of the account.
When I then attempt to create a new Table or Queue in this new account I get a 502 Bad Gateway error.
Am I missing something here? Can anyone tell me how I can add the required storage types to the account.
Not sure what's up with the portal, but a storage account always comprises blob, table, queue, and file storage (unless you create a Premium storage account - that's strictly blobs).
You should be able to confirm this by creating an app to, say, create, write, and read from a queue or table.
EDIT I see you edited your question, showing that you did try to create a table/queue. If this is a non-premium account, I suggest reaching out to support, as this makes no sense.
EDIT 4/2017 Aside from Premium storage accounts (which only have page blobs), there is another type of general (non-premium) storage account, specific to blobs only, where you won't be able to create Tables and Queues, but it's not available via the "Classic" deployment model; it's available only via "Resource Manager" deployment model:
In my case the issue was due to selecting Zone Redundant Storage (ZRS).
Since ZRS accounts only support Block Blobs, you will not see the
table, queue or file endpoints listed on the portal for the new
account.
https://blogs.msdn.microsoft.com/windowsazurestorage/2014/08/01/introducing-zone-redundant-storage/
Recreating the storage account using Globaly Redundant Storage (GRS) worked.

Perform Azure Storage operations from VHD within same Storage account

When working with a VHD hosted within an Azure Storage account, are there any operations one can perform to access the Storage account directly?
I.e. I create a VM and store it's VHD in a blob in account A, are there any local/efficient ways to work with data in account A from the VM?
See if Azure Storage Files service will work for you. You may attach your storage as a file share and communicate with that directly using traditional APIs.
Apart of that, you may use cross-platform Azure Storage Explorer for communicating with other Storage subservices like Blobs.

Resources