Browse Source

sql template updated

pull/235/head
Eduard Tomas 7 years ago
parent
commit
bd03600aaa
3 changed files with 23 additions and 14 deletions
  1. +7
    -4
      deploy/az/sql/readme.md
  2. +9
    -4
      deploy/az/sql/sqldeploy.json
  3. +7
    -6
      deploy/az/sql/sqldeploy.parameters.json

+ 7
- 4
deploy/az/sql/readme.md View File

@ -8,15 +8,17 @@ The ARM template `sqldeploy.json` and its parameter file (`sqldeploy.parameters.
## Editing sqldeploy.parameters.json file ## Editing sqldeploy.parameters.json file
You have to edit the `sqldeploy.parameters.json` file to set your values. There are two parameters:
You **must** edit the `sqldeploy.parameters.json` file to set login and password of the admin user.
1. `sql_server` is a object parameter that contains the sql server name, the admin login and password, and the database names.
2. `suffix` is a suffix that will be added to thee sql_server name to ensure uniqueness.
1. `sql_server` is a object parameter that contains the sql server name and the database names. You can leave default values if you want.
2. `admin` is a string with the admin logon. You MUST provide a valid value
3. `adminpwd` is a string with the admin password. You MUST provide a valid value
ARM script ensures uniqueness of the SQL server created by appending one unique string in its name (defined in the `sql_server.name` parameter).
## Deploy the template ## Deploy the template
Once parameter file is edited you can deploy it using [create-resources script](../readme.md). Once parameter file is edited you can deploy it using [create-resources script](../readme.md).
i. e. if you are in windows, to deploy sql databases in a new resourcegroup located in westus, go to `deploy\az` folder and type: i. e. if you are in windows, to deploy sql databases in a new resourcegroup located in westus, go to `deploy\az` folder and type:
``` ```
@ -31,3 +33,4 @@ create-resources.cmd sql\sqldeploy newResourceGroup -c westus

+ 9
- 4
deploy/az/sql/sqldeploy.json View File

@ -5,12 +5,17 @@
"sql_server": { "sql_server": {
"type": "object" "type": "object"
}, },
"suffix": {
"admin": {
"type": "string"
},
"adminpwd": {
"type": "string" "type": "string"
} }
}, },
"variables": { "variables": {
"sql_server_name": "[concat(parameters('sql_server').name, '-', parameters('suffix'))]"
"sql_server_name": "[concat(parameters('sql_server').name, '-', uniqueString(resourceGroup().id))]",
"admin": "[parameters('admin')]",
"adminpwd": "[parameters('adminpwd')]"
}, },
"resources": [ "resources": [
{ {
@ -19,8 +24,8 @@
"apiVersion": "2014-04-01-preview", "apiVersion": "2014-04-01-preview",
"location": "[resourceGroup().location]", "location": "[resourceGroup().location]",
"properties": { "properties": {
"administratorLogin": "[parameters('sql_server').admin]",
"administratorLoginPassword": "[parameters('sql_server').adminpwd]",
"administratorLogin": "[variables('admin')]",
"administratorLoginPassword": "[variables('adminpwd')]",
"version": "12.0" "version": "12.0"
}, },
"resources": [ "resources": [


+ 7
- 6
deploy/az/sql/sqldeploy.parameters.json View File

@ -4,9 +4,7 @@
"parameters": { "parameters": {
"sql_server": { "sql_server": {
"value": { "value": {
"name": "eshop-sqlsrv",
"admin": "eshop",
"adminpwd": "Pass@word",
"name": "eshopsql",
"dbs": { "dbs": {
"ordering": "orderingdb", "ordering": "orderingdb",
"identity": "identitydb", "identity": "identitydb",
@ -14,8 +12,11 @@
} }
} }
}, },
"suffix": {
"value": "edu"
"admin": {
"value": null
},
"adminpwd": {
"value": null
} }
} }
}
}

Loading…
Cancel
Save