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

Issue with Teams export #5553

Open
CiscoZarama opened this issue Dec 13, 2024 · 2 comments
Open

Issue with Teams export #5553

CiscoZarama opened this issue Dec 13, 2024 · 2 comments
Labels
Bug Something isn't working Teams

Comments

@CiscoZarama
Copy link

CiscoZarama commented Dec 13, 2024

Description of the issue

I am exporting a snapshot of our M365 tenant and I have been able to export all configurations but the Teams export is failing with the error below. I have assigned all the requisite APIs and roles to the service principle but I still get the same error. I am also using TLS 1.2 so it is not appear to be a network issue. This appears to be a bug. I searched through the issues reported here and did not find any similar issue reported. .Net is 4.8 or later on my system.

{InvalidOperation}
System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Teams.Policy.Administration.Cmdlets.Providers.HttpClientHelper.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Teams.Policy.Administration.Cmdlets.Providers.HttpRequestHelper1.<GetAllAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Teams.Policy.Administration.Cmdlets.Providers.BaseTpmGetCmdlet1.<>c__DisplayClass8_0.<b__0>d.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Microsoft.Teams.Policy.Administration.Cmdlets.Providers.BaseTpmGetCmdlet1.ProcessRecord()
---> (Inner Exception #0) System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Teams.Policy.Administration.Cmdlets.Providers.HttpClientHelper.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Teams.Policy.Administration.Cmdlets.Providers.HttpRequestHelper1.<GetAllAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Teams.Policy.Administration.Cmdlets.Providers.BaseTpmGetCmdlet1.<>c__DisplayClass8_0.<b__0>d.MoveNext()<---

"Error during Export:"
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1211.1\DSCResources\MSFT_TeamsAppSetupPolicy\MSFT_TeamsAppSetupPolicy.psm1: line 448
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1211.1\Modules\M365DSCReverse.psm1: line 682
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1211.1\Modules\M365DSCUtil.psm1: line 1458
at , : line 1

Microsoft 365 DSC Version

1.24.1211.1

Which workloads are affected

Teams

The DSC configuration

Export-M365DSCConfiguration -Verbose -TenantId 'xxxxxxxx.onmicrosoft.com' -ApplicationId '00000000-0000-0000-000000000000' -CertificateThumbprint '00000000000000000000000000000000' -Path 'C:\Users\\Documents' -Workloads @("Teams")

Verbose logs showing the problem

Error Log created at {file-M365DSC-ErrorLog.log}
[2/51] Extracting [TeamsAppSetupPolicy] using {CertificateThumbprint}...VERBOSE: Attempting connection to {MicrosoftTeams} with:
VERBOSE:
Name                           Value

----                           -----

CertificateThumbprint          00000000000000000000000000000000000000000

TenantId                       xxxxxxxxxxxxxx.onmicrosoft.com

ApplicationId                  00000000-0000-0000-0000-00000000000



VERBOSE: ApplicationId, TenantId, CertificateThumbprint were specified. Connecting via Service Principal
VERBOSE: Calling into Connect-M365Tenant
VERBOSE: Connection initiated.
VERBOSE: Dependencies were already successfully validated.
❌
Error Log created at {file://C:/Users/.../-M365DSC-ErrorLog.log}

Environment Information + PowerShell Version

OsName               : Microsoft Windows 11 Enterprise N
OsOperatingSystemSKU : WindowsEnterprise
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Name                           Value
----                           -----
PSVersion                      5.1.22621.4111
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.4111
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
@ykuijs
Copy link
Member

ykuijs commented Dec 16, 2024

Have you added the Teams service principal to the Teams Administrators role? This is required.

@ykuijs ykuijs added Bug Something isn't working Teams labels Dec 16, 2024
@CiscoZarama
Copy link
Author

Yes, it is assigned to the service principle.

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

No branches or pull requests

2 participants