Azure Policy TSP Gen, Enrollments - #29909
Conversation
|
/azp run |
| # Az.Policy Module | ||
| ## Description | ||
| Microsoft Azure PowerShell: Policy cmdlets | ||
| ${$project.metadata.description} |
There was a problem hiding this comment.
@VeryEarly Is this an issue with the type spec generation? I don't know where this gets populated from, but I know these docs files are auto generated
|
/azp run |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 73 out of 224 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (3)
src/Resources/Policy.Autorest/Properties/AssemblyInfo.cs:5
- AssemblyInfo.cs now has conflicting/duplicated header text (MIT + Apache license blocks and duplicated copyright), and the AutoRest note has a missing space in "Generator.Changes". This looks like an accidental merge of two templates and should be normalized to a single correct header.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the ""License"");
src/Resources/Policy.Autorest/test/NewPolicySetDefinition.Recording.json:74
- Recording includes real user email and AAD object id in the error message. Please scrub these values to stable placeholders.
src/Resources/Policy.Autorest/test/NewPolicySetDefinitionVersion.Recording.json:74 - Recording includes real user email and AAD object id in the error payload; please scrub to placeholders to avoid committing personal data.
|
/azp run |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 73 out of 230 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
src/Resources/Policy.Autorest/Properties/AssemblyInfo.cs:15
- The file header now contains duplicated copyright lines and two different license headers (MIT and Apache 2.0). This is conflicting/ambiguous and could cause compliance confusion. Please keep a single, correct license header for this project and remove duplicates.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the ""License"");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an ""AS IS"" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
// is regenerated.
src/Resources/Policy.Autorest/custom/Update-AzPolicyEnrollment.ps1:257
- When Metadata is preserved from the existing enrollment, it is assigned as a PSCustomObject. Because New-AzPolicyEnrollment declares -Metadata as [string], PowerShell may stringify that object (often to an empty string), which can unintentionally clear metadata or throw in ResolvePolicyMetadataParameter. Serialize the existing metadata to JSON before passing it to New-AzPolicyEnrollment so it round-trips reliably.
if (!$calledParameters.Metadata -and $existing.Metadata -and @($existing.Metadata.PSObject.Properties).Count -gt 0) {
$calledParameters.Metadata = $existing.Metadata
}
src/Resources/Policy.Autorest/custom/Update-AzPolicyExemption.ps1:273
- When Metadata is preserved from the existing exemption, it is assigned as a PSCustomObject. Because New-AzPolicyExemption declares -Metadata as [string], PowerShell may stringify that object (often to an empty string), which can unintentionally clear metadata or fail parsing. Serialize the existing metadata to JSON before passing it through to ensure it round-trips reliably.
if (!$calledParameters.Metadata -and $existing.Metadata -and @($existing.Metadata.PSObject.Properties).Count -gt 0) {
$calledParameters.Metadata = $existing.Metadata
}
Description
Switched to using TypeSpec Generation in Policy cmdlets and added CRUD cmdlets for Policy Enrollment resource.
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.