Skip to content

Commit 3a63aa2

Browse files
authored
Do not load ALC assembly in windows PowerShell (#16679)
* do not remove the dll * update changelog
1 parent c69ecb4 commit 3a63aa2

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

src/Accounts/Accounts/Az.Accounts.psd1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ DotNetFrameworkVersion = '4.7.2'
5757

5858
# Assemblies that must be loaded prior to importing this module
5959
RequiredAssemblies = 'Microsoft.Azure.PowerShell.Authentication.Abstractions.dll',
60-
'Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll',
6160
'Microsoft.Azure.PowerShell.Authentication.dll',
6261
'Microsoft.Azure.PowerShell.Authenticators.dll',
6362
'Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll',

src/Accounts/Accounts/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020

2121
## Upcoming Release
22+
* Fixed the issue that Azure PowerShell could not work in a workflow. [#16408]
2223
* Fixed the doubled Api Version in the URI of the underlying request issued by `Invoke-AzRestMethod`. [#16615]
2324

2425
## Version 2.7.0

src/Accounts/Accounts/StartupScripts/InitializeAssemblyResolver.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
}
99
else {
1010
try {
11+
Add-Type -Path ([System.IO.Path]::Combine($PSScriptRoot, "..", "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll")) | Out-Null
1112
$assemblyLoadContextFolder = [System.IO.Path]::Combine($PSScriptRoot, "..", "AzSharedAlcAssemblies")
1213
Write-Debug "Registering Az shared AssemblyLoadContext for path: '$assemblyLoadContextFolder'."
1314
[Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.AzAssemblyLoadContextInitializer]::RegisterAzSharedAssemblyLoadContext($assemblyLoadContextFolder)

tools/CleanupBuild.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ foreach($RMPath in $resourceManagerPaths)
4848

4949
Import-LocalizedData -BindingVariable ModuleMetadata -BaseDirectory $psd1.DirectoryName -FileName $psd1.Name
5050

51-
$acceptedDlls = @()
51+
$acceptedDlls = @(
52+
# netcoreapp, can't be in RequiredAssemblies, but we need to pack it
53+
"Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll"
54+
)
5255

5356
# NestedModule Assemblies may have a folder path, just getting the dll name alone
5457
foreach($cmdAssembly in $ModuleMetadata.NestedModules)

0 commit comments

Comments
 (0)