gpt4 book ai didi

azure - 通过 ARM 模板部署在 Azure Front Door 自定义域上启用 HTTPS

转载 作者:行者123 更新时间:2023-12-03 13:34:16 33 4
gpt4 key购买 nike

我正在通过 ARM 模板部署 Azure 前门,并尝试在自定义域上启用 HTTPS。

根据Azure documentation for Front Door ,有一个quick start template “将自定义域添加到您的 Front Door,并使用通过 DigiCert 生成的 Front Door 托管证书为其启用 HTTPS 流量。”但是,虽然这添加了自定义域,但它不启用 HTTPS。

查看ARM template reference for Front Door ,我看不到任何明显的方法来启用 HTTPS,但也许我错过了一些东西?

尽管有下面的附加信息,我还是希望能够通过 ARM 模板部署在 Front Door 自定义域上启用 HTTPS。现在可以吗?

其他信息

请注意,有一个 REST operation to enable HTTPS ,但这似乎不适用于 Front Door 管理的证书 -

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/enableHttps?api-version=2019-05-01
{
"certificateSource": "FrontDoor",
"protocolType": "ServerNameIndication",
"minimumTLSVersion": "1.2"
}

还有一个Az PowerShell cmdlet to enable HTTP ,这确实有效。

Enable-AzFrontDoorCustomDomainHttps -ResourceGroupName "lmk-bvt-accounts-front-door" -FrontDoorName "my-front-door" -FrontendEndpointName "my-front-door-rg"

最佳答案

UPDATE: This implementation currently seems to be unstable and is working only intermittently, which indicates it may not be production ready yet.

在跟踪最新的 Front Door API (2020-01-01) 规范(该规范似乎并未在 MS 中完全发布)后,现在实际上似乎可以通过 ARM 模板实现这一点引用网站尚未):

https://github.com/Azure/azure-rest-api-specs/tree/master/specification/frontdoor/resource-manager/Microsoft.Network/stable/2020-01-01

frontendEndpoint properties 对象中有一个新的 customHttpsConfiguration 属性:

"customHttpsConfiguration": {
"certificateSource": "AzureKeyVault" // or "FrontDoor",
"minimumTlsVersion":"1.2",
"protocolType": "ServerNameIndication",

// Depending on "certificateSource" you supply either:
"keyVaultCertificateSourceParameters": {
"secretName": "<secret name>",
"secretVersion": "<secret version>",
"vault": {
"id": "<keyVault ResourceID>"
}
}

// Or:
"frontDoorCertificateSourceParameters": {
"certificateType": "Dedicated"
}
}

KeyVault 托管 SSL 证书示例

Note: I have tested this and appears to work.

    {
"type": "Microsoft.Network/frontdoors",
"apiVersion": "2020-01-01",
"properties": {
"frontendEndpoints": [
{
"name": "[variables('frontendEndpointName')]",
"properties": {
"hostName": "[variables('customDomain')]",
"sessionAffinityEnabledState": "Enabled",
"sessionAffinityTtlSeconds": 0,
"webApplicationFirewallPolicyLink": {
"id": "[variables('wafPolicyResourceId')]"
},
"resourceState": "Enabled",
"customHttpsConfiguration": {
"certificateSource": "AzureKeyVault",
"minimumTlsVersion":"1.2",
"protocolType": "ServerNameIndication",
"keyVaultCertificateSourceParameters": {
"secretName": "[parameters('certKeyVaultSecret')]",
"secretVersion": "[parameters('certKeyVaultSecretVersion')]",
"vault": {
"id": "[resourceId(parameters('certKeyVaultResourceGroupName'),'Microsoft.KeyVault/vaults',parameters('certKeyVaultName'))]"
}
}
}
}
}
],
...
}
}

前门托管 SSL 证书示例

看起来您需要设置 FrontDoor 托管证书:

Note: I have not tested this

    {
"type": "Microsoft.Network/frontdoors",
"apiVersion": "2020-01-01",
"properties": {
"frontendEndpoints": [
{
"name": "[variables('frontendEndpointName')]",
"properties": {
"hostName": "[variables('customDomain')]",
"sessionAffinityEnabledState": "Enabled",
"sessionAffinityTtlSeconds": 0,
"webApplicationFirewallPolicyLink": {
"id": "[variables('wafPolicyResourceId')]"
},
"resourceState": "Enabled",
"customHttpsConfiguration": {
"certificateSource": "FrontDoor",
"minimumTlsVersion":"1.2",
"protocolType": "ServerNameIndication",
"frontDoorCertificateSourceParameters": {
"certificateType": "Dedicated"
}
}
}
}
],
...
}
}

关于azure - 通过 ARM 模板部署在 Azure Front Door 自定义域上启用 HTTPS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58180861/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com