Azure DevOps - PowerShell Desired State Configuration - Extension - Resources Create a Windows VM and open port 80 in the Azure portal. C...
Azure DevOps - PowerShell Desired State Configuration - Extension - Resources
Create a Windows VM and open port 80 in the Azure portal.
Create a file named WebRole.ps1 and add the following contents
- Configuration DScConfiguration {
- Node $AllNodes.Where{$_.Role -eq "WebServer"}.NodeName
- {
- WindowsFeature IISInstall {
- Ensure = 'Present'
- Name = 'Web-Server'
- }
- }}
You need to zip this file
Create a data configuration file as InstallWebconfig.psd1 and add the following contents
- @{
- AllNodes = @(
- @{
- NodeName = "localhost"
- Role = "WebServer"
- }
- )
- }
Upload these files to a storage account.
In the VM select Extensions + applications and Add PowerShell Desired Configuration with the below details.
Click on Review + Create
Once the extension is added then you can browse the default IIS Page on the browser with VM public IP Address.
COMMENTS