Azure 前门和自定义域

Azure Front Door and custom domain

我正在尝试使用 Azure Front Door Premium 配置自定义域,因为它是唯一允许我拥有自定义域的域。

主要问题是证书。我有自己的 SSL 证书。 Azure Front Door Premium 仅允许 select 来自 Azure Key Vault 的 SSL 证书。所以,我创建了一个并添加了证书。美好的。当我尝试使用此屏幕添加新域时

我可以 select 列表中的一个 Secret。要添加证书,现在我必须从 Azure Key Vault 在 Azure Front Door 中添加一个秘密。因此,我打开 Secret I select 证书并单击添加。

不幸的是,我得到一个错误

Failed to create the secret 'azuksch-CelloSSL-latest'. Error: We don't have permission to access this secret. Go to "Access policies" in your Key Vault account to give Microsoft.AzureFrontDoor-Cdn permission to get secrets.

Microsoft documentation 之后,我必须使用此命令将 Azure Front Door 添加到我的 Azure Active Directory

az ad sp create --id ad0e1c7e-6d38-4ba4-9efd-0bc77ba9f037 --role Contributor

但是命令不起作用。我必须删除命令的最后一部分,因为无法识别 role

所以,我运行

az ad sp create --id ad0e1c7e-6d38-4ba4-9efd-0bc77ba9f037

但是当我尝试在 Azure Front Door 中添加机密时,我遇到了同样的问题。我用谷歌搜索了一下,发现我必须 运行 Azure Front Door Premium

的另一个命令
az ad sp create --id 205478c0-bd83-4e1b-a9d6-db63a3e1e1c8

和 select 编辑了所有三个下拉列表的所有选项。现在,我有很多访问策略

结果:我总是得到同样的错误

Failed to create the secret 'azuksch-CelloSSL-latest'. Error: We don't have permission to access this secret. Go to "Access policies" in your Key Vault account to give Microsoft.AzureFrontDoor-Cdn permission to get secrets.

我可以修好吗?

您最初使用 ID ad0e1c7e-6d38-4ba4-9efd-0bc77ba9f037 创建的服务主体适用于 Azure Front Door 而不是 Azure Front Door Premium。

因此,它不会为 Microsoft 授予权限。AzureFrontDoor-Cdn. 您正在关注的文档也是与 Azure Front Door 相关,而不是 Azure Front Door Premium .

如本文所述Microsoft Doc

Registering service principal for Azure Front Door can only done once per tenant.

因此,即使您使用此 ID 205478c0-bd83-4e1b-a9d6-db63a3e1e1c8 再次创建服务主体,据我所知,它也不会起作用。尝试删除您使用 id ad0e1c7e-6d38-4ba4-9efd-0bc77ba9f037

创建的第一个服务主体

此外,请查看来自 Microsoft Doc 的以下注释:

Azure Front Door Standard/Premium (Preview) is currently in public preview. This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities. 

由于仍处于预览阶段,部分功能将无法使用。因此,对于解决方法,您可以使用 Azure Front Door。要了解如何使用 Azure Front Door 添加自定义域,请阅读此 reference(如果有帮助)。