Api management access table storage with managed identity getting 403?

Michel 20 Reputation points
2023-12-04T14:53:58.3566667+00:00

Hello,

In my inbound section i have a send-request policy to do a post to my table storage. Within the send-request i'am using:

<authentication-managed-identity resource="https://storage.azure.com/" />

I'am getting: "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.".

In the same api i also use managed-identity to access Azure Service Bus and that is working fine.

What can be the reason this fails with table storage or how can i proceed to get to the problem?

Best regards,

Michel

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
156 questions
Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,767 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.
944 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,557 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anand Prakash Yadav 6,005 Reputation points Microsoft Vendor
    2023-12-05T12:19:54.59+00:00

    Hello Michel,

    Thank you for posting your query here!

    To call Azure Table Storage from Azure API Management using Managed Identity, enable the system-assigned identity for your API Management instance.

    Under "Access control (IAM)," assign the Managed Identity associated with your API Management instance a role with sufficient permissions, such as "Storage Table Data Contributor."

    Then in the API Management API configure the inbound policy.

    Please note that we need to specify x-ms-version in the request header and its value should be 2017-11-09 or higher.

    You may try to add this to your inbound policy:

    <set-header name="x-ms-version" exists-action="override">
        <value>@{string version = "2017-11-09"; return version;}</value>
    </set-header>
    

    Here is a post on similar query that might help: https://stackoverflow.com/questions/75327677/unauthorized-access-to-storages-table-using-api-management

    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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful