- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试使用 ARM 模板以编程方式将数据库分配到故障转移组,但我不断收到错误“InvalidResourceIdSegment”。我在论坛中发现了一些接近的东西here ,但是这仅适用于单个数据库,因此它不能完全解决我的问题。我基本上尝试使用一个变量,该变量是我需要添加到此故障转移组的数据库的resourceIds 数组列表。
"databases": {
"critical": {
"names": [
"DB1",
"DB2",
"DB3",
"DB4"
],
"ids": [
"[resourceId('Microsoft.Sql/servers/databases', variables('serverNameWest'), 'DB1')]",
"[resourceId('Microsoft.Sql/servers/databases', variables('serverNameWest'), 'DB2')]",
"[resourceId('Microsoft.Sql/servers/databases', variables('serverNameWest'), 'DB3')]",
"[resourceId('Microsoft.Sql/servers/databases', variables('serverNameWest'), 'DB4')]"
]
}
}
这是故障转移组资源的片段
{
"type": "Microsoft.Sql/servers/failoverGroups",
"name": "[concat(variables('serverNameWest'), '/', variables('failovergroups').critical)]",
"apiVersion": "2015-05-01-preview",
"condition": "[parameters('setRedundancy')]",
"tags": {
"Environment": "[parameters('Environment')]"
},
"properties": {
"readWriteEndpoint": {
"failoverPolicy": "Automatic",
"failoverWithDataLossGracePeriodMinutes": 15
},
"readOnlyEndpoint": {
"failoverPolicy": "Enabled"
},
"partnerServers": [
{
"id": "[resourceID('Microsoft.Sql/servers', variables('serverNameEast'))]"
}
],
"databases": [
"[variables('databases').critical.ids]"
]
},
"dependsOn": [
"[resourceID('Microsoft.Sql/servers', variables('serverNameEast'))]",
"[resourceID('Microsoft.Sql/servers', variables('serverNameWest'))]",
"[concat(resourceID('Microsoft.Sql/servers', variables('serverNameWest')), '/elasticpools/', variables('elasticpools').critwest)]",
"[concat(resourceID('Microsoft.Sql/servers', variables('serverNameEast')), '/elasticpools/', variables('elasticpools').criteast)]",
"BusinessCriticalWest",
"BusinessCriticalEast"
]
}
将变量 [variables('databases').ritical.ids]
传递到数据库属性总是会出现此错误:
"code": "InvalidResourceIdSegment",
"message": "url 中的 'parameters.properties.databases[0]' 段无效。"
但是,如果我单独添加它们,如下所示,一切都会正常。
"[variables('databases').critical.ids[0]]"
我尝试在属性中使用复制函数(这似乎不起作用,因为复制函数需要输入名称值对)和复制函数作为变量(它也返回有关 invalidResourceIdSegment 的相同错误) 。我很困惑,因此我们将不胜感激任何帮助。
最佳答案
@nicklaws 我刚刚在寻找其他东西时遇到了这个。
乍一看,我想知道这是否是一个问题:
variables('serverNameEast')
由于我看不到你的变量设置,所以我无法判断,但是我的变量通常如下所示:
variables('serverNameEast').name
例如。
其次,这是一个完整的 ARM 模板,我已经使用过很多次并且它有效:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"businessOwner": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "Responsible for billing of the resource"
}
},
"technicalOwner": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "Responsible for the technology decisions of the resource"
}
},
"environment": {
"type": "string",
"metadata": {
"description": "Provides information on the environment that the resource belongs to"
},
"allowedValues": [
"prod",
"nprd",
"sand"
]
},
"costCode": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "Provides a charge code or cost center to attribute the bill for the resources too. This could be a project code or cost Centre"
}
},
"projectName": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "Provides information on the project that the resource group and resources belong to."
}
},
"primaryAdministratorLogin": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "Administrator username for the server. Once created it cannot be changed."
}
},
"primaryAdministratorLoginPassword": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "The administrator login password (required for server creation)."
}
},
"sqlServerSecondaryRegion": {
"type": "string",
"metadata": {
"description": "The location of the secondary SQL Server."
}
},
"sqlServerSecondaryAdminUsername": {
"type": "string",
"metadata": {
"description": "The administrator username of the secondary SQL Server."
}
},
"sqlServerSecondaryAdminPassword": {
"type": "string",
"metadata": {
"description": "The administrator password of the secondary SQL Server."
}
},
"requestedServiceObjectiveName": {
"type": "string",
"metadata": {
"description": "The name of the configured service level objective of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of serviceLevelObjective property."
}
},
"sampleName": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "Indicates the name of the sample schema to apply when creating this database. If createMode is not Default, this value is ignored. Not supported for DataWarehouse edition. - AdventureWorksLT"
}
},
"maxSizeBytes": {
"type": "string",
"defaultValue": "107374182400",
"metadata": {
"description": "The max size of the database expressed in bytes. If createMode is not Default, this value is ignored."
}
},
"collation": {
"type": "string",
"defaultValue": "SQL_Latin1_General_CP1_CI_AS",
"metadata": {
"description": "The collation of the database. If createMode is not Default, this value is ignored."
}
},
"createMode": {
"type": "string",
"defaultValue": "Default",
"metadata": {
"description": "Specifies the mode of database creation."
}
},
"readScale": {
"type": "string",
"defaultValue": "Disabled",
"metadata": {
"description": "Specifies the mode of database creation."
}
},
"edition": {
"type": "string",
"defaultValue": "Standard",
"metadata": {
"description": "The edition of the database."
}
},
"zoneRedundant": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones."
}
},
"firewallDigitalNetworkFrom": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "firewall rule"
}
},
"firewallDigitalNetworkTo": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "firewall rule"
}
},
"firewallMelbourneOfficeFrom": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "firewall rule"
}
},
"firewallMelbourneOfficeTo": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "firewall rule"
}
},
"firewallSydneyOfficeFrom": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "firewall rule"
}
},
"firewallSydneyOfficeTo": {
"type": "string",
"defaultValue": "NOT_SET",
"metadata": {
"description": "firewall rule"
}
},
"failoverEnabled": {
"type": "string",
"defaultValue": "true",
"metadata": {
"description": "Whether we allow a secondary SQL server with failover. This could be used to save money"
}
}
},
"variables": {
"sqlServerPrimary": {
"name": "[toLower(concat(parameters('projectName'), '-',parameters('environment'), '-', 'sqlsvr-primary'))]",
"requestedServiceObjectiveName": "[parameters('requestedServiceObjectiveName')]"
},
"sqlServerSecondary": {
"name": "[toLower(concat(parameters('projectName'), '-',parameters('environment'), '-', 'sqlsvr-secondary'))]"
},
"sqlFailoverGroupName": {
"name": "[toLower(concat(parameters('projectName'), '-',parameters('environment'), '-', 'failover-group'))]"
}
},
"resources": [
{
"name": "[variables('sqlServerPrimary').name]",
"type": "Microsoft.Sql/servers",
"apiVersion": "2015-05-01-preview",
"location": "[resourceGroup().location]",
"tags": {
"BusinessOwner": "[parameters('businessOwner')]",
"TechnicalOwner": "[parameters('technicalOwner')]",
"Environment": "[parameters('environment')]",
"CostCode": "[parameters('costCode')]",
"Project": "[parameters('projectName')]"
},
"properties": {
"administratorLogin": "[parameters('primaryAdministratorLogin')]",
"administratorLoginPassword": "[parameters('primaryAdministratorLoginPassword')]",
"version": "12.0"
},
"resources": [
{
"apiVersion": "2015-05-01-preview",
"condition": "[equals(parameters('failoverEnabled'),'true')]",
"type": "failoverGroups",
"name": "[variables('sqlFailoverGroupName').name]",
"tags": {
"BusinessOwner": "[parameters('businessOwner')]",
"TechnicalOwner": "[parameters('technicalOwner')]",
"Environment": "[parameters('environment')]",
"CostCode": "[parameters('costCode')]",
"Project": "[parameters('projectName')]"
},
"properties": {
"serverName": "[variables('sqlServerPrimary').name]",
"partnerServers": [
{
"id": "[resourceId('Microsoft.Sql/servers/', variables('sqlServerSecondary').name)]"
}
],
"readWriteEndpoint": {
"failoverPolicy": "Automatic",
"failoverWithDataLossGracePeriodMinutes": 60
},
"readOnlyEndpoint": {
"failoverPolicy": "Disabled"
},
"databases": [
]
},
"dependsOn": [
"[variables('sqlServerPrimary').name]",
"[resourceId('Microsoft.Sql/servers', variables('sqlServerSecondary').name)]"
]
},
{
"name": "AllowAllWindowsAzureIps",
"type": "firewallRules",
"apiVersion": "2015-05-01-preview",
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "0.0.0.0"
},
"dependsOn": [
"[concat('Microsoft.Sql/servers/', variables('sqlServerPrimary').name)]"
]
},
{
"name": "digitalNetwork",
"type": "firewallRules",
"apiVersion": "2015-05-01-preview",
"properties": {
"startIpAddress": "[parameters('firewallDigitalNetworkFrom')]",
"endIpAddress": "[parameters('firewallDigitalNetworkTo')]"
},
"dependsOn": [
"[concat('Microsoft.Sql/servers/', variables('sqlServerPrimary').name)]"
]
},
{
"name": "MelbourneOffice",
"type": "firewallRules",
"apiVersion": "2015-05-01-preview",
"properties": {
"startIpAddress": "[parameters('firewallMelbourneOfficeFrom')]",
"endIpAddress": "[parameters('firewallMelbourneOfficeTo')]"
},
"dependsOn": [
"[concat('Microsoft.Sql/servers/', variables('sqlServerPrimary').name)]"
]
},
{
"name": "SydneyOffice",
"type": "firewallRules",
"apiVersion": "2015-05-01-preview",
"properties": {
"startIpAddress": "[parameters('firewallSydneyOfficeFrom')]",
"endIpAddress": "[parameters('firewallSydneyOfficeTo')]"
},
"dependsOn": [
"[concat('Microsoft.Sql/servers/', variables('sqlServerPrimary').name)]"
]
}
]
},
{
"type": "Microsoft.Sql/servers",
"kind": "v12.0",
"condition": "[equals(parameters('failoverEnabled'),'true')]",
"name": "[variables('sqlServerSecondary').name]",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('sqlServerSecondaryRegion')]",
"tags": {
"BusinessOwner": "[parameters('businessOwner')]",
"TechnicalOwner": "[parameters('technicalOwner')]",
"Environment": "[parameters('environment')]",
"CostCode": "[parameters('costCode')]",
"Project": "[parameters('projectName')]"
},
"properties": {
"administratorLogin": "[parameters('sqlServerSecondaryAdminUsername')]",
"administratorLoginPassword": "[parameters('sqlServerSecondaryAdminPassword')]",
"version": "12.0"
},
"resources": [
{
"name": "AllowAllWindowsAzureIps",
"type": "firewallRules",
"condition": "[equals(parameters('failoverEnabled'),'true')]",
"apiVersion": "2015-05-01-preview",
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "0.0.0.0"
},
"dependsOn": [
"[concat('Microsoft.Sql/servers/', variables('sqlServerSecondary').name)]"
]
},
{
"name": "digitalNetwork",
"type": "firewallRules",
"condition": "[equals(parameters('failoverEnabled'),'true')]",
"apiVersion": "2015-05-01-preview",
"properties": {
"startIpAddress": "[parameters('firewallDigitalNetworkFrom')]",
"endIpAddress": "[parameters('firewallDigitalNetworkTo')]"
},
"dependsOn": [
"[concat('Microsoft.Sql/servers/', variables('sqlServerSecondary').name)]"
]
},
{
"name": "MelbourneOffice",
"type": "firewallRules",
"condition": "[equals(parameters('failoverEnabled'),'true')]",
"apiVersion": "2015-05-01-preview",
"properties": {
"startIpAddress": "[parameters('firewallMelbourneOfficeFrom')]",
"endIpAddress": "[parameters('firewallMelbourneOfficeTo')]"
},
"dependsOn": [
"[concat('Microsoft.Sql/servers/', variables('sqlServerSecondary').name)]"
]
},
{
"name": "SydneyOffice",
"type": "firewallRules",
"condition": "[equals(parameters('failoverEnabled'),'true')]",
"apiVersion": "2015-05-01-preview",
"properties": {
"startIpAddress": "[parameters('firewallSydneyOfficeFrom')]",
"endIpAddress": "[parameters('firewallSydneyOfficeTo')]"
},
"dependsOn": [
"[concat('Microsoft.Sql/servers/', variables('sqlServerSecondary').name)]"
]
}
]
}
]
}
希望对大家有帮助。
关于Azure ARM 故障转移组数据库属性不接受变量数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52545989/
似乎有很多方法可以在 Azure 中自动使用 PowerShell。由于 ARM 模板是最新的,Azure 中的其他 PowerShell 选项是否已过时?这些工具/脚本之间有什么区别: Azure
我正在开发一个将托管在 Azure 中的 Web API。我想使用 Azure 诊断将错误记录到 Azure 表存储中。在经典门户中,我可以将日志配置为转到 Azure 表存储。 Classic Po
Azure 文件存储事件可以触发 Azure WebJob 或 Azure Function 吗? 例如,在文件夹“/todo/”中创建文件时。 最佳答案 我们目前没有任何 Azure 文件绑定(bi
我需要创建一个逻辑应用程序,我的要求是,我需要从 azure data Lake Gen2 文件夹迁移 json 文件,并根据某些值需要将该 json 转换为 xml,然后将其发送到 SQL。 因此,
我使用 VS Code 创建了 1 个 node.js 和 1 个 java Azure Function 当我使用 VS Code 将这两个函数部署到 Azure 时,我最终获得了这么多 Azure
收集 Azure 诊断数据时,暂存槽是否也会将诊断数据发送到 WadPerformanceCounters 表? 如果是这样,我该如何关闭它?或者在阅读诊断信息时如何区分暂存/生产。 我不想显示有关我
您好,我是 Azure 的新手。我有 VS 2012 和 Azure SDK 2.1,当我使用模拟器运行我的 Web 应用程序时一切正常。但是当我在 azure 上部署时出现错误消息: Could n
我很难区分 Azure 订阅和 Azure 租户有何不同?我尝试使用示例来弄清楚,但每次我得出的结论是它们在某种程度上是相同的?如果租户是组织在注册 Microsoft 云服务时接收并拥有的 Azur
如果我想在 Azure Insights 中设置自定义指标集合,并以(近)实时的方式可视化其中一些指标,并查看聚合的历史数据,我应该使用 Azure Metrics Explorer 还是 Azure
我想了解具有以下配置的 Azure 数据工厂 (ADF) 的现实示例/用例: Azure 集成运行时 (AIR) 默认值 自托管集成运行时(SHIR) 其他问题: 这两种配置(AIR 和 SHIR)是
请参阅下面来自 Azure 服务总线的指标。想要识别请求数量中的背景噪音|流量较低时的响应。假设振荡请求| session 中 amqp 握手的响应是潜在的。只是不明白这是什么类型的握手?从总线接收的
此问题与 Azure 事件中心和 Azure 服务总线之间的区别无关。 问题如下: 如果您将Azure Events Hub添加到您的应用程序中,那么您会注意到它依赖于Azure Service Bu
这两个事情是完全不同的,还是它们能完成的事情大致相同/相似? 最佳答案 Azure 辅助角色是“应用程序场”中您自己的一组虚拟机。您可以以分布式方式在它们上运行任何代码。通常,您编写业务代码以在这些服
我目前正在使用 Windows Azure 虚拟机来运行 RStudio, 我的虚拟机是 Windows Server R2 2012,它是 Azure 上的一项附加服务。 我还有一个 Azure 存
我们正在寻找托管一个网站(一些 css、js、一个 html 文件,但不是 aspx、一个通用处理程序)。 我们部署为: 1) Azure 网站 2) Azure 云服务 两种解决方案都有效。但有一个
我想从 Azure 表创建 blob。 AzCopy 支持此功能,但我找不到任何说明数据移动 API 也支持它的文档。此选项可用吗? https://azure.microsoft.com/en-us
This article表示 Azure 订阅所有者有权访问订阅中的所有资源。但是,要访问 Azure 数据库,必须是数据库中的用户,或者是 Azure Admin AD 组的成员。 无论 SQL 安
我尝试使用以下代码将 XML 文件上传到 Azure FTP 服务器: https://www.c-sharpcorner.com/article/upload-and-download-files-
除了 Azure 服务总线使用主题而 Azure 事件中心基于事件 - Azure 事件中心和 Azure 服务总线之间是否有任何根本区别? 对我来说,事件和消息之间没有真正的区别,因为两者只是不同类
我有一个通过虚拟网络网关连接到 Azure 虚拟网络的 Windows VPN 客户端。目标#1 是使用其内部 IP 地址连接到我的虚拟机。这有效。 第二个目标是使用其内部计算机名称进行连接(因为 I
我是一名优秀的程序员,十分优秀!