Closed Jonatan-Bradley closed 5 months ago
Did you try running with the uses: azure/login@hf_447_release
release?
I did try and run into the same issue where later steps relies on Az.Accounts version 3.0.0 and the workflow breaks. The Azure login job will work but not the plan job after.
I can bump the required version of Az.Accounts to 3.0.0 in the module - would that solve the problem do you think?
The other thing I need to check is if we even still required the Az.ResourceGraph module (which is causing all of these issues with versions)
Isn't the requirement of version Az.Accounts 3.0.0 in the module what's causing the issue? Since the specific error is:
| The 'Build-DeploymentPlans' command was found in the module
| 'EnterprisePolicyAsCode', but the module could not be loaded due to the
| following error: [The running command stopped because the preference
| variable "ErrorActionPreference" or common parameter is set to Stop:
| This module requires Az.Accounts version 3.0.0. An earlier version of
| Az.Accounts is imported in the current PowerShell session. Please open a
| new session before importing this module. This error could indicate that
| multiple incompatible versions of the Azure PowerShell cmdlets are
| installed on your system. Please see https://aka.ms/azps-version-error
| for troubleshooting information.] For more information, run
| 'Import-Module EnterprisePolicyAsCode'.
Sorry if my interpretation is off here
I just checked the code, we don't need to use the resource graph module which also forced a newer version of Az.Accounts - give me 30 mins I'll remove all the required modules and then we'll see what hapoens
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Jonatan-Bradley @.> Sent: Tuesday, May 28, 2024 6:37:41 PM To: Azure/enterprise-azure-policy-as-code @.> Cc: Comment @.>; Subscribed @.> Subject: Re: [Azure/enterprise-azure-policy-as-code] Build-DeploymentPlans fails in workflow because az.login is using an earlier version of Az.Accounts (Issue #645)
Isn't the requirement of version Az.Accounts 3.0.0 in the module what's causing the issue? Since the specific error is:
| The 'Build-DeploymentPlans' command was found in the module | 'EnterprisePolicyAsCode', but the module could not be loaded due to the | following error: [The running command stopped because the preference | variable "ErrorActionPreference" or common parameter is set to Stop: | This module requires Az.Accounts version 3.0.0. An earlier version of | Az.Accounts is imported in the current PowerShell session. Please open a | new session before importing this module. This error could indicate that | multiple incompatible versions of the Azure PowerShell cmdlets are | installed on your system. Please see https://aka.ms/azps-version-error | for troubleshooting information.] For more information, run | 'Import-Module EnterprisePolicyAsCode'.
Sorry if my interpretation is off here
— Reply to this email directly, view it on GitHubhttps://github.com/Azure/enterprise-azure-policy-as-code/issues/645#issuecomment-2134651700 or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACWCJVTKM7GOQSNMC6JRT4LZEQ65NBFKMF2HI4TJMJ2XIZLTSSBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDUOJ2WLJDOMFWWLLTXMF2GG2C7MFRXI2LWNF2HTAVFOZQWY5LFUVUXG43VMWSG4YLNMWVXI2DSMVQWIX3UPFYGLAVFOZQWY5LFVIZDOMRVHE4DSNBXHCSG4YLNMWUWQYLTL5WGCYTFNSWHG5LCNJSWG5C7OR4XAZNMJFZXG5LFINXW23LFNZ2KM5DPOBUWG44TQKSHI6LQMWVHEZLQN5ZWS5DPOJ42K5TBNR2WLKJTGM3TCNRSHAZTRAVEOR4XAZNFNFZXG5LFUV3GC3DVMWVDEMZSGA2DAMZWGAYIFJDUPFYGLJLMMFRGK3FFOZQWY5LFVIZDOMRVHE4DSNBXHCTXI4TJM5TWK4VGMNZGKYLUMU. You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
@Jonatan-Bradley - can you please test again for me?
Ensure if you have steps in the workflow that install the Az.ResourceGraph module you remove them as well.
That did the trick! Thank you for the quick response and solution, much appreciated!
Describe the bug The bug is related to https://github.com/Azure/login/issues/447 which effects the EPAC workflows. The Enterprise Policy-as-Code module relies on newer versions of the Az module as a whole, and any downgrading of az.accounts will effect the remaining workflow.
To Reproduce Steps to reproduce the behavior: Run the epac-dev-workflow.yml workflow and the plan job will fail.
Expected behavior A clear and concise description of what you expected to happen. Build-DeploymentPlans module would run without Az.Accounts version 3.0.0 error
Screenshots
EPAC Version Version of EPAC module you are using. EnterprisePolicyAsCode 10.2.11