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

capture definitionReferenceId that starts with number. #324

Merged
merged 1 commit into from
Sep 30, 2022

Conversation

eureka-gh
Copy link
Contributor

@eureka-gh eureka-gh commented Sep 30, 2022

Overview/Summary

We (slz engineering team) found an issue in alz's invoke-policyToBicep.ps1. This script doesn't support any definitionReferenceId that starts with number. E.g. We have a policySet definitions that pulled from azure built-in policy, the definitionReferenceId is like '10006169408036501401'. The invoke-policyToBicep.ps1 generates _policySetDefintionsBicepInput.txt like this.
image
It uses .10006169408036501401 to reference an object which is illegals for neither json nor bicep. The invoke-policyToBicep.ps1 somehow missed to handle this case.

This PR fixes/adds/changes/removes

  1. adding a regex to capture defintionReferenceId that starts with number.
    $definitionReferenceIdForParameters -match '^[0-9].+'

Breaking Changes

N/A

Testing Evidence

with this pr, we can see the result diff in the output of the invoke-PolicyToBicep.ps1
image

As part of this Pull Request I have

@ghost ghost added the Needs: Triage 🔍 Needs triaging by the team label Sep 30, 2022
@jtracey93 jtracey93 self-assigned this Sep 30, 2022
@jtracey93 jtracey93 added Area: Policy and removed Needs: Triage 🔍 Needs triaging by the team labels Sep 30, 2022
@jtracey93
Copy link
Collaborator

/azp run validateazcloud

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

@jtracey93 jtracey93 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jtracey93 jtracey93 merged commit 86a4da1 into Azure:main Sep 30, 2022
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.

2 participants