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

Role Assignments: Principal Type Update + Uplift API Version for Module #714

Merged
merged 7 commits into from
Dec 8, 2021

Conversation

ahmadabdalla
Copy link
Contributor

@ahmadabdalla ahmadabdalla commented Dec 4, 2021

Change

  • Updated to the latest API version for Role Assignments 2021-04-01-preview.

    Wanted to use the latest referenced API from the Role Assignments Doc, but that is broken and is being tracked in this issue. Also allowing Bicep to support the latest API for intellisense is tracked here so it should get updated in future Bicep releases as definitions are coupled with the Bicep version.

  • Constrained the principalType property to the allowed values as per the documentation, with support for '' as the default so that it is used when it is needed. This required the any() function to wrap around the principalType property values in the resource defintiion. This was present when using known API versions (i.e. 2020-08-01-preview) to Bicep but won't complain with the latest API 2021-04-01-preview as it doesn't exist yet in Bicep.

  • Updated the readme

Notes

  • The readme file - Template references section - Role Assignment documentation, will NOT function with the latest API as it does not exist yet, hence I have reverted it to the latest 'working' version which is 2020-08-01-preview.
  • Another option would be to swap the API in the resource to use 2020-08-01-preview instead of 2021-04-01-preview but I think we should be using the latest and all these issues referenced above will get resolved eventually.

Testing

Authorization: RoleAssignments

.Platform: Dependencies

Type of Change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist

  • I'm sure there are no other open Pull Requests for the same update/change
  • My corresponding pipelines / checks run clean and green without any errors or warnings
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (readme)
  • I did format my code

@ahmadabdalla ahmadabdalla added the enhancement New feature or request label Dec 4, 2021
@ahmadabdalla ahmadabdalla self-assigned this Dec 4, 2021
@github-actions
Copy link

github-actions bot commented Dec 6, 2021

Unit Test Results

  1 files  ±  0  1 suites  ±0   14s ⏱️ ±0s
  1 tests  - 31  1 ✔️  - 31    0 💤 ±  0  0 ±0 
34 runs  ±  0  1 ✔️  - 31  33 💤 +31  0 ±0 

Results for commit 8065139. ± Comparison against base commit 2a6a870.

This pull request removes 32 and adds 1 tests. Note that renamed tests count towards both.
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Insights/activityLogAlerts] All apiVersion properties should be set to a static, hard-coded value
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Insights/activityLogAlerts] All parameters in parameters files exist in template file (deploy.json)
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Insights/activityLogAlerts] All required parameters in template file (deploy.json) should exist in parameters files
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Insights/activityLogAlerts] All resources that have a Location property should refer to the Location parameter 'parameters('Location')'
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Insights/activityLogAlerts] CUA ID deployment should be present in the template
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Insights/activityLogAlerts] If delete lock is implemented, the template should have a lock parameter with the default value of [NotSpecified]
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Insights/activityLogAlerts] Output names should be camel-cased (no dashes or underscores and must start with lower-case letter)
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Insights/activityLogAlerts] Parameter names should be camel-cased (no dashes or underscores and must start with lower-case letter)
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Insights/activityLogAlerts] Standard outputs should be provided (e.g. resourceName, resourceId, resouceGroupName)
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ Deployment template tests.Deployment template tests.[Microsoft.Insights/activityLogAlerts] Template schema should use HTTPS reference
…
/home/runner/work/ResourceModules/ResourceModules/arm/.global/global.module.tests.ps1 ‑ API version tests [All apiVersions in the template should be 'recent'].In [Microsoft.Authorization/roleAssignments] used resource type [roleassignments] should use on of the recent API version(s). Currently using [2021-04-01-preview]

♻️ This comment has been updated with latest results.

@ahmadabdalla ahmadabdalla merged commit d13ae5d into main Dec 8, 2021
@ahmadabdalla ahmadabdalla deleted the users/ahmad/rbacPrincipalType branch December 8, 2021 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants