{"id":12615,"date":"2019-07-02T17:08:04","date_gmt":"2019-07-02T15:08:04","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/"},"modified":"2023-07-17T14:46:11","modified_gmt":"2023-07-17T12:46:11","slug":"deploying-sql-server-on-azure-virtual-machine-with-terraform","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/","title":{"rendered":"Deploying SQL Server on Azure virtual machine with Terraform"},"content":{"rendered":"<p>We are entering now to the infrastructure as code world and provisioning a SQL Server infrastructure is not excluded from the equation. This is especially true when it comes the Cloud regardless we are using IaaS or PaaS.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-33319 size-full\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/157-0-terraform_sql_vm_azure-e1562085022500.jpg\" alt=\"\" width=\"500\" height=\"215\" \/><\/p>\n<p>One great tool to use in such scenario is certainly terraform and I introduced it during the last <a href=\"http:\/\/powersaturday.com\/preconferences\/#preconf2\">PowerSaturday<\/a> pre-conference named \u201cDBA modern competencies\u201d. Installation paradigms in the cloud differ from what we usually do on-premises either we are GUI-oriented or scripting-enthusiastic DBAs. In on-premises scenarios, building and delivering a software require both to deal often with a lot of hardware including servers, racks, network, cooling and so on. So, it makes sense to have one team for managing the hardware stuff (Ops) and another one to develop software (Devs). But nowadays, a shift is taking place and instead of managing their own data centers for some of their system components, many customers are moving to the cloud, taking advantage of services such as Azure, AWS and Google Cloud. This is a least what I begin to notice with some of my customers for some times now including some of their database environments. Instead of investing heavily in hardware, many Ops teams are spending all their time working on software, using tools such as Chef, Puppet, Terraform or Docker. In other words, instead of racking servers and plugging in network cables, many sysadmins are writing code. From a database administrator standpoint, I believe this is a good news because it will remove this boring part of the work without any real adding values.<\/p>\n<p>The question that may rise probably is why to use Terraform (or equivalent) rather than a script? I mean script as ad-hoc script here \u2026 Personally, I use PowerShell based ah-hoc scripts to install and configure SQL Server for a while now at customer shops and PowerShell is part of IAC (Infrastructure As Code) tooling category. But using ad-hoc scripts come with some drawbacks. First of all, using a programming language like PowerShell implies you have to write completely custom code for every task and it is not a big deal as long as you manage few components in the infrastructure. But what if you&#8217;re\u00a0 dealing with hundred or thousand of servers including databases, network, load balancers and so on? Do you really want to maintain a big and unmaintainable ad-hoc script repository especially if you work in a collaborative way? In this case you have to rely on a tool designed for such job. Furthermore, writing an ad hoc script that works once isn\u2019t often too difficult but writing one that works correctly even if you run it over and over again is a lot harder and impotent code is an important part of modern infrastructure.<\/p>\n<p>In my case, we also investigated on different configuration management tools like Ansible but they are mostly designed to install and manage software on existing servers. In the context of the cloud, in most cases servers do not exist and you have to provide one (or many) including the related infrastructure like virtual network, virtual IP, virtual machine, disks and so forth \u2026\u00a0 So here comes the big interest of using Terraform in such scenario. <a href=\"https:\/\/www.terraform.io\/\" target=\"_blank\" rel=\"noopener noreferrer\">Terraform<\/a> is an Hashicop product and comes with open source vs Enterprise version. I&#8217;m using the open source one with 01.2 version at the moment of writing this blog post as shown below:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">$ terraform version\nTerraform v0.12.0\n+ provider.azurerm v1.31.0\n+ provider.template v2.1.2<\/pre>\n<p>In my case, it may be very helpful to provision servers on Azure. Microsoft already invested a lot to introduce Terraform as provisioning tool for different Azure services including SQL Azure DBs with <a href=\"https:\/\/www.terraform.io\/docs\/providers\/azurerm\/r\/sql_database.html\" target=\"_blank\" rel=\"noopener noreferrer\">azurerm_sql_database<\/a> or <a href=\"https:\/\/www.terraform.io\/docs\/providers\/azurerm\/r\/sql_server.html\" target=\"_blank\" rel=\"noopener noreferrer\">azurerm_sql_server<\/a> providers. But the story is not the same when it comes SQL Server virtual machines on Azure. The only provider available to provision an Azure VM is <a href=\"https:\/\/www.terraform.io\/docs\/providers\/azurerm\/r\/virtual_machine.html\" target=\"_blank\" rel=\"noopener noreferrer\">azurerm_virtual_machine<\/a> but it doesn\u2019t include the SQL Server configuration part. In this blog post I want to expose some challenges I faced to make it possible and you probably want to be aware of \ud83d\ude42<\/p>\n<p>Let&#8217;s say that in fact, we have to rely on the <a href=\"https:\/\/www.terraform.io\/docs\/providers\/azurerm\/r\/template_deployment.html\" target=\"_blank\" rel=\"noopener noreferrer\">azurerm_template_deployment<\/a> provider in this case but at the cost of some complexity. Indeed, you have to introduce the SQL Server template <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/templates\/microsoft.sqlvirtualmachine\/2017-03-01-preview\/sqlvirtualmachines\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft.SqlVirtualMachine\/SqlVirtualMachines<\/a> to the Terraform files with all the difficulties that is implies. First, from my opinion adding a SQL Server template file leads to additional complexity that is at the opposite of what we expect from Terraform. We lose some code simplification and maintainability somewhere and this is by far my main disappointment. Anyway, in addition let&#8217;s say that debugging a Terraform deployment with Azure templates may be time-consuming task especially if you have to deal with syntax error issues. You often have to take a look at the Azure event logs directly to know what is happening. Second, the parameters are all string type and we need to convert them to the right type with Azure template variables. Finally, as far as I know, it is not possible to use arrays as input parameters within the Azure template and refactoring from the initial server template is requested accordingly. This is the case of the SQL Server dataDisks configuration parameter for instance. I don\u2019t know if Microsoft is planning something on this topic but my expectation is to get something more \u201cTerraform-integrated\u201d in the future.<\/p>\n<p>Let\u2019s finish this blog post with my Terraform files used in my SQL Server VM Azure provisioning workflow that is as follows:<\/p>\n<p><strong>Create a resource group <\/strong><strong>=&gt;<\/strong><strong> Create a virtual network + subnet <\/strong><strong>=&gt;<\/strong><strong> Create SQL Server Azure VM with custom configuration<\/strong><\/p>\n<ul>\n<li>The main configuration file. The resource section is understanble and generally speaking the configuration file remains maintenable enough here with the declarative \/ descriptive way to provision resources.<\/li>\n<\/ul>\n<pre class=\"brush: xml; gutter: true; first-line: 1\"># =============== VARIABLES =============== #\nvariable \"prefix\" {\n  type    = string\n  default = \"dbi\"\n}\n\nvariable \"resourcegroup\" {\n  type = string\n}\n\nvariable \"location\" {\n  type    = string\n  default = \"westeurope\"\n}\n\nvariable \"subscriptionId\" {\n  type = string\n}\n\nvariable \"virtualmachinename\" {\n  type = string\n}\n\nvariable \"virtualMachineSize\" {\n  type    = string\n}\n\nvariable \"adminUsername\" {\n  type = string\n}\n\nvariable \"adminUserPassword\" {\n  type = string\n}\n\nvariable \"image_ref_offer\" {\n  type = string\n}\n\nvariable \"image_ref_sku\" {\n  type = string\n}\n\nvariable \"image_ref_version\" {\n  type = string\n}\n\nvariable \"osDiskType\" {\n  type    = string\n  default = \"Premium_LRS\"\n}\n\nvariable \"sqlVirtualMachineLocation\" {\n  type    = string\n  default = \"westeurope\"\n}\n\nvariable \"sqlServerLicenseType\" {\n  type    = string\n}\n\nvariable \"sqlPortNumber\" {\n  type    = string\n  default = \"1433\"\n}\n\nvariable \"sqlStorageDisksCount\" {\n  type    = string\n  default = \"1\"\n}\n\nvariable \"diskSqlSizeGB\" {\n  type    = string\n  default = \"1024\"\n}\n\nvariable \"sqlDisklType\" {\n  type    = string\n  default = \"Premium_LRS\"\n}\n\nvariable \"sqlStorageWorkloadType\" {\n  type    = string\n  default = \"GENERAL\"\n}\n\nvariable \"sqlAuthenticationLogin\" {\n  type = string\n}\n\nvariable \"sqlAuthenticationPassword\" {\n  type = string\n}\n\nvariable \"sqlConnectivityType\" {\n  type = string\n}\n\nvariable \"sqlAutopatchingDayOfWeek\" {\n  type    = string\n  default = \"Sunday\"\n}\n\nvariable \"sqlAutopatchingStartHour\" {\n  type    = string\n  default = \"2\"\n}\n\nvariable \"sqlAutopatchingWindowDuration\" {\n  type    = string\n  default = \"60\"\n}\n\nvariable \"diagnosticsStorageAccountName\" {\n  type = string\n}\n\nvariable \"tag\" {\n  type = string\n}\n\n# =============== TEMPLATES =============== #\ndata \"template_file\" \"sqlvm\" {\n  template = file(\".\/Templates\/sql_vm_azure_dbi.json\")\n}\n\n# =============== RESOURCES =============== #\nresource \"azurerm_resource_group\" \"sqlvm\" {\n  name     = var.resourcegroup\n  location = \"West Europe\"\n}\n\nresource \"azurerm_virtual_network\" \"sqlvm\" {\n  name                = \"${var.resourcegroup}-vnet\"\n  address_space       = [\"172.20.0.0\/24\"]\n  location            = azurerm_resource_group.sqlvm.location\n  resource_group_name = azurerm_resource_group.sqlvm.name\n}\n\nresource \"azurerm_subnet\" \"internal\" {\n  name                 = \"default\"\n  resource_group_name  = var.resourcegroup\n  virtual_network_name = azurerm_virtual_network.sqlvm.name\n  address_prefix       = \"172.20.0.0\/24\"\n}\n\nresource \"azurerm_template_deployment\" \"sqlvm\" {\n  name                = \"${var.prefix}-template\"\n  resource_group_name = azurerm_resource_group.sqlvm.name\n\n  template_body = data.template_file.sqlvm.rendered\n\n  #DEPLOY\n\n  # =============== PARAMETERS =============== #\n  parameters = {\n    \"location\"                         = var.location                      # Location (westeurope by default)\n    \"networkInterfaceName\"             = \"${var.prefix}-${var.virtualmachinename}-interface\" # Virtual machine interace name\n    \"enableAcceleratedNetworking\"      = \"true\"                            # Enable Accelerating networking (always YES)\n    \"networkSecurityGroupName\"         = \"${var.prefix}-${var.virtualmachinename}-nsg\" # NSG name (computed)\n    \"subnetName\"                       = azurerm_subnet.internal.name      # Resource subnet\n    \"virtualNetworkId\"                 = \"\/subscriptions\/${var.subscriptionId}\/resourceGroups\/${var.resourcegroup}\/providers\/Microsoft.Network\/virtualNetworks\/${var.resourcegroup}-vnet\"\n    \"publicIpAddressName\"              = \"${var.prefix}-${var.virtualmachinename}-ip\" # Public IP Address name (computed)\n    \"publicIpAddressType\"              = \"Dynamic\"                         # Public IP allocation (Dynamic, Static)\n    \"publicIpAddressSku\"               = \"Basic\"                           # Public IP Address sku (None, Basic, Advanced)\n    \"virtualMachineName\"               = \"${var.prefix}-${var.virtualmachinename}\" # Virtual machine name (computed)\n    \"virtualMachineRG\"                 = var.resourcegroup                 # Resource group for resources\n    \"virtualMachineSize\"               = var.virtualMachineSize            # Virtual machine size (Standard_DS13_v2)\n    \"image_ref_offer\"                  = var.image_ref_offer               # SQL Server Image Offer (SQL2017-WS2016, ...)\n    \"image_ref_sku\"                    = var.image_ref_sku                 # SQL Server Image SKU (SQLDEV, ...)\n    \"image_ref_version\"                = var.image_ref_version             # SQL Server Image version (latest, &lt;version number&gt;)\n    \"adminUsername\"                    = var.adminUsername                 # Virtual machine user name\n    \"adminUserPassword\"                = var.adminUserPassword             # Virtual machine user password\n    \"osDiskType\"                       = var.osDiskType                    # OS Disk type (Premium_LRS by default)\n    \"sqlDisklType\"                     = var.sqlDisklType                  # SQL Disk type Premium_LRS by default)\n    \"diskSqlSizeGB\"                    = var.diskSqlSizeGB                 # SQL Disk size (GB)\n    \"diagnosticsStorageAccountName\"    = var.diagnosticsStorageAccountName # Diagnostics info - storage account name\n    \"diagnosticsStorageAccountId\"      = \"\/subscriptions\/${var.subscriptionId}\/resourceGroups\/${var.resourcegroup}\/providers\/Microsoft.Storage\/storageAccounts\/${var.diagnosticsStorageAccountName}\" # Storage account must exist\n    \"diagnosticsStorageAccountType\"    = \"Standard_LRS\"                    # Diagnostics info - storage account type\n    \"diagnosticsStorageAccountKind\"    = \"Storage\"                         # Diagnostics info - storage type\n    \"sqlVirtualMachineLocation\"        = var.sqlVirtualMachineLocation     # Virtual machine location\n    \"sqlVirtualMachineName\"            = \"${var.prefix}-${var.virtualmachinename}\" # Virtual machine name\n    \"sqlServerLicenseType\"             = var.sqlServerLicenseType          # SQL Server license type. - PAYG or AHUB\n    \"sqlConnectivityType\"              = var.sqlConnectivityType           # LOCAL, PRIVATE, PUBLIC\n    \"sqlPortNumber\"                    = var.sqlPortNumber                 # SQL listen port\n    \"sqlStorageDisksCount\"             = var.sqlStorageDisksCount          # Nb of SQL disks to provision\n    \"sqlStorageWorkloadType\"           = var.sqlStorageWorkloadType        # Workload type GENERAL, OLTP, DW\n    \"sqlStorageDisksConfigurationType\" = \"NEW\"                             # Configuration type NEW \n    \"sqlStorageStartingDeviceId\"       = \"2\"                               # Storage starting device id =&gt; Always 2\n    \"sqlStorageDeploymentToken\"        = \"8528\"                            # Deployment Token\n    \"sqlAutopatchingDayOfWeek\"         = var.sqlAutopatchingDayOfWeek      # Day of week to apply the patch on. - Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday\n    \"sqlAutopatchingStartHour\"         = var.sqlAutopatchingStartHour      # Hour of the day when patching is initiated. Local VM time\n    \"sqlAutopatchingWindowDuration\"    = var.sqlAutopatchingWindowDuration # Duration of patching\n    \"sqlAuthenticationLogin\"           = var.sqlAuthenticationLogin        # Login SQL\n    \"sqlAuthUpdatePassword\"            = var.sqlAuthenticationPassword     # Login SQL Password\n    \"rServicesEnabled\"                 = \"false\"                           # No need to enable R services\n    \"tag\"                              = var.tag                           # Resource tags\n  }\n\n  deployment_mode = \"Incremental\"                                          # Deployment =&gt; incremental (complete is too destructive in our case) \n}\n\n<\/pre>\n<ul>\n<li>The SQL Server template from customized from <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/templates\/microsoft.sqlvirtualmachine\/2017-03-01-preview\/sqlvirtualmachines\">SqlVirtualMachine\/SqlVirtualMachine<\/a> template. As said previously, the hardest part of the deployment. Hope to see it removed in the future!<\/li>\n<\/ul>\n<pre class=\"brush: xml; gutter: true; first-line: 1\">{\n    \"$schema\": \"http:\/\/schema.management.azure.com\/schemas\/2015-01-01\/deploymentTemplate.json#\",\n    \"contentVersion\": \"1.0.0.0\",\n    \"parameters\": {\n        \"location\": {\n            \"type\": \"string\"\n        },\n        \"networkInterfaceName\": {\n            \"type\": \"string\"\n        },\n        \"enableAcceleratedNetworking\": {\n            \"type\": \"string\"\n        },\n        \"networkSecurityGroupName\": {\n            \"type\": \"string\"\n        },\n        \"subnetName\": {\n            \"type\": \"string\"\n        },\n        \"virtualNetworkId\": {\n            \"type\": \"string\"\n        },\n        \"publicIpAddressName\": {\n            \"type\": \"string\"\n        },\n        \"publicIpAddressType\": {\n            \"type\": \"string\"\n        },\n        \"publicIpAddressSku\": {\n            \"type\": \"string\"\n        },\n        \"virtualMachineName\": {\n            \"type\": \"string\"\n        },\n        \"virtualMachineRG\": {\n            \"type\": \"string\"\n        },\n        \"osDiskType\": {\n            \"type\": \"string\"\n        },\n        \"virtualMachineSize\": {\n            \"type\": \"string\"\n        },\n        \"image_ref_offer\": {\n            \"type\": \"string\"\n        },\n        \"image_ref_sku\": {\n            \"type\": \"string\"\n        },\n        \"image_ref_version\": {\n            \"type\": \"string\"\n        },\n        \"adminUsername\": {\n            \"type\": \"string\"\n        },\n        \"adminUserPassword\": {\n            \"type\": \"string\"\n        },\n        \"diagnosticsStorageAccountName\": {\n            \"type\": \"string\"\n        },\n        \"diagnosticsStorageAccountId\": {\n            \"type\": \"string\"\n        },\n        \"diagnosticsStorageAccountType\": {\n            \"type\": \"string\"\n        },\n        \"diagnosticsStorageAccountKind\": {\n            \"type\": \"string\"\n        },\n        \"sqlVirtualMachineLocation\": {\n            \"type\": \"string\"\n        },\n        \"sqlVirtualMachineName\": {\n            \"type\": \"string\"\n        },\n        \"sqlServerLicenseType\": {\n            \"type\": \"string\"  \n        },\n        \"sqlConnectivityType\": {\n            \"type\": \"string\"\n        },\n        \"sqlPortNumber\": {\n            \"type\": \"string\"\n        },\n        \"sqlStorageDisksCount\": {\n            \"type\": \"string\"\n        },\n        \"sqlDisklType\": {\n            \"type\": \"string\"\n        },\n        \"diskSqlSizeGB\": {\n            \"type\": \"string\"\n        },\n        \"sqlStorageWorkloadType\": {\n            \"type\": \"string\"\n        },\n        \"sqlStorageDisksConfigurationType\": {\n            \"type\": \"string\"\n        },\n        \"sqlStorageStartingDeviceId\": {\n            \"type\": \"string\"\n        },\n        \"sqlStorageDeploymentToken\": {\n            \"type\": \"string\"\n        },\n        \"sqlAutopatchingDayOfWeek\": {\n            \"type\": \"string\"\n        },\n        \"sqlAutopatchingStartHour\": {\n            \"type\": \"string\"\n        },\n        \"sqlAutopatchingWindowDuration\": {\n            \"type\": \"string\"\n        },\n        \"sqlAuthenticationLogin\": {\n            \"type\": \"string\"\n        },\n        \"sqlAuthUpdatePassword\": {\n            \"type\": \"string\"\n        },\n        \"rServicesEnabled\": {\n            \"type\": \"string\"\n        },\n        \"tag\": {\n            \"type\": \"string\"\n        }\n    },\n    \"variables\": {\n        \"nsgId\": \"[resourceId(resourceGroup().name, 'Microsoft.Network\/networkSecurityGroups', parameters('networkSecurityGroupName'))]\",\n        \"vnetId\": \"[parameters('virtualNetworkId')]\",\n        \"subnetRef\": \"[concat(variables('vnetId'), '\/subnets\/', parameters('subnetName'))]\",\n        \"dataDisks\": [\n            {\n                    \"lun\": \"0\",\n                    \"createOption\": \"empty\",\n                    \"caching\": \"ReadOnly\",\n                    \"writeAcceleratorEnabled\": false,\n                    \"id\": null,\n                    \"name\": null,\n                    \"storageAccountType\": \"[parameters('sqlDisklType')]\",\n                    \"diskSizeGB\": \"[int(parameters('diskSqlSizeGB'))]\"\n            }\n        ]\n    },\n    \"resources\": [\n        {\n            \"name\": \"[parameters('networkInterfaceName')]\",\n            \"type\": \"Microsoft.Network\/networkInterfaces\",\n            \"apiVersion\": \"2018-10-01\",\n            \"location\": \"[parameters('location')]\",\n            \"dependsOn\": [\n                \"[concat('Microsoft.Network\/networkSecurityGroups\/', parameters('networkSecurityGroupName'))]\",\n                \"[concat('Microsoft.Network\/publicIpAddresses\/', parameters('publicIpAddressName'))]\"\n            ],\n            \"properties\": {\n                \"ipConfigurations\": [\n                    {\n                        \"name\": \"ipconfig1\",\n                        \"properties\": {\n                            \"subnet\": {\n                                \"id\": \"[variables('subnetRef')]\"\n                            },\n                            \"privateIPAllocationMethod\": \"Dynamic\",\n                            \"publicIpAddress\": {\n                                \"id\": \"[resourceId(resourceGroup().name, 'Microsoft.Network\/publicIpAddresses', parameters('publicIpAddressName'))]\"\n                            }\n                        }\n                    }\n                ],\n                \"enableAcceleratedNetworking\": \"[parameters('enableAcceleratedNetworking')]\",\n                \"networkSecurityGroup\": {\n                    \"id\": \"[variables('nsgId')]\"\n                }\n            },\n            \"tags\": {\n                \"Environment\": \"[parameters('tag')]\"\n            }\n        },\n        {\n            \"name\": \"[parameters('networkSecurityGroupName')]\",\n            \"type\": \"Microsoft.Network\/networkSecurityGroups\",\n            \"apiVersion\": \"2019-02-01\",\n            \"location\": \"[parameters('location')]\",\n            \"properties\": {\n                \"securityRules\": [\n                    {\n                        \"name\": \"RDP\",\n                        \"properties\": {\n                            \"priority\": 300,\n                            \"protocol\": \"TCP\",\n                            \"access\": \"Allow\",\n                            \"direction\": \"Inbound\",\n                            \"sourceAddressPrefix\": \"*\",\n                            \"sourcePortRange\": \"*\",\n                            \"destinationAddressPrefix\": \"*\",\n                            \"destinationPortRange\": \"3389\"\n                        }\n                    }\n                ]\n            },\n            \"tags\": {\n                \"Environment\": \"[parameters('tag')]\"\n            }\n        },\n        {\n            \"name\": \"[parameters('publicIpAddressName')]\",\n            \"type\": \"Microsoft.Network\/publicIpAddresses\",\n            \"apiVersion\": \"2019-02-01\",\n            \"location\": \"[parameters('location')]\",\n            \"properties\": {\n                \"publicIpAllocationMethod\": \"[parameters('publicIpAddressType')]\"\n            },\n            \"sku\": {\n                \"name\": \"[parameters('publicIpAddressSku')]\"\n            },\n            \"tags\": {\n                \"Environment\": \"[parameters('tag')]\"\n            }\n        },\n        {\n            \"name\": \"[parameters('virtualMachineName')]\",\n            \"type\": \"Microsoft.Compute\/virtualMachines\",\n            \"apiVersion\": \"2018-10-01\",\n            \"location\": \"[parameters('location')]\",\n            \"dependsOn\": [\n                \"[concat('Microsoft.Network\/networkInterfaces\/', parameters('networkInterfaceName'))]\",\n                \"[concat('Microsoft.Storage\/storageAccounts\/', parameters('diagnosticsStorageAccountName'))]\"\n            ],\n            \"properties\": {\n                \"hardwareProfile\": {\n                    \"vmSize\": \"[parameters('virtualMachineSize')]\"\n                },\n                \"storageProfile\": {\n                    \"osDisk\": {\n                        \"createOption\": \"fromImage\",\n                        \"managedDisk\": {\n                            \"storageAccountType\": \"[parameters('osDiskType')]\"\n                        }\n                    },\n                    \"imageReference\": {\n                        \"publisher\": \"MicrosoftSQLServer\",\n                        \"offer\": \"[parameters('image_ref_offer')]\",\n                        \"sku\": \"[parameters('image_ref_sku')]\",\n                        \"version\": \"[parameters('image_ref_version')]\"\n                    },\n                    \"copy\": [\n                        {\n                            \"name\": \"dataDisks\",\n                            \"count\": \"[length(variables('dataDisks'))]\",\n                            \"input\": {\n                                \"lun\": \"[variables('dataDisks')[copyIndex('dataDisks')].lun]\",\n                                \"createOption\": \"[variables('dataDisks')[copyIndex('dataDisks')].createOption]\",\n                                \"caching\": \"[variables('dataDisks')[copyIndex('dataDisks')].caching]\",\n                                \"writeAcceleratorEnabled\": \"[variables('dataDisks')[copyIndex('dataDisks')].writeAcceleratorEnabled]\",\n                                \"diskSizeGB\": \"[variables('dataDisks')[copyIndex('dataDisks')].diskSizeGB]\",\n                                \"managedDisk\": {\n                                    \"id\": \"[coalesce(variables('dataDisks')[copyIndex('dataDisks')].id, if(equals(variables('dataDisks')[copyIndex('dataDisks')].name, json('null')), json('null'), resourceId('Microsoft.Compute\/disks', variables('dataDisks')[copyIndex('dataDisks')].name)))]\",\n                                    \"storageAccountType\": \"[variables('dataDisks')[copyIndex('dataDisks')].storageAccountType]\"\n                                }\n                            }\n                        }\n                    ]\n                },\n                \"networkProfile\": {\n                    \"networkInterfaces\": [\n                        {\n                            \"id\": \"[resourceId('Microsoft.Network\/networkInterfaces', parameters('networkInterfaceName'))]\"\n                        }\n                    ]\n                },\n                \"osProfile\": {\n                    \"computerName\": \"[parameters('virtualMachineName')]\",\n                    \"adminUsername\": \"[parameters('adminUsername')]\",\n                    \"adminPassword\": \"[parameters('adminUserPassword')]\",\n                    \"windowsConfiguration\": {\n                        \"enableAutomaticUpdates\": true,\n                        \"provisionVmAgent\": true\n                    }\n                },\n                \"licenseType\": \"Windows_Server\",\n                \"diagnosticsProfile\": {\n                    \"bootDiagnostics\": {\n                        \"enabled\": true,\n                        \"storageUri\": \"[concat('https:\/\/', parameters('diagnosticsStorageAccountName'), '.blob.core.windows.net\/')]\"\n                    }\n                }\n            },\n            \"tags\": {\n                \"Environment\": \"[parameters('tag')]\"\n            }\n        },\n        {\n            \"name\": \"[parameters('diagnosticsStorageAccountName')]\",\n            \"type\": \"Microsoft.Storage\/storageAccounts\",\n            \"apiVersion\": \"2018-07-01\",\n            \"location\": \"[parameters('location')]\",\n            \"properties\": {},\n            \"sku\": {\n                \"name\": \"[parameters('diagnosticsStorageAccountType')]\"\n            },\n            \"tags\": {\n                \"Environment\": \"[parameters('tag')]\"\n            }\n        },\n        {\n            \"name\": \"[parameters('sqlVirtualMachineName')]\",\n            \"type\": \"Microsoft.SqlVirtualMachine\/SqlVirtualMachines\",\n            \"apiVersion\": \"2017-03-01-preview\",\n            \"location\": \"[parameters('sqlVirtualMachineLocation')]\",\n            \"properties\": {\n                \"virtualMachineResourceId\": \"[resourceId('Microsoft.Compute\/virtualMachines', parameters('sqlVirtualMachineName'))]\",\n                \"sqlServerLicenseType\": \"[parameters('sqlServerLicenseType')]\",\n                \"AutoPatchingSettings\": {\n                    \"Enable\": true,\n                    \"DayOfWeek\": \"[parameters('sqlAutopatchingDayOfWeek')]\",\n                    \"MaintenanceWindowStartingHour\": \"[parameters('sqlAutopatchingStartHour')]\",\n                    \"MaintenanceWindowDuration\": \"[parameters('sqlAutopatchingWindowDuration')]\"\n                },\n                \"KeyVaultCredentialSettings\": {\n                    \"Enable\": false,\n                    \"CredentialName\": \"\"\n                },\n                \"ServerConfigurationsManagementSettings\": {\n                    \"SQLConnectivityUpdateSettings\": {\n                        \"ConnectivityType\": \"[parameters('sqlConnectivityType')]\",\n                        \"Port\": \"[parameters('sqlPortNumber')]\",\n                        \"SQLAuthUpdateUserName\": \"[parameters('sqlAuthenticationLogin')]\",\n                        \"SQLAuthUpdatePassword\": \"[parameters('sqlAuthUpdatePassword')]\"\n                    },\n                    \"SQLWorkloadTypeUpdateSettings\": {\n                        \"SQLWorkloadType\": \"[parameters('sqlStorageWorkloadType')]\"\n                    },\n                    \"SQLStorageUpdateSettings\": {\n                        \"DiskCount\": \"[parameters('sqlStorageDisksCount')]\",\n                        \"DiskConfigurationType\": \"[parameters('sqlStorageDisksConfigurationType')]\",\n                        \"StartingDeviceID\": \"[parameters('sqlStorageStartingDeviceId')]\"\n                    },\n                    \"AdditionalFeaturesServerConfigurations\": {\n                        \"IsRServicesEnabled\": \"[parameters('rServicesEnabled')]\"\n                    }\n                }\n            },\n            \"dependsOn\": [\n                \"[resourceId('Microsoft.Compute\/virtualMachines', parameters('sqlVirtualMachineName'))]\"\n            ],\n            \"tags\": {\n                \"Environment\": \"[parameters('tag')]\"\n            }\n        }\n    ],\n    \"outputs\": {\n        \"adminUsername\": {\n            \"type\": \"string\",\n            \"value\": \"[parameters('adminUsername')]\"\n        }\n    }\n}<\/pre>\n<ul>\n<li>The terraform.tfvars file. This file (with sensible parameters) should never checked into source control obviously<\/li>\n<\/ul>\n<pre class=\"brush: text; gutter: true; first-line: 1\"># VM configuration\nsubscriptionId=\"xxxxxxx\"\nresourcegroup=\"external-rg\"\nvirtualMachineSize=\"Standard_DS13_v2\"\nvirtualmachinename=\"sql1\"\nadminUsername=\"clustadmin\"\nadminUserPassword=\"xxxxxx\"\ndiagnosticsStorageAccountName=\"dab\"\ntag=\"SQLDEV\"\n\n# Image reference configuration\nimage_ref_offer=\"SQL2017-WS2016\"\nimage_ref_sku=\"SQLDEV\"\nimage_ref_version=\"latest\"\n\n# SQL configuration\nsqlServerLicenseType=\"PAYG\"\nsqlAuthenticationLogin=\"sqladmin\"\nsqlAuthenticationPassword=\"xxxxx\"\nsqlConnectivityType=\"Public\"\ndiskSqlSizeGB=\"1024\"\nsqlStorageWorkloadType=\"OLTP\"\nsqlPortNumber=\"5040\"\nsqlAutopatchingDayOfWeek=\"Sunday\"\nsqlAutopatchingStartHour=\"2\"\nsqlAutopatchingWindowDuration=\"60\"<\/pre>\n<p>This is up to you to customize this template for your own purpose. Let&#8217;s deploy it:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">$ terraform refresh --var-file=vm.tfvars\ndata.template_file.sqlvm: Refreshing state...\n\nazurerm_template_deployment.sqlvm: Creating...\nazurerm_template_deployment.sqlvm: Still creating... [10s elapsed]\nazurerm_template_deployment.sqlvm: Still creating... [20s elapsed]\nazurerm_template_deployment.sqlvm: Still creating... [30s elapsed]\nazurerm_template_deployment.sqlvm: Still creating... [40s elapsed]\n...<\/pre>\n<p>Few minutes afterwards, my SQL Server VM on Azure is provisioned<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">$ az resource list --tag Environment=SQLDEV --query \"[].{resource:resourceGroup,name:name,location:location,Type:type}\" --out table\nResource     Name                                                Location    Type\n-----------  --------------------------------------------------  ----------  ----------------------------------------------\nEXTERNAL-RG  dbi-sql1_disk2_1cacce801795410fb406844cfb1f9317     westeurope  Microsoft.Compute\/disks\nEXTERNAL-RG  dbi-sql1_OsDisk_1_78558bdf9a9648f29d78cfbb36d9bed9  westeurope  Microsoft.Compute\/disks\nexternal-rg  dbi-sql1                                            westeurope  Microsoft.Compute\/virtualMachines\nexternal-rg  dbi-sql1-interface                                  westeurope  Microsoft.Network\/networkInterfaces\nexternal-rg  dbi-sql1-nsg                                        westeurope  Microsoft.Network\/networkSecurityGroups\nexternal-rg  dbi-sql1-ip                                         westeurope  Microsoft.Network\/publicIPAddresses\nexternal-rg  dbi-sql1                                            westeurope  Microsoft.SqlVirtualMachine\/SqlVirtualMachines\nexternal-rg  dab                                                 westeurope  Microsoft.Storage\/storageAccounts<\/pre>\n<p>Happy deployment !!<\/p>\n<p><span style=\"float: none; background-color: #ffffff; color: #333333; cursor: text; font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none;\">By David Barbarin<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are entering now to the infrastructure as code world and provisioning a SQL Server infrastructure is not excluded from the equation. This is especially true when it comes the Cloud regardless we are using IaaS or PaaS. One great tool to use in such scenario is certainly terraform and I introduced it during the [&hellip;]<\/p>\n","protected":false},"author":26,"featured_media":12616,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[955,1320,99],"tags":[1338,1642,151,1643,770,51,1340],"type_dbi":[],"class_list":["post-12615","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-devops","category-sql-server","tag-azure","tag-azure-virtual-machine","tag-devops","tag-idempotent-infrastructure","tag-provisioning","tag-sql-server","tag-terraform"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Deploying SQL Server on Azure virtual machine with Terraform - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deploying SQL Server on Azure virtual machine with Terraform\" \/>\n<meta property=\"og:description\" content=\"We are entering now to the infrastructure as code world and provisioning a SQL Server infrastructure is not excluded from the equation. This is especially true when it comes the Cloud regardless we are using IaaS or PaaS. One great tool to use in such scenario is certainly terraform and I introduced it during the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-02T15:08:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-17T12:46:11+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/157-0-terraform_sql_vm_azure-e1562085022500.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"215\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Microsoft Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Microsoft Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/\"},\"author\":{\"name\":\"Microsoft Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"headline\":\"Deploying SQL Server on Azure virtual machine with Terraform\",\"datePublished\":\"2019-07-02T15:08:04+00:00\",\"dateModified\":\"2023-07-17T12:46:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/\"},\"wordCount\":1048,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/157-0-terraform_sql_vm_azure-e1562085022500.jpg\",\"keywords\":[\"Azure\",\"Azure virtual machine\",\"DevOps\",\"Idempotent infrastructure\",\"Provisioning\",\"SQL Server\",\"Terraform\"],\"articleSection\":[\"Cloud\",\"DevOps\",\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/\",\"name\":\"Deploying SQL Server on Azure virtual machine with Terraform - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/157-0-terraform_sql_vm_azure-e1562085022500.jpg\",\"datePublished\":\"2019-07-02T15:08:04+00:00\",\"dateModified\":\"2023-07-17T12:46:11+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/157-0-terraform_sql_vm_azure-e1562085022500.jpg\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/157-0-terraform_sql_vm_azure-e1562085022500.jpg\",\"width\":500,\"height\":215},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deploying SQL Server on Azure virtual machine with Terraform\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\",\"name\":\"Microsoft Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"caption\":\"Microsoft Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Deploying SQL Server on Azure virtual machine with Terraform - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/","og_locale":"en_US","og_type":"article","og_title":"Deploying SQL Server on Azure virtual machine with Terraform","og_description":"We are entering now to the infrastructure as code world and provisioning a SQL Server infrastructure is not excluded from the equation. This is especially true when it comes the Cloud regardless we are using IaaS or PaaS. One great tool to use in such scenario is certainly terraform and I introduced it during the [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/","og_site_name":"dbi Blog","article_published_time":"2019-07-02T15:08:04+00:00","article_modified_time":"2023-07-17T12:46:11+00:00","og_image":[{"width":500,"height":215,"url":"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/157-0-terraform_sql_vm_azure-e1562085022500.jpg","type":"image\/jpeg"}],"author":"Microsoft Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Microsoft Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/"},"author":{"name":"Microsoft Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"headline":"Deploying SQL Server on Azure virtual machine with Terraform","datePublished":"2019-07-02T15:08:04+00:00","dateModified":"2023-07-17T12:46:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/"},"wordCount":1048,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/157-0-terraform_sql_vm_azure-e1562085022500.jpg","keywords":["Azure","Azure virtual machine","DevOps","Idempotent infrastructure","Provisioning","SQL Server","Terraform"],"articleSection":["Cloud","DevOps","SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/","url":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/","name":"Deploying SQL Server on Azure virtual machine with Terraform - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/157-0-terraform_sql_vm_azure-e1562085022500.jpg","datePublished":"2019-07-02T15:08:04+00:00","dateModified":"2023-07-17T12:46:11+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/157-0-terraform_sql_vm_azure-e1562085022500.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/157-0-terraform_sql_vm_azure-e1562085022500.jpg","width":500,"height":215},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/deploying-sql-server-on-azure-virtual-machine-with-terraform\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Deploying SQL Server on Azure virtual machine with Terraform"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4","name":"Microsoft Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","caption":"Microsoft Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=12615"}],"version-history":[{"count":1,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12615\/revisions"}],"predecessor-version":[{"id":26734,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/12615\/revisions\/26734"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/12616"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=12615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=12615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=12615"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=12615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}