Azure File Share Upload file 403 Error

Nicole G 15 Reputation points
2024-10-16T11:09:51.73+00:00

Hello, I have an azure file share and want wo upload files to it via a powershell in a runbook. I have a managed identity of this automation with storage blob data contributor and storage file data smb share contributor access on the file share. When I Start the runbook I always got 403 error. But when I enable Public Network access, it works. But I need to ensure enabled from selected virtualisierung Networks and IP Adresses. Can someone please help?

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,301 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,256 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Keshavulu Dasari 1,065 Reputation points Microsoft Vendor
    2024-10-17T11:48:51.0066667+00:00

    Hi Nicole G,
    Yes, you need to ensure that Managed Identity has the correct permissions configured in Azure. The basics to follow.
    1. Assign roles to the managed identity: Login to the Azure portal, navigate to the resource (e.g., storage account) for which you want managed access, select Access control (IAM) from the left-hand menu, and click Add role assignment, Select the appropriate role (e.g., Storage Blob Data Contributor, Storage File Data SMB Share Contributor) and assign it to Managed Identity.
    https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal-managed-identity
    2. Verify the assignments: ensure that the required role is assigned to the appropriate location (e.g. member, object group, or specific object) of the managed identity. You can check this under the Role assignments section of the Identity tab of the managed identity

    3. Network Configuration: Ensure that the network settings allow access to the IP address or virtual network where your runbook is running. The sources of the sources. For a level of security, consider using Azure Virtual Network service endpoints or private endpoints to connect to your storage account. This ensures that traffic is delivered properly within the Azure network.

    By following these, you can set up a managed identity with the necessary permissions to avoid 403 errors and allow network access.

    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.

    0 comments No comments

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.