Skip to content
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

Export-M365DSCConfiguration within Azure Run Book fails due to hardcoded value of $AzureAutomation #2233

Closed
andikrueger opened this issue Aug 26, 2022 · 0 comments · Fixed by #2234 or #2245
Labels
Bug Something isn't working Core Engine

Comments

@andikrueger
Copy link
Collaborator

When running Export-M365DSCConfiguration within Azure Run Books, there is an error about the call to the local configuration manager. This should not happen, as there is a already code to prevent this call. Anyhow, the variable used, to differentiate Azure Automation form other scenarios is hardcoded and set to $false

This variable gets no other assignment afterwards.

This assignment should be change to something like this:

$AzureAutomation = $false 
if ("AzureAutomation/" -eq $env:AZUREPS_HOST_ENVIRONMENT) {
   $AzureAutomation = $true
}

see: https://stackoverflow.com/questions/37224874/what-is-the-correct-way-to-detect-whether-a-script-is-running-in-azure-automatio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Core Engine
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant