Skip to content

Remove deprecated AzureAD module dependency from build pipeline#1599

Open
givinalis wants to merge 1 commit intomainfrom
fix/remove-azuread-dependency
Open

Remove deprecated AzureAD module dependency from build pipeline#1599
givinalis wants to merge 1 commit intomainfrom
fix/remove-azuread-dependency

Conversation

@givinalis
Copy link
Copy Markdown
Collaborator

Problem

The 1es-EntraPowerShell-PR pipeline is failing at the Install Dependencies Entra step because it attempts to install the AzureAD and AzureADPreview modules from the PowerShell Gallery. These modules have been deprecated by Microsoft and are no longer available for download.

Solution

Instead of dynamically importing the deprecated modules to discover their command lists, the build now uses the existing static mapping files (AzureADToEntraMapping.json and AzureADPreviewToEntraBetaMapping.json) as the source of truth for AzureAD command names.

Changes

  • build/Install-Dependencies.ps1: Skip installing the deprecated source module; only install Microsoft.Graph destination modules
  • src/Get-MissingCmds.ps1: Use mapping file keys as the command list instead of importing the module
  • src/CompatibilityAdapterBuilder.ps1: Skip Import-Module of source module in Configure(); add fallback in GetModuleCommands() to read from mapping files when module is unavailable

Validation

  • Verified Get-MissingCmds returns the correct 18 missing commands for AzureAD and 11 for AzureADPreview (matching previous behavior)
  • Existing unit tests continue to pass
  • No behavioral changes to the generated modules

@givinalis givinalis requested a review from a team as a code owner May 7, 2026 07:33
@learn-build-service-prod
Copy link
Copy Markdown

Learn Build status updates of commit 9472d20:

❌ Validation status: errors

Please follow instructions here which may help to resolve issue.

File Status Preview URL Details
❌Error Details

  • Line 0, Column 0: [Error: PSMD2Yaml_FileLoadFailed] Failed to load file: C:/LocalRun/W/owim-s/module/mapping/monikerMapping.json. PackageRoot, ReferenceTocUrl, and ConceptualTocUrl are required for every moniker. PackageRoot should be a valid relative path to docset root.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

@givinalis givinalis added the Ready For Review The PR Ready for Review label May 7, 2026
@KenitoInc
Copy link
Copy Markdown
Collaborator

Test-EntraScript uses the $script:MISSING_CMDS. This is a cmdlet that some customers still use (see the issue below). We need a way to map $script:MISSING_CMDS without relying on the AzureAD modules.

#1329

@givinalis
Copy link
Copy Markdown
Collaborator Author

Test-EntraScript uses the $script:MISSING_CMDS. This is a cmdlet that some customers still use (see the issue below). We need a way to map $script:MISSING_CMDS without relying on the AzureAD modules.

#1329

Thanks for the feedback @KenitoInc! This is already handled by the fix. The Get-MissingCmds function now reads the command list from the static mapping files (AzureADToEntraMapping.json / AzureADPreviewToEntraBetaMapping.json) instead of importing the deprecated AzureAD module. Commands with empty/null values in the mapping files are identified as unsupported which is the same set previously discovered by importing the module.

I've verified the built module bin/Microsoft.Entra.psm1 correctly populates $script:MISSING_CMDS with all 18 unsupported commands, so Test-EntraScript will continue to work correctly for customers.

The mapping files are now the single source of truth so any future updates to supported/unsupported commands just need to update those JSON files.

The AzureAD and AzureADPreview PowerShell modules have been deprecated and
removed from the PowerShell Gallery, causing the 'Install Dependencies Entra'
step to fail in the 1es-EntraPowerShell-PR pipeline.

Changes:
- build/Install-Dependencies.ps1: Skip installing the deprecated source module
  (AzureAD/AzureADPreview) since it's no longer available on PSGallery
- src/Get-MissingCmds.ps1: Use the static mapping files as the source of truth
  for AzureAD command names instead of importing the deprecated module
- src/CompatibilityAdapterBuilder.ps1: Skip importing the deprecated source
  module in Configure() and add fallback in GetModuleCommands() to read from
  the mapping files when the module is not available

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@givinalis givinalis force-pushed the fix/remove-azuread-dependency branch from 9472d20 to 4f8e11c Compare May 7, 2026 13:05
@learn-build-service-prod
Copy link
Copy Markdown

Learn Build status updates of commit 4f8e11c:

❌ Validation status: errors

Please follow instructions here which may help to resolve issue.

File Status Preview URL Details
❌Error Details

  • Line 0, Column 0: [Error: PSMD2Yaml_FileLoadFailed] Failed to load file: C:/LocalRun/W/zohw-s/module/mapping/monikerMapping.json. PackageRoot, ReferenceTocUrl, and ConceptualTocUrl are required for every moniker. PackageRoot should be a valid relative path to docset root.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready For Review The PR Ready for Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants