- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在使用我创建的共享镜像作为基础时,无法从 ARM 模板创建托管应用程序。该图像存储在我的 SIG 中。下面的代码来 self 的 mainTemplate.json:
"storageProfile": {
"imageReference": {
"offer": "TESTOFFER ",
"publisher": "TESTPUB ",
"sku": "1.0.0",
"id ": "/subscriptions/<subid>/resourceGroups/managed_gallery/providers/Microsoft.Compute/galleries/managed_gallery_instance/images/gallery_image/versions/1.0.0"
},
"osDisk": {
"createOption": "fromImage"
}
在我的目标资源组中,创建了 nsg、ip、nic、nsg 和 vnet,只有虚拟机失败。这是我在 azure 门户中得到的错误输出:
{
"code": "DeploymentFailed",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.",
"details": [
{
"code": "BadRequest",
"message": "Could not find member 'id ' on object of type 'ImageReference'. Path 'properties.storageProfile.imageReference['id ']', line 1, position 1101."
}
]
}
我找到了this article在没有说明任何用法的文档中。我做了很多谷歌搜索,但没有找到任何适合我的案例的好例子。
这是否就是将自定义图像传递给妈妈的预期方式?我很感激任何建议。
提前致谢!
编辑
这是整个 ARM 模板:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"projectName": {
"type": "string",
"defaultValue": "managedApp",
"metadata": {
"description": "Specifies a name for generating resource names."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Specifies the location for all resources."
}
},
"adminUsername": {
"type": "string",
"defaultValue": "azureAdmin",
"metadata": {
"description": "Specifies a username for the Virtual Machine."
}
},
"adminPublicKey": {
"type": "string",
"defaultValue": "KEY",
"metadata": {
"description": "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs."
}
}
},
"variables": {
"vNetName": "[concat(parameters('projectName'), '-vnet')]",
"vNetAddressPrefixes": "10.0.0.0/16",
"vNetSubnetName": "default",
"vNetSubnetAddressPrefix": "10.0.0.0/24",
"vmName": "[concat(parameters('projectName'), '-vm')]",
"publicIPAddressName": "[concat(parameters('projectName'), '-ip')]",
"networkInterfaceName": "[concat(parameters('projectName'), '-nic')]",
"networkSecurityGroupName": "[concat(parameters('projectName'), '-nsg')]",
"networkSecurityGroupName2": "[concat(variables('vNetSubnetName'), '-nsg')]"
},
"resources": [
{
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2020-05-01",
"name": "[variables('networkSecurityGroupName')]",
"location": "[parameters('location')]",
"properties": {
"securityRules": [
{
"name": "ssh_rule",
"properties": {
"description": "Locks inbound down to ssh default port 22.",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "22",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 123,
"direction": "Inbound"
}
}
]
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2020-05-01",
"name": "[variables('publicIPAddressName')]",
"location": "[parameters('location')]",
"properties": {
"publicIPAllocationMethod": "Dynamic"
},
"sku": {
"name": "Basic"
}
},
{
"comments": "Simple Network Security Group for subnet [variables('vNetSubnetName')]",
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2020-05-01",
"name": "[variables('networkSecurityGroupName2')]",
"location": "[parameters('location')]",
"properties": {
"securityRules": [
{
"name": "default-allow-22",
"properties": {
"priority": 1000,
"access": "Allow",
"direction": "Inbound",
"destinationPortRange": "22",
"protocol": "Tcp",
"sourceAddressPrefix": "*",
"sourcePortRange": "*",
"destinationAddressPrefix": "*"
}
}
]
}
},
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-05-01",
"name": "[variables('vNetName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]"
],
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('vNetAddressPrefixes')]"
]
},
"subnets": [
{
"name": "[variables('vNetSubnetName')]",
"properties": {
"addressPrefix": "[variables('vNetSubnetAddressPrefix')]",
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName2'))]"
}
}
}
]
}
},
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2020-05-01",
"name": "[variables('networkInterfaceName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]",
"[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
},
"subnet": {
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vNetName'), variables('vNetSubnetName'))]"
}
}
}
]
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2019-12-01",
"name": "[variables('vmName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]"
],
"properties": {
"osProfile": {
"computerName": "[variables('vmName')]",
"adminUsername": "[parameters('adminUsername')]",
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]",
"keyData": "[parameters('adminPublicKey')]"
}
]
}
}
},
"storageProfile": {
"imageReference": {
"id ": "id"
},
"osDisk": {
"createOption": "fromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]"
}
]
}
}
}
]
}
最佳答案
可能需要查看模板的其余部分,但如果您想使用磁盘的托管镜像,“id”属性是您提供的唯一属性(删除发布商、报价、sku)。
该错误听起来好像您可能遇到多个问题,但这只是一个开始。
对虚拟机上的属性节点尝试此操作:
"properties": {
"hardwareProfile": {
"vmSize": "Standard_D2ds_v4"
},
"osProfile": {
"computerName": "[variables('vmName')]",
"adminUsername": "[parameters('adminUsername')]",
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]",
"keyData": "[parameters('adminPublicKey')]"
}
]
}
}
},
"storageProfile": {
"imageReference": {
"id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{version}"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]"
}
]
}
}
我所做的更改:
imageReference
下 id
属性名称中的空格关于azure - 来自 SIG 的 Microsoft Azure 托管应用程序 ARM 模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68482715/
我试图在字符串中显示 sig figs,我找到了 '{:.2f}'.format(x) 样式,只要我有sig figs 在代码中作为整数,但如果 sig figs 的数量包含在变量中,我似乎无法使这种
我创建的脚本有问题。这是我第一次使用信号,因为我希望我的脚本像守护进程一样运行,所以我设置了几个信号处理程序来正确结束我的脚本: local $SIG{HUP} = \&StopSuperviser;
我是 Alloy 新手,由于出现错误,我的程序无法执行或显示。我遇到的错误是 A Syntax error has occurred: You must specify a scope for "th
我在热门编码网站 codechef 上提交名为“Money Transformation”的问题时遇到问题。每次我提交解决方案时,我都会收到运行时错误名称 SIG SEGV。经过一些搜索在谷歌上我发现
Sorbet 显示 attr_reader 错误,但如果我错了请纠正我,当函数被声明而不是被调用时需要 sigs,对吧? 我已经尝试过阅读文档,但我得到的只是这个注释 注意:许多看起来像局部变量的 R
我们有一个关于 XML-sig 的问题,需要有关可选元素以及一些规范化和转换内容的详细信息。我们正在为一个非常小的 XML 语法负载编写规范,它将进入媒体文件的元数据,并且需要通过加密签名。我们认为我
我正在尝试在我的 Perl 程序中添加一个捕获信号。当 ctrl+C 发生时,我想要一条确认消息和一个用户输入( Y 或 N )。 Y 输入工作正常。 如果用户输入 N,那么基本上我想“取消” ctr
这个问题在这里已经有了答案: How does function application with the $ operator curry in Haskell? (1 个回答) 8年前关闭。 如果
这些设置之间有什么区别? $SIG{CHLD} = 'IGNORE' $SIG{CHLD} = 'DEFAULT' $SIG{CHLD} = '' $SIG{CHLD} = undef 根据“U
我有一段 Perl 代码,有点像下面这样(强烈简化): 有一些嵌套的子程序调用(实际上是方法),并且一些内部的执行它们自己的异常处理: sub outer { middle() } sub middl
最近尝试更新 emacs 软件包并得到了这个。 Failed to verify signature archive-contents.sig: No public key for 066DAFCB8
我正在使用带有grails安全性和JA-SIG CAS spring安全性插件的grails。 解决此问题的一种方法是登录到CAS服务器并重新启动应用程序。 另一种方法是,如果我通过同一CAS服务器登
因此,当我尝试传递对象 Map> 时,我的代码显示编译器错误到 Map> 的方法。如下... private static void logProgress(Map>> cacheLoaders, M
我创建了一个信号处理程序,以便在发送 SIGSEGV 时调用。我使用 C 语言编写程序,还使用 Linux 和 intel x86 处理器。在 sig 处理程序中,看起来通过 siginfo_t
我知道,通常你会告诉我检查日志(在崩溃之前,看看我是否遗漏了什么)。 .没什么,因为当我尝试开始一项新 Activity 时,应用程序无论如何都会崩溃。仅有的两个有效 Activity 是 Splas
我对如何正确关闭我正在使用的非常简单的服务器感到困惑。 我在想这应该够了: #!/usr/bin/python import signal import myhandler import Socket
我最近注意到,当使用 utf-8-sig 编码附加到文件时,Python 的行为方式并不明显。见下文: >>> import codecs, os >>> os.path.isfile('123')
我对shell 脚本编写 和Perl 很陌生,我正在尝试将Perl 脚本转换为Python脚本。 我遇到了下面的代码片段,但我并不清楚。 sub sigalrm_handler { printf
我正在构建一个使用蓝牙与远程传感器通信的 iPhone 应用程序。外设是蓝牙自行车速度传感器。该应用程序使用来自外围设备的信息来计算行驶距离。 我看到有一个蓝牙特别兴趣小组 (SIG) 负责确保制造商
我知道 .asc签名作为文本文件输出,而 .sig & .gpg是二进制的。 一边说: 是 .sig和 .gpg同一个文件有不同的扩展名?如果没有,为什么要使用一个? 文本文件和二进制文件,有什么相对
我是一名优秀的程序员,十分优秀!