azure - AADLoginForWindows 的 Terraform Azure VM 扩展类型和 type_handler_version 参数值
问题描述
我正在尝试使用 terraform azurerm 提供程序的 1.21.0 版将 AADLoginForWindows VM 扩展添加到 Azure Windows Server VM。
安装失败并显示以下消息:
Failure sending request: StatusCode=404 -- Original Error: Code="ArtifactNotFound" Message="Extension with publisher 'Microsoft.Azure.ActiveDirectory', type 'AADLoginForWindows', and type handler version '1.0' could not be found in the extension repository.
应用 AADLoginForLinux 的 Terraform 配置(有效):
resource "azurerm_virtual_machine_extension" "AADLoginForLinux" {
name = "AADLoginForLinux"
location = "${azurerm_virtual_machine.vm-linux-bastion.location}"
resource_group_name = "${azurerm_virtual_machine.vm-linux-bastion.resource_group_name}"
virtual_machine_name = "${azurerm_virtual_machine.vm-linux-bastion.name}"
publisher = "Microsoft.Azure.ActiveDirectory.LinuxSSH"
type = "AADLoginForLinux"
type_handler_version = "1.0"
auto_upgrade_minor_version = true
}
我怀疑 type 或 type_handler_version 参数值有问题,但我不明白这些值与什么有关(有些谷歌搜索没有提供启示)。
AADLoginForWindows 没有可用的文档(也许这应该是一个警告!;))但我希望它的工作方式与 AADLoginForLinux 大致相同,它允许我们使用直接在 Azure AD 中管理的凭据登录 Linux VM。
我的 Terraform 配置是:
resource "azurerm_virtual_machine_extension" "AADLoginForWindows" {
name = "AADLoginForWindows"
location = "${azurerm_resource_group.rg-dataaq-prd-neu-ftps.location}"
resource_group_name = "${azurerm_resource_group.rg-dataaq-prd-neu-ftps.name}"
virtual_machine_name = "${azurerm_virtual_machine.vm-windows.name}"
publisher = "Microsoft.Azure.ActiveDirectory"
type = "AADLoginForWindows"
type_handler_version = "1.0"
auto_upgrade_minor_version = true
depends_on = ["azurerm_virtual_machine_extension.antimal"]
}
使用az cli
我可以找到有关扩展版本的以下信息:
az vm extension image list --name AADLoginForWindows
[
{
"name": "AADLoginForWindows",
"publisher": "Microsoft.Azure.ActiveDirectory",
"version": "0.3.0.0"
},
{
"name": "AADLoginForWindows",
"publisher": "Microsoft.Azure.ActiveDirectory",
"version": "0.3.1.0"
}
]
查询扩展的特定版本:
az vm extension image show --name AADLoginForWindows --publisher "Microsoft.Azure.ActiveDirectory" --location northeurope --version "0.3.1.0"
{
"computeRole": "IaaS",
"handlerSchema": null,
"id": "/Subscriptions/.../Providers/Microsoft.Compute/Locations/northeurope/Publishers/Microsoft.Azure.ActiveDirectory/ArtifactTypes/VMExtension/Types/AADLoginForWindows/Versions/0.3.1.0",
"location": "northeurope",
"name": "0.3.1.0",
"operatingSystem": "Windows",
"supportsMultipleExtensions": false,
"tags": null,
"type": null,
"vmScaleSetEnabled": false
}
我认为“发布者” Terraform 参数必须等于第一个查询中的发布者值。
type 在第二个查询中返回为 null 的事实让我想知道这是否真的映射到“type”Terraform 参数。
似乎没有任何与 type_handler_version 相关的内容。
有谁知道我应该使用什么配置来安装这个 VM 扩展?
谁能更详细地描述 Terraform 类型和 type_handler_version 参数(并描述如何找到有效值)?
为了测试这是否是 Terraform 错误,我尝试使用该az cli
工具应用扩展:
az vm extension set -n AADLoginForWindows --publisher "Microsoft.Azure.ActiveDirectory" --vm vmname --resource-group rg-name
这给出了以下错误:
Handler 'Microsoft.Azure.ActiveDirectory.AADLoginForWindows' has reported failure for VM Extension 'AADLoginForWindows' with terminal error code '1007' and error message: 'Install failed for plugin (name: Microsoft.Azure.ActiveDirectory.AADLoginForWindows, version 0.3.1.0) with exception Command C:\Packages\Plugins\Microsoft.Azure.ActiveDirectory.AADLoginForWindows\0.3.1.0\AADLoginForWindowsHandler.exe of Microsoft.Azure.ActiveDirectory.AADLoginForWindows has exited with Exit code: 51'
解决方案
推荐阅读
- c# - Mongodb C# - 如何获取最大日期 - (聚合)
- api - 使用 Telegram 向任何电话号码发送个性化消息
- angular - 如何在过滤器管道中检查未找到数据?
- python - Python Tkinter 开启
-Event entry.get() 滞后 - javascript - 剪贴蒙版忽略元素的不透明度
- r - 成对函数的反向变换(lmer 分析)
- android - 在应用计费 v3 中 - 为什么我在调用 queryPurchases(skuID) 时收到 DEVELOPER_ERROR?
- python-3.x - 如何在 Django Azure webapp 上安装 Cmake?
- python-3.x - 是否可以将使用 Tf-nightly 创建的模型重新保存为 tensorflow 2.2.0 的模型?
- python - 如何插值/显示 2D 数据和反转 2D 插值