We will be deploying sql db
to do this we need two resources such as sql server and sql db
to check the resource type of any azure resource we can check this by going into properties of this resources.
link for sql server
https://learn.microsoft.com/en-us/azu...
Link for sql db
https://learn.microsoft.com/en-us/azu...
Steps
Create a new json file
call it sqldb.json
arm and a tab will give schema
define resources
there will be two sources sql server and db
Go to link and copy
"type": "Microsoft.Sql/servers",
"apiVersion": "2023-05-01-preview",
"name": "string",
"location": "string",
place it in vscode
give name call it any unique name
for location
"location": "[resourceGroup().location]”
Add properties go to the documentation
"properties": {
"administratorLogin": "string",
"administratorLoginPassword": "string"
}
Now in parameter section define
"SQLLogin": {
"type":"string",
"metadata":{
"description":"The administrator user name"
}
one more parameter for Password
"SQLPassword": {
"type":"secureString",
"metadata":{
"description":"The administrator password"
}
Replace these parameter in the properties section.
"properties":{
"administratorLogin": "[parameters('SQLLogin')]",
"administratorLoginPassword": "[parameters('SQLPassword')]"
Next resource is SQL db
Go to document and copy
"type": "Microsoft.Sql/servers/databases",
"apiVersion": "2022-02-01-preview",
"name": "[format('{0}/{1}','sqlserver400505','kashdb')]",
"location": "[resourceGroup().location]",
"sku":{
"name":"Basic",
"tier":"Basic"
},
"properties":{},
"dependsOn":[
"[resourceId('Microsoft.Sql/servers','sqlserver400505')]"
]
Github link for SQL db/sever ARM script
https://github.com/cloudsoldier/ARM_T...
{
"$schema": "https://schema.management.azure.com/s...",
"contentVersion": "1.0.0.0",
"parameters": {
"SQLLogin": {
"type":"string",
"metadata":{
"description":"The administrator user name"
}
},
"SQLPassword": {
"type":"secureString",
"metadata":{
"description":"The administrator password"
}
}
},
"functions": [],
"variables": {},
"resources": [
{
"type": "Microsoft.Sql/servers",
"apiVersion": "2022-02-01-preview",
"name": "kashsqlserver",
"location": "[resourceGroup().location]",
"properties":{
"administratorLogin": "[parameters('SQLLogin')]",
"administratorLoginPassword": "[parameters('SQLPassword')]"
}
},
{
"type": "Microsoft.Sql/servers/databases",
"apiVersion": "2022-02-01-preview",
"name": "[format('{0}/{1}','kashsqlserver','kashdb')]",
"location": "[resourceGroup().location]",
"sku":{
"name":"Basic",
"tier":"Basic"
},
"properties":{},
"dependsOn":[
"[resourceId('Microsoft.Sql/servers','kashsqlserver')]"
]
}
],
"outputs": {}
}
Смотрите видео Mastering Azure Sql Deployment With Arm Templates - Az-400 Lab Part 2 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь CloudSoldier 31 Март 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 31 раз и оно понравилось 2 людям.