2

I have three projects in a single solution that I want to deploy using RM DSC:

  • a Windows service
  • webUI
  • and a DB project

For the deployment, I have three Azure servers:

  • a SQL box
  • and two App servers

Currently I am able to deploy all three projects successfully in all three servers, but for some new directions from the boss man, I have to deploy my projects as follows:

  1. Windows service project into all three servers
  2. the WebUI into one of the App servers and
  3. The DB project into the SQL box.

My ultimate goal here is copying files that are needed on each of the destination servers only. For example, I would like to only keep the DB files into the DB server and similarly the WebUI files only in the App server.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Ted
  • 65
  • 1
  • 7
  • Are you actually using DSC or just plain PowerShell? – Graham Smith Apr 23 '15 at 06:13
  • I am using DSC and in my solution, I have a Deploy project that houses multiple PowerShell files that defines parameters such as deployment path, NodeName, Roles... My ultimate goal here is copying files that are needed on each of the destination servers only. – Ted Apr 24 '15 at 12:41
  • I've avoided RM DSC as it adds a great deal of complexity that for me isn't warranted or appropriate at the deployment stage. DSC is great of course but I feel it should be used at a higher level to control the complete configuration of servers not just the bits involved with deployment. – Graham Smith Apr 27 '15 at 07:30

1 Answers1

0

You may want to checkout: continuous-deployment-using-dsc-with-minimal-change

Basically, you can use configuration to choose a "server" role type and install different packages for each. However, I find it easier to have a DSC per role type (a.k.a web role versus DB role) to encapsulate functionality (even at the cost of some duplication).

There are a few examples on web for DB install/etc, here is an example of website install: DSC Web Install

I do agree with @Graham Smith, however, on separating deployment from provisioning (vm creation and configuration). I would focus your DSCs on the configuration aspect of provision and use a second step in your overall process to deploy with msdeploy and a tool like fluentmigrator for DB.

EDIT: Added file upload option that works well on Azure (this pattern could be followed for non azure vm's too)

One way I've found to upload files is to wrap the required files in a DSC Resource. For example,

  1. Create a DSC resource that contains file/files you want to access. I've created an example that contains Erlang that I use for installation here
  2. Import the module DSC resource in your DSC: Import-DscResource -ModuleName Erlang
  3. Ensure DSC resource is in your module path
  4. Use Publish-AzureVMDscConfiguration to create zip (that will contain imported DSC Resource).
  5. Your DSC Resource will be in module path "$env:ProgramFiles\WindowsPowerShell\Modules\Erlang\otp_win32_17.5.exe"
Grady G Cooper
  • 1,044
  • 8
  • 19
  • I couldn't find a way to copy specific files onto specific servers for now but the files are not large files so for now I will continue with what I have. The link Grady G Cooper provided is very similar to what I have in my end. – Ted May 13 '15 at 14:31