-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start-AzAutomationDscCompilationJob hangs if the compilation job fails #8347
Comments
The issue is also present in Windows PowerShell, not just PowerShell Core. |
@janegilring Is this occurring for a particular compilat_on job, or for any compilation job?_ |
@vrdmr can you take a look? |
@markcowl Any compilation jobs which ends in a Suspended state. |
I see the same issue. This defeats the purpose of having the while loop afterwards that can check for status (as shown in the example: https://docs.microsoft.com/en-us/azure/automation/automation-dsc-compile#compiling-a-dsc-configuration-with-windows-powershell) |
@avkaur can you take a look? |
Thank you for the ping @vrdmr, and thank you for submitting this, @janegilring. We will take a look. This only happens when the job reaches a suspended compilation, correct? |
@mgreenegit Yes, that is correct. |
@avkaur can you ack you will take this? |
hey @mgreenegit, I've just looked into this issue. I'm able to repro it. The issue is the code is making a synchronous call to create the compilation job but that call doesn't end till the job completes, as the job gets suspended, then it never completes and that's why the behavior. Based on the cmdlet name, this cmdlet is only expected to start the job and return with job information to monitor further as this link explains; so, adjusting the code to use an async call would fix this and give this expected behavior. However, current behavior for this cmdlet is totally different and this change might be a breaking change as people are used to have control back only once the DSC configuration is compiled (also, not sure if I'm going to further the grammar here but documentation for the cmdlet says "compiles an APS Desired State Configuration (DSC) configuration in Azure Automation". So, question is, what should it be done? Restore the cmdlet to its original expectation and notify the breaking change OR adjust it to work properly with this limitation avoiding to introduce changes to its current behavior. Thoughts? (Personal vote is to restore it to its original spirit by doing an async call and returning job information for monitoring as the cmdlet verb is "Start") |
My vote: Restore the cmdlet to its original expectation and notify the breaking change, as I have existing scripts/runbooks which relies on this behavior. |
I agree that we should restore the cmdlet to its original expectation. The docs clearly show this was the intention and I would wager many people have implemented the code as the example shows. |
More importantly, though, there is no way for us to work around this behavior now since it causes our PowerShell window to hang. |
Just in case, I agree with @jordanbean1 and @janegilring as all the documentation points that use case instead of the currently implemented. My PR creates that behavior. |
Fix Start-AzAutomationDscCompilationJob (Issue #8347)
Looks like this was fixed by community member lwajswaj. Thank you! |
Awesome, thank you! |
Description
When compiling a PowerShell DSC configuration using Start-AzAutomationDscCompilationJob in PowerShell Core, the compilation job hangs. It is not possible to abort by using Ctrl + C, you will have to close and re-open PowerShell Core.
Script/Steps for Reproduction
Module Version
Environment Data
Debug Output
The text was updated successfully, but these errors were encountered: