azure 功能(消费计划)如何访问已锁定公共互联网访问的存储帐户?

问题描述 投票:0回答:1

用例

我在 Windows 操作系统上有一个 Azure 函数,运行 PowerShell 脚本,将敏感 JSON 文件导出到存储帐户。对于生产,我想将此存储帐户的访问权限锁定到用户列表或 IP 地址。

问题

当我禁用对存储帐户的所有公共互联网访问时,Azure 功能无法写入存储帐户:

尽管它具有存储帐户的连接字符串,配置为函数中的环境变量和系统分配的标识,分配为存储帐户的贡献者。

我有什么想法可以通过消费计划 Azure Functions 来实现这一目标吗?另外,也可以代替IP地址。是否可以仅允许基于Azure用户帐户访问存储帐户?

azure powershell networking azure-functions azure-storage-account
1个回答
0
投票

我同意@Thomas 和@Donny Kwitty

V-NET Integration
在基于 Azure Functions 消耗的计划中是不可能的,仅在 Azure Functions Premium 计划和应用程序服务计划中受支持。

我创建了一个

Azure Function App with Premium tier.

创建了一个 VNET,将其添加到存储网络选项卡和 Azure Functions 选项卡中,如下所示:-

Azure 存储网络:-

enter image description here

Azure 函数

Vnet-Integration
:-

enter image description here

enter image description here

在我的虚拟网络中,我添加了

Microsoft.Storage
的服务端点来连接到我的存储帐户:-

enter image description here

如果您不想将 Function 应用程序和存储放入 VNET 中,您也可以通过 Azure RBAC 访问您的存储帐户,为您的用户提供 Azure 存储帐户读取器、或 Azure 存储 blob 数据贡献者角色或使用 Azure存储 SAS 令牌,具有嵌入到函数代码中或保存在 Azure Functions 配置设置或 Key Vault 中的特定权限。

© www.soinside.com 2019 - 2024. All rights reserved.