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

PolicyAssignment Invalid Type #22375

Closed
3 of 6 tasks
zane-atomus opened this issue Jun 27, 2022 · 6 comments
Closed
3 of 6 tasks

PolicyAssignment Invalid Type #22375

zane-atomus opened this issue Jun 27, 2022 · 6 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@zane-atomus
Copy link

  • Package Name: @azure/arm-policy
  • Package Version: 5.0.1
  • Operating system:
  • nodejs
    • version: 16.15.1
  • browser
    • name/version:
  • typescript
    • version: 4.7.3
  • Is the bug related to documentation in

Describe the bug
When creating a policy following the sample in azure-sdk-for-js/sdk/policy/arm-policy/samples/v5/typescript/src/policyAssignmentCreateSample.ts, the type of the parameters property is invalid. It expects the value field to be of type Record<string, unknown>, whereas in the sample (and for my usecase) the type is string.

To Reproduce
Steps to reproduce the behavior:

  1. Attempt to create a policy using version 5.0.1 of the package and the following policy assignment object:
const parameters: PolicyAssignment = {
   description:
     "Force resource names to begin with given DeptA and end with -LC",
   displayName: "Enforce resource naming rules",
   metadata: { assignedBy: "Special Someone" },
   nonComplianceMessages: [
     { message: "Resource names must start with 'DeptA' and end with '-LC'." }
   ],
   parameters: { prefix: { value: "DeptA" }, suffix: { value: "-LC" } },
   policyDefinitionId:
     "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming"
 };
  1. See that typescript complains about the type of the parameters field.

Expected behavior
We are able to create a policy assignment with the format above where parameters' value types are allowed to be string.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
This problem was created when upgrading the version of my installed package from 4.2.0 to 5.0.1.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 27, 2022
@azure-sdk
Copy link
Collaborator

Label prediction was below confidence level 0.6 for Model:ServiceLabels: 'Authorization:0.100955054,Service Bus:0.08651081,Cosmos:0.04724401'

@joheredi joheredi removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 28, 2022
@qiaozha
Copy link
Member

qiaozha commented Jun 29, 2022

@kazrael2119 Can you help take a look at this issue? Thanks

@kazrael2119
Copy link
Contributor

kazrael2119 commented Jun 29, 2022

Hi @zane-atomus ,
I tried to fix it and regenerate this package.
Here is the package:
azure-arm-policy-5.0.2.zip
You can use this package to create policy.
I hope it can help you.
Thanks

@lirenhe lirenhe added the Mgmt This issue is related to a management-plane library. label Jul 1, 2022
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jul 1, 2022
@kazrael2119
Copy link
Contributor

@qiaozha
Copy link
Member

qiaozha commented Jul 6, 2022

@zane-atomus Can you check if the version 5.0.2 can resolve your issue ? Thanks

@qiaozha qiaozha added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Jul 6, 2022
@ghost ghost removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jul 6, 2022
@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Jul 13, 2022
@ghost
Copy link

ghost commented Jul 13, 2022

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@ghost ghost closed this as completed Jul 27, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

6 participants