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

Az.ImageBuilder module could not be loaded #105

Open
GPJDE opened this issue May 10, 2024 · 3 comments
Open

Az.ImageBuilder module could not be loaded #105

GPJDE opened this issue May 10, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@GPJDE
Copy link

GPJDE commented May 10, 2024

modules are installed from PSGallery
Run azure/powershell@v1 using the shell PWSH

Calls an inline script and stops with error:
"The 'Get-AzImageBuilderTemplate' command was found in the module 'Az.ImageBuilder', but the module could not be
| loaded. For more information, run 'Import-Module Az.ImageBuilder'.
Error: Error: The process 'C:\Program Files\PowerShell\7\pwsh.exe' failed with exit code 1"

We have 3 separate workflows and all fails due to this error. Please guide.

@YanaXu
Copy link
Collaborator

YanaXu commented May 11, 2024

Hi @GPJDE , there are 2 issues in your workflow file.

  • The first one is about how to use the right Azure PowerShell version with Azure PowerShell Action.
    If you want to use the specific Azure PowerShell version, please set the value of "azPSVersion". E.g.
      - name: Run powershell command in US Gov Cloud
        uses: azure/powershell@v2
        with:
          inlineScript: "Get-AzContext"
          azPSVersion: "11.6.0"

You can find all Azure PowerShell versions on PSGallery.

  • The second one is about how to install "Az.ImageBuilder". According to Az.ImageBuilder, this module is not GAed yet. That means it's not included by Az. You can check the "Package Details" of Az.
    Please install AzPreview instead. Or install Az.ImageBuilder directly.

@YanaXu YanaXu added question Further information is requested and removed need-to-triage labels May 11, 2024
@GPJDE
Copy link
Author

GPJDE commented May 13, 2024

Thanks @YanaXu , in the yaml file, the error section has mention azPSVersion: "latest" and the install section runs "Install-Module Az.ImageBuilder"
as per logs it seems to use :
"AzVersion": "11.3.1"
The error reports the command to be available in the module but it could not load the module ??

@YanaXu
Copy link
Collaborator

YanaXu commented May 15, 2024

eports the command to

Please provide the workflow file and the log.

@YanaXu YanaXu self-assigned this Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants