Fix Resources module console close when no login issue#29086
Fix Resources module console close when no login issue#29086vidai-msft merged 5 commits intomainfrom
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
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 |
| --- | ||
| Module Name: Az.Policy | ||
| Module Guid: 54d436a4-6f2e-4977-b339-2b40665fd8c4 | ||
| Module Guid: 1f342329-f9ac-4f53-835f-31c93af7ed11 |
There was a problem hiding this comment.
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.
| Module Guid: 1f342329-f9ac-4f53-835f-31c93af7ed11 | |
| Module Guid: 54d436a4-6f2e-4977-b339-2b40665fd8c4 |
| --- | ||
| Module Name: Az.MSGraph | ||
| Module Guid: 9c1e9bcf-5175-4d03-99c7-a7f2f7040f46 | ||
| Module Guid: 573646e0-5233-4ae6-88e9-e1f5d45b1bce |
There was a problem hiding this comment.
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.
| Module Guid: 573646e0-5233-4ae6-88e9-e1f5d45b1bce | |
| Module Guid: 9c1e9bcf-5175-4d03-99c7-a7f2f7040f46 |
| --- | ||
| Module Name: Az.DataBoundary | ||
| Module Guid: c0d70364-96af-43cf-a3ca-76edff8b31b7 | ||
| Module Guid: 40f99554-61db-4799-85d0-fb9ed50828ac |
There was a problem hiding this comment.
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.
| Module Guid: 40f99554-61db-4799-85d0-fb9ed50828ac | |
| Module Guid: c0d70364-96af-43cf-a3ca-76edff8b31b7 |
| --- | ||
| Module Name: Az.Authorization | ||
| Module Guid: f91f515b-3470-413c-8ef0-db77a70595b9 | ||
| Module Guid: f1083436-3175-474b-a331-bbee5f693934 |
There was a problem hiding this comment.
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.
| Module Guid: f1083436-3175-474b-a331-bbee5f693934 | |
| Module Guid: 5e804a75-47b7-4aac-9e3b-4bbc49a1abca |
| 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)] |
There was a problem hiding this comment.
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.
| 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. |
|
|
||
| [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)] |
There was a problem hiding this comment.
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.
| [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)] |
| "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." |
There was a problem hiding this comment.
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.
| "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." |
|
|
||
| [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)] |
There was a problem hiding this comment.
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.
| [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)] |
| [assembly: System.Reflection.AssemblyFileVersionAttribute("9.0.0")] | ||
| [assembly: System.Reflection.AssemblyVersionAttribute("9.0.0")] |
There was a problem hiding this comment.
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.
| [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")] |
| 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}" |
There was a problem hiding this comment.
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.
Description
Fixed issue where the PowerShell console would close when using Resources module cmdlets without being logged in. Github Issue link.
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.