Skip to content

Instantly share code, notes, and snippets.

@gavincampbell
Created January 25, 2020 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gavincampbell/6b24b858916fb5ea675c9e9e19a405a5 to your computer and use it in GitHub Desktop.
Save gavincampbell/6b24b858916fb5ea675c9e9e19a405a5 to your computer and use it in GitHub Desktop.
{
"variables": {
"build_location": "uksouth",
"build_vm_size": "Standard_DS2_v2",
"sp_client_id": "{{env `PACKER_CLIENT_ID`}}",
"sp_client_secret": "{{env `PACKER_CLIENT_SECRET`}}",
"sp_tenant_id": "{{env `PACKER_TENANT_ID`}}",
"sp_subscription_id": "{{env `PACKER_SUBSCRIPTION_ID`}}",
"output_resource_group" : "packer-vm-images",
"output_image_name_prefix" : "sql-2019-win-2019"
},
"builders": [{
"type": "azure-arm",
"client_id": "{{user `sp_client_id`}}",
"client_secret": "{{user `sp_client_secret`}}",
"tenant_id": "{{user `sp_tenant_id`}}",
"subscription_id": "{{user `sp_subscription_id`}}",
"managed_image_resource_group_name":"{{user `output_resource_group`}}",
"managed_image_name": "{{user `output_image_name_prefix`}}-{{isotime | clean_resource_name}}",
"os_type": "Windows",
"image_publisher": "MicrosoftWindowsServer",
"image_offer": "WindowsServer",
"image_sku": "2019-Datacenter",
"communicator": "winrm",
"winrm_use_ssl": true,
"winrm_insecure": true,
"winrm_timeout": "5m",
"winrm_username": "packer",
"azure_tags": {
"dept": "Engineering",
"task": "Image deployment"
},
"location": "{{user `build_location`}}",
"vm_size": "{{user `build_vm_size`}}"
}],
"provisioners": [{
"type": "powershell",
"inline": [
"Write-Host \"Downloading SQL Server Installation Media\"",
"Get-AzureStorageBlobContent -Container \"ContainerName\" -Blob \"Blob\" -Destination \"C:\\test\\\""
]
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment