Azure Automation and Octopus Tenacle

Hi,

I am trying to use Azure Automation to install and configure a polling tentacle with OctopusDSC. In my scenario the steps as as follows

  1. Azure ARM resource group is deployed from a template. Each VM in the template is configured with DSC extension to enroll Azure automation account.
  2. Azure Automation DSC kicsoff in (0-30 minutes) and runs cTentacleAgent OctopusTentacle

What I am seeing is that the DSc from step2 fails with error

  	"InnerException": {
			"ErrorRecord": "Command returned exit code 100",
			"Message": "Command returned exit code 100",
			"InnerException": "System.Management.Automation.RuntimeException: Command returned exit code 100",
			"TargetSite": "System.Collections.ObjectModel.Collection`1[System.Management.Automation.PSObject] Invoke(System.Collections.IEnumerable)",
							"StackTrace": "   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)   
				at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)   
				at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)   
				at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)   
				at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)   
				at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)   
				at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.ExecuteCommand(PowerShell powerShell, ResourceModuleInfo resInfo, String operationCmd, List`1 acceptedProperties, CimInstance nonResourcePropeties, CimInstance resourceConfiguration, LCMDebugMode debugMode, PSInvocationSettings pSInvocationSettings, UInt32u0026 resultStatusHandle, Collection`1u0026 result, ErrorRecordu0026 errorRecord, PSModuleInfo localRunSpaceModuleInfo)",
			"Source": "System.Management.Automation",
		},

Interstingly the subsequent cycles of DSC think the VM is compliant. When I looked into the VM I can see that the tentacle is installed but not configured. If I remove the tentacle instance and run the DSC configuration from the server it works fine and tentacle is added to Octopus server.

Following are two item I can suggest as improvements for this module

  • I found this is related to http://help.octopusdeploy.com/discussions/problems/13114-tentacle-new-certificate-throwing-unauthorisedaccessexception. The server does not have profile loaded and so tentacle configuration fails, It would have been nice if the error message was in DSC logs shows what tentacle.exe returned rather than “Command returned exit code 100”.
  • The reason why subsequent DSC run shows the machine is complaint is that cTentacleAgent module doesn’t truly check if tentacle is configured it checks if tentacle is installed and configuration was started. A placeholder file is placed when configuration is started which is checked in subsequent runs. Probably it would be better if this file is placed when all tentacle.exe steps run without error.

Kamal

Hi Kamal,

Thanks for getting in touch! I ran this past one of our developers and we have some points/ideas to pass onto you that may help answer your questions.

To start off, to help us identify exactly what is going on here, would you be able to screenshot/paste the contents of the DSC event log to see what it says?
The name of this event is Microsoft-Windows-Dsc\Operational.

For the subsequently run tasks issue you are having, it looks like it could be related to a known issue on our GitHub, the following link should give you a bit more technical information surrounding it. https://github.com/OctopusDeploy/OctopusDSC/issues/24

While we have done a lot of work with DSC recently, putting it in a much better place, I do not believe we have fixed either of the two issues that you have mentioned. We are hoping to continue with the improvements to the DSC in Q1 next year, but we cannot commit to that at this point unfortunately.

Also, as a note, our OctopusDSC is open-source, please feel welcome to make any contributions you would like. :slight_smile:

Let me know what you think.

Best regards,
Daniel