Configuration would look like:
configuration IISInstall {
node "localhost" { # Ensure applied to this node
WindowsFeature IIS {
Ensure = "Present"
Name = "Web-Server"
}
}
}
In Extensions section of an VM, you need to install PowerShell Desired State Configuration
config.ps1\IISInstall
New-AzureRmAutomationAccount
)
Import-AzureRmAutomationDscConfiguration
)
Start-AzureRmAutomationDscCompilationJob
)
.moc
(Managed Object Format) file that has C++-like syntax.Register-AzureRmAutomationDscNode
)
Set-AzureRmAutomationDscNode -NodeId $node.Id
)Get-AzureRmAutomationDscNodeReport
)
Add using:
import-module servermanager
add-windowsfeature web-server -includeallsubfeature
{
"name": "MyCustomScriptExtension",
"type": "extensions",
...
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
...
"settings": {
"fileUris": [
"[concat('https://', variables('storageName'),
'.blob.core.windows.net/customscripts/start.ps1')]"
],
"commandToExecute": "powershell.exe -ExecutionPolicy Unrestricted -File start.ps1"
}
}