Attempting to add Storage Account to Batch Account using managed identity fails with 'InvalidAutoStorageAuthenticateMode' error?

Samuel Taylor-Hansen 0 Reputation points
2024-05-02T14:46:43.3966667+00:00

We've got an Azure Batch account we'd like to setup with an existing storage account. We want to use managed identity to handle authentication. The storage account in question is within the same subscription and we have a user managed identity which handles access.

However when attempting to add the storage account it fails to save. The error in question, from the activity logs is:

"statusMessage": "{\"error\":{\"code\":\"InvalidAutoStorageAuthenticateMode\",\"target\":\"BatchAccount\",\"message\":\"Storage account authentication mode is invalid\\nRequestId:xxxxd\\nTime:2024-05-02T14:08:36.0974665Z\"}}",

I can't find any reference to this error code anywhere in the documentation or actually anywhere on the internet whatoever.

Is anyone able to help shed some light on this?

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,234 questions
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,017 questions
Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
339 questions
Azure Startups
Azure Startups
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Startups: Companies that are in their initial stages of business and typically developing a business model and seeking financing.
397 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Nehruji R 8,146 Reputation points Microsoft Vendor
    2024-05-03T06:58:13.3733333+00:00

    Hello Samuel Taylor-Hansen,

    Greetings! Welcome to Microsoft Q&A Platform.

    The error InvalidAutoStorageAuthenticateMode typically indicates a problem with the authentication mode being used when attempting to link a storage account to an Azure Batch account using a managed identity. While this specific error code isn’t directly referenced in the Azure documentation, it falls under the category of 4xx errors which typically indicate that a resource isn’t in the correct state for the requested operation which is updated in this doc - https://learn.microsoft.com/en-us/azure/batch/error-handling#error-codes.

    Ensure that the user-managed identity has the correct role assignments to access the storage account. It should have at least “Storage Blob Data Contributor” role and you have followed steps over this reference article - https://learn.microsoft.com/en-us/troubleshoot/azure/hpc/batch/use-managed-identities-azure-batch-account-pool#use-a-managed-identity-to-access-your-autostorage-account.

    Verify that the authentication mode set for the storage account is compatible with Azure Batch. Azure Batch supports using Azure AD-based authentication with managed identities for accessing Azure Storage accounts. When setting up your storage account to use with your batch account, you need to link the storage account to your batch account and set the autostorage account to use the batch account managed identities as its authentication mode refer - https://learn.microsoft.com/en-us/rest/api/batchservice/authenticate-requests-to-the-azure-batch-service

    Please refer this Azure Batch setup with storage account documentation - https://techcommunity.microsoft.com/t5/azure-paas-blog/the-usage-of-managed-identity-in-the-azure-batch-account-and/ba-p/3607014 which can provide more detailed guidance specific to your setup and the error you’re facing.

    Hope this 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.


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.