Wednesday, 23 December 2015

Using Azure Automation DSC to configure and deploy the new SCSM Portal (Part 2)

So in the previous post I outlined creating a basic configuration file for DSC to deploy the new HTML5 Self-Service Portal for System Center 2012 R2 Service Manager.

Previous Post: http://www.systemcenter.ninja/2015/12/using-azure-automation-dsc-to-configure.html

In this post I thought I'd produce a quick video showing adding a server as a DSC node, applying the Configuration to it and checking the configuration applied.

Also, after the video break, I thought I'd detail a couple of additions I made to the configuration that weren't in the first post.



So if you just watched the video you'll have noticed I added a bit more configuration using something called DSC Resources.

Specifically I used xWebAdministration and xNetworking, both of which can be found on the PowerShell Gallery.

http://www.powershellgallery.com/

The PowerShell Gallery is the central repository for PowerShell content. You can find new PowerShell commands or Desired State Configuration (DSC) resources in the Gallery.

xWebAdministration Module - http://www.powershellgallery.com/packages/xWebAdministration/
xNetworking Module - http://www.powershellgallery.com/packages/xNetworking/

Both these modules contain multiple resources that can be used to aid in configuration.

The cool thing here is modules can be either deployed directly from the PowerShell Gallery into your Azure Automation subscription, or along with custom resources, uploaded as a zip file via the Azure Portal.

You can find them within your Assets > Modules section of the portal.



I'm using from the xWebAdministration module the xWebsite resource to change the port of the default web site in IIS from port 80 to 81 so that I can reutilise port 80 for the new SCSM SSP.

I do this by creating a new xWebsite section named DefaultWebsite and then use the BindingInfo section to declare which port the web site (Identified in the Name = "Default Web Site" part) should be using.

xWebsite DefaultWebsite
  {
    Ensure = "Present"
    Name = "Default Web Site"
    State = "Started"
    PhysicalPath = "C:\inetpub\wwwroot"
    BindingInfo = MSFT_xWebBindingInformation
      {
        Protocol = "HTTP"
        Port = 81
      }
    DependsOn = "[WindowsFeature]WebServer"
   }


Deeper details and resources can be found on the projects GitHub site:
https://github.com/PowerShell/xWebAdministration


I'm then doing a similar thing with the xFirewall resource from the xNetworking module to create a new firewall rule

xFirewall SCSMSSPFirewallRule
  {
    Direction = "Inbound"
    Name = "SCSM-SSP-Web-TCP-In"
    DisplayName = "SCSM SSP Web Server (TCP-In)"
    Description = "Allow incoming web site traffic to SCSM SSP."
    DisplayGroup = "PowerONPlatforms"
    Enabled = "True"
    Action = "Allow"
    Protocol = "TCP"
    LocalPort = "80"
    Ensure = "Present"
  }


Deeper details and resources can be found on the projects GitHub site:
https://github.com/PowerShell/xNetworking


This is by no means a production ready example, but does give some basics around using some of the built in resources (WindowsFeature & Package) along with some custom resources (xWebAdministration and xWebsite) and where to go find them (PowerShell Gallery).

Also, please note the SCSM Portal still requires both modifications to the web.config file and the Update 1 hotfix installing afterwards.

https://www.microsoft.com/en-us/download/details.aspx?id=50362



No comments: