Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="AngularJS Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
variable "dsc_key" {
default = "dsc_registration_key_from_portal"
}
variable "dsc_endpoint" {
default = "dsc_registration_url_from_portal"
}
variable dsc_config {
#!/bin/bash
cd /tmp
echo "Onboard Linux VM start" > onboard_vm.txt
echo hello > "script_start.txt"
wget https://github.com/Microsoft/omi/releases/download/v1.4.1-0/omi-1.4.1-0.ssl_100.ulinux.x64.deb
dpkg -i ./omi-1.4.1-0.ssl_100.ulinux.x64.deb
wget https://github.com/Microsoft/PowerShell-DSC-for-Linux/releases/download/v1.1.1-294/dsc-1.1.1-294.ssl_100.x64.deb
variable "dsc_key" {
default = "dsc_registration_key_from_portal"
}
variable "dsc_endpoint" {
default = "dsc_registration_url_from_portal"
}
variable dsc_config {
default = "node_configuration_you_want_applied__can_leave_blank"
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
resource "azurerm_virtual_machine_extension" "dsc" {
name = "DevOpsDSC"
location = "${var.location}"
resource_group_name = "${var.resource_group_name}"
virtual_machine_name = "${var.vm_name}"
publisher = "Microsoft.Powershell"
type = "DSC"
type_handler_version = "2.73"
settings = <<SETTINGS
{
# Arguments;
# 0 - Registration Key : String
# 1 - Registration URL : String
# 2 - Azure Automation DSC Node Configuration : String - Optional
.\DscMetaConfigs.ps1 $args[0] $args[1] $args[2]
Set-DscLocalConfigurationManager -Path ./DscMetaConfigs
# The DSC configuration that will generate metaconfigurations
[DscLocalConfigurationManager()]
Configuration DscMetaConfigs
{
param
(
[Parameter(Mandatory=$True)]
[String]$RegistrationUrl,
[Parameter(Mandatory=$True)]
variable "dsc_key" {
default = "your_azure_automation_key"
}
variable "dsc_endpoint" {
default= "your_azure_automation_endpoint_url"
}
variable "storage_account_key" {
default = "your_storage_account_key_where_scripts_saved"
}
variable dsc_config {
console.log('Loading event');
var AWS = require('aws-sdk');
// Close dialog with the customer
function close(sessionAttributes, fulfillmentState, message) {
return {
sessionAttributes,
dialogAction: {
type: 'ElicitIntent',
message,