azure-functions-host icon indicating copy to clipboard operation
azure-functions-host copied to clipboard

System managed Identity for "AzureWebJobsStorage__accountName" not working as expected. Throwing permission error

Open eddynaka opened this issue 10 months ago • 7 comments

Hello,

I'm trying to change the azure function v4 using C#/.NET 6 to use managed identity to connect into the AzureWebJobsStorage. Following this guideline: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference?tabs=blob&pivots=programming-language-csharp#connecting-to-host-storage-with-an-identity, I added/updated the identity permissions and, then, I'm disabling the keys from the azure storage to test that it is really using MSI.

When I disable it, it shows the following error: image

When I click in details, no data is shown.

Can you help me?

eddynaka avatar Apr 22 '24 15:04 eddynaka

I assume you are using Consumption plan for your Function. If so, you need Azure File Share, which is configured with WEBSITE_CONTENTAZUREFILECONNECTIONSTRING. However, File Share does not support managed identities and you cannot disable keys on storage account:

https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings#website_contentazurefileconnectionstring

This setting is required for Consumption and Elastic Premium plan apps running on both Windows and Linux. It's not required for Dedicated plan apps, which aren't dynamically scaled by Functions.

Changing or removing this setting can cause your function app to not start. To learn more, see this troubleshooting article.

Azure Files doesn't support using managed identity when accessing the file share. For more information, see Azure Files supported authentication scenarios.

ltdu avatar Apr 23 '24 08:04 ltdu

Thanks for reporting.please check you dedicated plan then it should support or not. as per doc.

bhagyshricompany avatar Apr 23 '24 13:04 bhagyshricompany

Hello @ltdu @bhagyshricompany ,

How do I confirm what plan do I use? I created the resource some time ago and I'm not sure about it.

Also, if I'm using Consumption plan, will be support in the future for Azure File Share using MSI?

eddynaka avatar Apr 23 '24 14:04 eddynaka

@bhagyshricompany when will this be fixed?

watfordsuzy avatar May 15 '24 14:05 watfordsuzy

@ltdu @bhagyshricompany How about premium plan Azure function?

zenmiao7 avatar May 17 '24 07:05 zenmiao7

please open it on azure portal this issue.

bhagyshricompany avatar May 21 '24 16:05 bhagyshricompany

@fabiocav please comment and validate.

bhagyshricompany avatar Jun 25 '24 08:06 bhagyshricompany