-1

When I am trying to Add Azure VM to DSC Nodes, it is erroring out Error: VM : Error : Error - Object reference not set to an instance of an object.

The DSC Configuration compiled fine without any errors.

Did anyone face this error before? Google didn't help.

CKS
  • 497
  • 3
  • 9
  • 16
  • so what do the DSC logs say? – 4c74356b41 Jun 18 '17 at 15:35
  • Logs say: Error - Object reference not set to an instance of an object. I tried from PowerShell as well using Register-AzureRmAutomationDscNode I get a different error: \"Can not perform requested operation on nested resource. Parent resource 'VM' not found – CKS Jun 18 '17 at 16:19
  • i doubt that's what dsc logs say, where that comes from? – 4c74356b41 Jun 18 '17 at 16:36
  • 1
    Can you please update the question with an example of your code (to deploy the DSC as well as the DSC itself) and any outputs? – CtrlDot Jun 19 '17 at 02:43
  • @CKs, could you share your OS type? Windows 2012R2 or others? Do you ensure your VM is running? Could you RDP to the VM and check extensiong log? The log path is `C:\WindowsAzure\Logs\Plugins\Microsoft.Powershell.DSC\2.22.0.0`. – Shui shengbao Jun 19 '17 at 05:47
  • @Walter-MSFT this is Windows 2012 r2. .. I am not able to locate this C:\WindowsAzure\Logs\Plugins\Microsoft.Powershell.DSC\2.22.0‌.0 on Windows. I didn't install the PowerShell DSC extension, do I need to manually install PowerShell DSC extension to make DSC work? From my understanding, when we add a node to Automation Account, Powershell DSC extension is installed. Am I wrong? – CKS Jun 19 '17 at 13:50
  • @Walter-MSFT -- I added the extension to the Azure VM, and now I see the logs file path but I still see the same issue and don't see anything related to the issue in the log files. In the activity log of Azure Automation Account, I only see Error - Object reference not set to an instance of an object. – CKS Jun 19 '17 at 15:50

1 Answers1

0

Looks like there is a bug in azure portal when the automation account and VM are in different regions and the VM is part of an availability set.

I was able to successfully add the VM using Register-AzureRmAutomationDscNode.

BSMP
  • 4,596
  • 8
  • 33
  • 44
CKS
  • 497
  • 3
  • 9
  • 16