我们如何使用 python 从 azure 函数连接 aws 转录

How can we connect aws transcribe from azure functions using python

通过 AWS lambda,我们曾经使用

与 aws transcribe 连接
transcribe = boto3.client('transcribe')

有没有什么方法可以使用 python 从 azure 函数调用 aws transcribe?

您需要在您使用的部署包中包含 Boto 3 SDK。您将没有可用的 IAM 角色,因此您将仅限于 IAM 用户(密钥和机密)。

在此文件中有一个 requirements.txt in the root of the structure 包含 boto3 以及使用以下格式的版本

boto3==1.14.20

有几种方法可以做到这一点。显而易见的是使用 IAM 用户 如果他们可以访问 Internet,则可以在您的 Azure 函数上调用 transcribe 的凭据。

当您使用 lambda 时,您通过附加到 lambda 的 IAM 执行角色 提供访问 transcribe 的权限。如果您从 AWS 外部执行此操作,则必须使用 IAM 用户访问密钥。这意味着您可以创建一个具有 足够权限 的 IAM 用户,以便根据需要使用 transcribe

azure 函数将使用 boto3 与 AWS 交互 transcribe。您必须使用 IAM 用户访问密钥设置 boto3。