Created
January 21, 2018 19:04
-
-
Save divgo/a808ac6a1e9a6bbd78a8ba15e31b338c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "azurerm_virtual_machine_extension" "register_for_dsc" { | |
name = "register_for_dsc" | |
location = "${var.location}" | |
resource_group_name = "${var.resource_group_name}" | |
virtual_machine_name = "${var.vm_name}" | |
publisher = "Microsoft.Compute" | |
type = "CustomScriptExtension" | |
type_handler_version = "1.8" | |
settings = <<SETTINGS | |
{ | |
"fileUris": [ | |
"https://your_storage_account.blob.core.windows.net/scripts/DscMetaConfigs.ps1", | |
"https://your_storage_account.blob.core.windows.net/scripts/Execute_DscScripts.ps1" | |
] | |
} | |
SETTINGS | |
protected_settings = <<PROTECTED_SETTINGS | |
{ | |
"commandToExecute": "powershell.exe -ExecutionPolicy Bypass -File ./Execute_DscScripts.ps1 ${var.dsc_key} ${var.dsc_endpoint} ${var.dsc_config}", | |
"storageAccountName": "your_storage_account", | |
"storageAccountKey": "${var.storage_account_key}" | |
} | |
PROTECTED_SETTINGS | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment