【发布时间】:2020-06-01 23:53:11
【问题描述】:
我有一个托管在 (S1) 应用服务计划上的 azure 函数。 Azure 函数已集成到 VNet 子网。此子网启用了 Microsoft.Storage 和 Microsoft.Web 服务端点,并且它被委派给 Microsoft.Web/serverFarms
另一方面,存储帐户被配置为仅接受来自 azure 函数所属子网的请求。
不幸的是,这不起作用。当我尝试从 Azure 功能与存储帐户通信时,我收到以下错误
2020-02-18T02:03:03.505 [Error] Faliure Occured
Azure.RequestFailedException : This request is not authorized to perform this operation.
RequestId:0b034a99-701e-002c-09ff-e5bd0a000000
Time:2020-02-18T02:03:03.1177265Z
Status: 403 (This request is not authorized to perform this operation.)
ErrorCode: AuthorizationFailure
Headers:
Server: Microsoft-HTTPAPI/2.0
x-ms-request-id: 0b034a99-701e-002c-09ff-e5bd0a000000
x-ms-client-request-id: 0bbe8185-4657-47f3-8566-5bcbd16c4274
x-ms-error-code: AuthorizationFailure
Date: Tue, 18 Feb 2020 02:03:02 GMT
Content-Length: 246
Content-Type: application/xml
at Azure.Storage.Blobs.BlobRestClient.Container.GetPropertiesAsync_CreateResponse(ClientDiagnostics clientDiagnostics,Response response)
at async Azure.Storage.Blobs.BlobRestClient.Container.GetPropertiesAsync(ClientDiagnostics clientDiagnostics,HttpPipeline pipeline,Uri resourceUri,String version,Nullable`1 timeout,String leaseId,String requestId,Boolean async,String operationName,CancellationToken cancellationToken)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Azure.Storage.Blobs.BlobContainerClient.GetPropertiesInternal(BlobRequestConditions conditions,Boolean async,CancellationToken cancellationToken)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Azure.Storage.TaskExtensions.EnsureCompleted[T](Task`1 task)
at Azure.Storage.Blobs.BlobContainerClient.GetProperties(BlobRequestConditions conditions,CancellationToken cancellationToken)
at SharedLib.Utils.TestStorageAccountAccess() at D:\poc-code\NetworkSecurityPoc\SharedLib\Utils.cs : 13
at async MessengerFunction.Trigger.Run(HttpRequest req,ILogger log) at D:\poc-code\NetworkSecurityPoc\MessengerFunction\Trigger.cs : 25
但是当我禁用存储帐户的 vnet 限制时,一切正常。
我做错了什么?
谢谢。
【问题讨论】:
-
您是否需要使用区域虚拟网络集成或网关? Azure 函数应用是在 Windows 还是 Linux 上运行?
-
我正在使用区域虚拟网络集成(显示“预览”的那个)。并且函数应用在 Windows 上运行。实际上我的 Vnet 没有网关子网。
-
集成子网中除了azure功能外,不应使用其他资源。另外推荐使用this template自动部署。
-
如果取消选中子网中启用的
Microsoft.Web服务端点,是否有效? -
我已在当前设置中取消选中 Microsoft.Web,但它仍然无法正常工作。我也按原样部署了引用的模板,也没有工作
标签: azure azure-functions azure-storage vnet