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

Running Export-M365DSCConfiguration on Azure Automation Runbook does not export files #5494

Open
xxwdxbg opened this issue Dec 2, 2024 · 1 comment

Comments

@xxwdxbg
Copy link

xxwdxbg commented Dec 2, 2024

I have updated all the dependencies in the Azure Automation account using the script provided https://github.com/microsoft/Microsoft365DSC/issues/2050#issuecomment-1195414547 I verified that each module has been successfully imported and applied all the necessary API permissions to my app. Additionally, I am using a managed identity to export M365DSC. However, while running Export-M365DSCConfiguration thrugh Azure Runbook returns empty data.

I cannot check the file under $tempPath.

Image

The script i am using is simply,

Parameters

$tenantId = "XXX"
$resourceGroup = #"XXX"

Connect-AzAccount -Identity

Export Teams workload details with verbose output

Write-Output "Exporting Teams Meeting Policy details..."
try {
Set-Location -Path $tempPath
Export-M365DSCConfiguration -ManagedIdentity -Components @("TeamsMeetingPolicy") -TenantID $tenantId -Verbose
Write-Output "Export completed successfully. Check $tempPath for generated files."
} catch {
Write-Error "Failed to export Teams details. Error: $_"
exit 1
}

Locate the generated output file

$exportedFile = Get-ChildItem -Path $tempPath -Filter "*.ps1" | Select-Object -First 1
if (-not $exportedFile) {
Write-Error "No exported file found in $tempPath. Verify if Export-M365DSCConfiguration is working correctly."
exit 1
}
Write-Output "Found exported file: $exportedFile"

@FabienTschanz
Copy link
Contributor

@xxwdxbg It could be the case that the worker underneath the runbook ran out of memory and therefore didn't finish the execution. Any chance you can setup a hybrid worker and run it there? This is also most likely better as soon as you're using it for more components, where the memory consumption will overshoot 400MB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants