【发布时间】:2020-03-11 09:53:08
【问题描述】:
我正在尝试使用 azure 资源组模板从 Visual Studio 将 SQL SERVER 和 DATABASE 部署到 azure。但我总是收到此错误: 使用 PowerShell 脚本部署模板失败错误
stackoverflow 上的其他答案没有帮助。 这是 azuredeploy.json 文件中的代码
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"copydbAdminLogin": {
"type": "string",
"minLength": 1
},
"copydbAdminLoginPassword": {
"type": "securestring"
},
"databasecopyName": {
"type": "string",
"minLength": 1
},
"databasecopyCollation": {
"type": "string",
"minLength": 1,
"defaultValue": "SQL_Latin1_General_CP1_CI_AS"
},
"databasecopyEdition": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"databasecopyRequestedServiceObjectiveName": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"S0",
"S1",
"S2",
"P1",
"P2",
"P3"
],
"metadata": {
"description": "Describes the performance level for Edition"
}
}},
"variables": {
"copydbName": "[concat('copydb', uniqueString(resourceGroup().id))]"},
"resources": [
{
"name": "[variables('copydbName')]",
"type": "Microsoft.Sql/servers",
"location": "[resourceGroup().location]",
"apiVersion": "2014-04-01-preview",
"dependsOn": [ ],
"tags": {
"displayName": "copydb"
},
"properties": {
"administratorLogin": "[parameters('copydbAdminLogin')]",
"administratorLoginPassword": "[parameters('copydbAdminLoginPassword')]"
},
"resources": [
{
"name": "AllowAllWindowsAzureIps",
"type": "firewallrules",
"location": "[resourceGroup().location]",
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('copydbName'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "0.0.0.0"
}
},
{
"name": "[parameters('databasecopyName')]",
"type": "databases",
"location": "[resourceGroup().location]",
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('copydbName'))]"
],
"tags": {
"displayName": "databasecopy"
},
"properties": {
"collation": "[parameters('databasecopyCollation')]",
"edition": "[parameters('databasecopyEdition')]",
"maxSizeBytes": "1073741824",
"requestedServiceObjectiveName": "[parameters('databasecopyRequestedServiceObjectiveName')]"
}
}
]
}],
"outputs": {}
}
请帮忙
【问题讨论】:
-
确切的错误文本是什么?
-
首先我得到“Get-AzureRmResourceGroup”一词未被识别为使用 PowerShell 脚本部署模板失败之后。
-
bash 脚本在两秒后打开和关闭,我没有机会输入部署前配置的密码
标签: .net azure azure-sql-database