Skip to content

Fix Resources module console close when no login issue#29086

Merged
vidai-msft merged 5 commits intomainfrom
Bernard-fix-resources-module-console-close-issue
Jan 22, 2026
Merged

Fix Resources module console close when no login issue#29086
vidai-msft merged 5 commits intomainfrom
Bernard-fix-resources-module-console-close-issue

Conversation

@Pan-Qi
Copy link
Contributor

@Pan-Qi Pan-Qi commented Jan 21, 2026

Description

Fixed issue where the PowerShell console would close when using Resources module cmdlets without being logged in. Github Issue link.

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI review requested due to automatic review settings January 21, 2026 05:05
@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a console close issue in the Resources module when users are not logged in. The changes include updates to the module manifest, help documentation corrections, and regeneration of AutoRest-based modules (Authorization, DataBoundary, MSGraph, Policy).

Changes:

  • Updated Az.Resources module manifest to require Az.Accounts 5.3.2 and fixed formatting
  • Regenerated AutoRest modules with updated version information (.NET 9.0.0) and new module GUIDs
  • Updated help documentation with capitalization fixes and version references

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/Resources/Resources/ChangeLog.md Added changelog entry for console close fix
src/Resources/Resources/Az.Resources.psd1 Updated Az.Accounts dependency to 5.3.2, uncommented ScriptsToProcess and TypesToProcess, reformatted Tags
src/Resources/Resources.sln Reorganized project structure with new GUIDs for AutoRest modules
src/Resources/Resources/help/*.md Fixed capitalization in SYNOPSIS/DESCRIPTION, updated .NET version references, contains spelling errors
src/Resources/Policy.Autorest/* Regenerated AutoRest module files with version 9.0.0
src/Resources/MSGraph.Autorest/* Regenerated AutoRest module files with version 9.0.0, removed incorrect nuspec file
src/Resources/DataBoundary.Autorest/* Regenerated AutoRest module files with version 9.0.0
src/Resources/Authorization.Autorest/* Updated version from 8.1.0 to 9.0.0

Copilot AI review requested due to automatic review settings January 21, 2026 05:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 31 out of 31 changed files in this pull request and generated 1 comment.

@Pan-Qi Pan-Qi marked this pull request as ready for review January 21, 2026 11:27
Copilot AI review requested due to automatic review settings January 21, 2026 11:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 32 out of 32 changed files in this pull request and generated no new comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 30 out of 30 changed files in this pull request and generated 10 comments.

---
Module Name: Az.Policy
Module Guid: 54d436a4-6f2e-4977-b339-2b40665fd8c4
Module Guid: 1f342329-f9ac-4f53-835f-31c93af7ed11
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module GUID in this doc was changed, but it no longer matches the module manifest GUID (generated/Resources/Policy.Autorest/Az.Policy.psd1:2 still has 54d436a4-6f2e-4977-b339-2b40665fd8c4). Please keep the documentation Module Guid consistent with the actual module manifest to avoid publishing incorrect metadata.

Suggested change
Module Guid: 1f342329-f9ac-4f53-835f-31c93af7ed11
Module Guid: 54d436a4-6f2e-4977-b339-2b40665fd8c4

Copilot uses AI. Check for mistakes.
---
Module Name: Az.MSGraph
Module Guid: 9c1e9bcf-5175-4d03-99c7-a7f2f7040f46
Module Guid: 573646e0-5233-4ae6-88e9-e1f5d45b1bce
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module GUID in this doc was changed, but it no longer matches the module manifest GUID (generated/Resources/MSGraph.Autorest/Az.MSGraph.psd1:2 still has 9c1e9bcf-5175-4d03-99c7-a7f2f7040f46). Please keep the documentation Module Guid consistent with the actual module manifest to avoid publishing incorrect metadata.

Suggested change
Module Guid: 573646e0-5233-4ae6-88e9-e1f5d45b1bce
Module Guid: 9c1e9bcf-5175-4d03-99c7-a7f2f7040f46

Copilot uses AI. Check for mistakes.
---
Module Name: Az.DataBoundary
Module Guid: c0d70364-96af-43cf-a3ca-76edff8b31b7
Module Guid: 40f99554-61db-4799-85d0-fb9ed50828ac
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module GUID in this doc was changed, but it no longer matches the module manifest GUID (generated/Resources/DataBoundary.Autorest/Az.DataBoundary.psd1:2 still has c0d70364-96af-43cf-a3ca-76edff8b31b7). Please keep the documentation Module Guid consistent with the actual module manifest to avoid publishing incorrect metadata.

Suggested change
Module Guid: 40f99554-61db-4799-85d0-fb9ed50828ac
Module Guid: c0d70364-96af-43cf-a3ca-76edff8b31b7

Copilot uses AI. Check for mistakes.
---
Module Name: Az.Authorization
Module Guid: f91f515b-3470-413c-8ef0-db77a70595b9
Module Guid: f1083436-3175-474b-a331-bbee5f693934
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module GUID in this doc appears to be inconsistent with the module manifest GUID (generated/Resources/Authorization.Autorest/Az.Authorization.psd1:2 has GUID 5e804a75-47b7-4aac-9e3b-4bbc49a1abca). Please ensure the documentation Module Guid matches the manifest to avoid publishing incorrect metadata.

Suggested change
Module Guid: f1083436-3175-474b-a331-bbee5f693934
Module Guid: 5e804a75-47b7-4aac-9e3b-4bbc49a1abca

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +26
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Policy")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("9.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("9.0.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new AssemblyInfo.cs lives under src/Resources/Policy.Autorest, but the built project for this module is generated/Resources/Policy.Autorest/Az.Policy.csproj and (via src/Az.autorest.props) only compiles src custom code under the module's custom/ folder. As-is, these assembly attributes likely won't be used during build. If the intent is to set assembly metadata/version, add/update the AssemblyInfo.cs under the generated project (or adjust the build to include this file); otherwise remove it to avoid dead code.

Suggested change
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Policy")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("9.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("9.0.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
// Note: Assembly-level attributes such as version and metadata are defined
// in the generated project under generated/Resources/Policy.Autorest.
// This file is intentionally left without assembly attributes to avoid
// unused or misleading configuration, since it is not included in the
// Az.Policy.csproj build.

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +26

[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - DataBoundary")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("9.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("9.0.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new AssemblyInfo.cs lives under src/Resources/DataBoundary.Autorest, but the built project for this module is generated/Resources/DataBoundary.Autorest/Az.DataBoundary.csproj and (via src/Az.autorest.props) only compiles src custom code under the module's custom/ folder. As-is, these assembly attributes likely won't be used during build. If the intent is to set assembly metadata/version, add/update the AssemblyInfo.cs under the generated project (or adjust the build to include this file); otherwise remove it to avoid dead code.

Suggested change
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - DataBoundary")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("9.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("9.0.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]

Copilot uses AI. Check for mistakes.
"Az.Resources","Update-AzPolicySetDefinition","5","1","Is_Alias","5100","2","Set-AzPolicySetDefinition is an alias of 'Update-AzPolicySetDefinition'.","Set-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -Metadata '{'category':'Virtual Machine'}'","Use formal name 'Update-AzPolicySetDefinition' of the alias 'Set-AzPolicySetDefinition'."
"Az.Resources","Update-AzRoleManagementPolicy","1","15","Mismatched_Parameter_Value_Type","5111","2","Update-AzRoleManagementPolicy -Rule $rules is not an expected parameter value type.","-Rule","Use correct parameter value type. Expected Type is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule. Now the type is .(Type)."
"Az.Resources","Update-AzRoleManagementPolicy","2","30","Mismatched_Parameter_Value_Type","5111","2","Update-AzRoleManagementPolicy -Rule $rules is not an expected parameter value type.","-Rule","Use correct parameter value type. Expected Type is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule. Now the type is .(Type)."
"Az.Resources","New-AzPolicyExemption","4","1","Invalid_Cmdlet","5000","1","Get-AzVM is not a valid command name.","Get-AzVM -Name 'SpecialVM'","Check the spell of Get-AzVM."
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a static-analysis exception because the example uses Get-AzVM suggests the docs for New-AzPolicyExemption depend on Az.Compute being installed. Consider updating the example to avoid cross-module cmdlets (for example by using Get-AzResource to obtain the resource Id) so this exception is not needed and the example works with only Az.Resources installed.

Suggested change
"Az.Resources","New-AzPolicyExemption","4","1","Invalid_Cmdlet","5000","1","Get-AzVM is not a valid command name.","Get-AzVM -Name 'SpecialVM'","Check the spell of Get-AzVM."

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +26

[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - MSGraph")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("9.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("9.0.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new AssemblyInfo.cs lives under src/Resources/MSGraph.Autorest, but the built project for this module is generated/Resources/MSGraph.Autorest/Az.MSGraph.csproj and (via src/Az.autorest.props) only compiles src custom code under the module's custom/ folder. As-is, these assembly attributes likely won't be used during build. If the intent is to set assembly metadata/version, add/update the AssemblyInfo.cs under the generated project (or adjust the build to include this file); otherwise remove it to avoid dead code.

Suggested change
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - MSGraph")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("9.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("9.0.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +24
[assembly: System.Reflection.AssemblyFileVersionAttribute("9.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("9.0.0")]
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This AssemblyInfo.cs change is under src/Resources/Authorization.Autorest, but the compiled project uses generated/Resources/Authorization.Autorest (which still has AssemblyInfo.cs at version 8.1.0). If the intent is to bump the built assembly version, update the AssemblyInfo.cs in the generated project; otherwise this change is likely ineffective and can confuse future maintainers.

Suggested change
[assembly: System.Reflection.AssemblyFileVersionAttribute("9.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("9.0.0")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("8.1.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("8.1.0")]

Copilot uses AI. Check for mistakes.
Comment on lines +64 to +68
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Authorization", "..\..\generated\Resources\Authorization.Autorest\Az.Authorization.csproj", "{67E256D4-E784-46D9-AC3E-88B860E1FDCB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataBoundary.Autorest", "DataBoundary.Autorest", "{51145102-1FBB-057F-3FAB-2A7A96D772BC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.DataBoundary", "..\..\generated\Resources\DataBoundary.Autorest\Az.DataBoundary.csproj", "{C42D0525-166A-48B4-9CAA-4475EACB85AA}"
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The solution file changes reintroduce several projects with new project GUIDs and additional solution folders. Unless this is required for building/debugging Resources.sln, consider reverting these changes to avoid unnecessary churn and merge conflicts for other developers.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@vidai-msft vidai-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vidai-msft vidai-msft merged commit d12255c into main Jan 22, 2026
17 of 18 checks passed
@vidai-msft vidai-msft deleted the Bernard-fix-resources-module-console-close-issue branch January 22, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants