Hi Pituach
Thanks for sharing information and We are going to deploy via ARM template for SQL MI.
I need to create Resource in my existing VNET and SUBNET. find the error
{
"status": "Failed",
"error": {
"code": "InvalidTemplate",
"message": "Unable to process template language expressions for resource '/subscriptions/e2a3dc4e-989d-47c5-af8b-2855a9ee07bf/resourceGroups/POC-RG-TECH/providers/Microsoft.Sql/managedInstances/test-sql-mi-01' at line '125' and column '9'. 'The template variable 'Vnetid' is not found. Please see https://aka.ms/arm-template/#variables for usage details.'",
"additionalInfo": [
{
"type": "TemplateViolation",
"info": {
"lineNumber": 125,
"linePosition": 9,
"path": ""
}
}
]
}
}
=================================================
This is my code
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.1",
"parameters": {
"managedInstanceName": {
"type": "String",
"metadata": {
"description": "Enter managed instance name."
}
},
"administratorLogin": {
"type": "String",
"metadata": {
"description": "Enter user name."
}
},
"administratorLoginPassword": {
"type": "SecureString",
"metadata": {
"description": "Enter password."
}
},
"location": {
"defaultValue": "[resourceGroup().location]",
"type": "String",
"metadata": {
"description": "Enter location. If you leave this field blank resource group location would be used."
}
},
"VnetResourceGroup": {
"type": "String",
"metadata": {
"description": "APG Vnet Resource group details to add IP restrictions to the webapp"
}
},
"virtualNetworkName": {
"defaultValue": "SQLMI-VNET",
"type": "String",
"metadata": {
"description": "Enter virtual network name. If you leave this field blank name will be created by the template."
}
},
"subnetName": {
"defaultValue": "ManagedInstance",
"type": "String",
"metadata": {
"description": "Enter subnet name."
}
},
"skuName": {
"defaultValue": "GP_Gen5",
"allowedValues": [
"GP_Gen5",
"BC_Gen5"
],
"type": "String",
"metadata": {
"description": "Enter sku name."
}
},
"vCores": {
"defaultValue": 16,
"allowedValues": [
8,
16,
24,
32,
40,
64,
80
],
"type": "Int",
"metadata": {
"description": "Enter number of vCores."
}
},
"storageSizeInGB": {
"defaultValue": 256,
"minValue": 32,
"maxValue": 8192,
"type": "Int",
"metadata": {
"description": "Enter storage size."
}
},
"licenseType": {
"defaultValue": "LicenseIncluded",
"allowedValues": [
"BasePrice",
"LicenseIncluded"
],
"type": "String",
"metadata": {
"description": "Enter license type."
}
}
},
"resources": [
{
"type": "Microsoft.Sql/managedInstances",
"apiVersion": "2020-02-02-preview",
"name": "[parameters('managedInstanceName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('skuName')]"
},
"identity": {
"type": "SystemAssigned"
},
"properties": {
"administratorLogin": "[parameters('administratorLogin')]",
"administratorLoginPassword": "[parameters('administratorLoginPassword')]",
"storageSizeInGB": "[parameters('storageSizeInGB')]",
"vCores": "[parameters('vCores')]",
"licenseType": "[parameters('licenseType')]",
"virtualNetwork": {
"id": "[resourceId(parameters('VnetResourceGroup'),'Microsoft.Network/virtualNetworks',parameters('VirtualNetworkName'),'/subnets/',parameters('subnetName'))]"
}
}
}
]
}
Kindly help me on this