Skip to content

Commit

Permalink
fix: avm/res/machine-learning-services/workspace Add correct permis…
Browse files Browse the repository at this point in the history
…sions for CI (Azure#3445)

## Description

<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes Azure#123
Fixes Azure#456
Closes Azure#123
Closes Azure#456
-->

* Adds missing permission for failing
`avm/res/machine-learning-service/workspace` module
* Adds `scope` to permission in `avm/ptn/ai-platform/baseline` module

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.machine-learning-services.workspace](https://github.com/cecheta/bicep-registry-modules/actions/workflows/avm.res.machine-learning-services.workspace.yml/badge.svg?branch=permissions)](https://github.com/cecheta/bicep-registry-modules/actions/workflows/avm.res.machine-learning-services.workspace.yml)
|
|
[![avm.ptn.ai-platform.baseline](https://github.com/cecheta/bicep-registry-modules/actions/workflows/avm.ptn.ai-platform.baseline.yml/badge.svg?branch=permissions)](https://github.com/cecheta/bicep-registry-modules/actions/workflows/avm.ptn.ai-platform.baseline.yml)
|

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [x] Azure Verified Module updates:
- [x] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [x] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

## Checklist

- [x] I'm sure there are no other open Pull Requests for the same
update/change
- [x] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [ ] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
cecheta authored Oct 7, 2024
1 parent 1769664 commit 0e259f5
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' = {

resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, storageAccount.id, managedIdentity.id)
scope: storageAccount
properties: {
roleDefinitionId: subscriptionResourceId(
'Microsoft.Authorization/roleDefinitions',
Expand Down
4 changes: 2 additions & 2 deletions avm/res/machine-learning-services/workspace/compute/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "8580750401363518569"
"version": "0.30.23.60470",
"templateHash": "6461308246344228681"
},
"name": "Machine Learning Services Workspaces Computes",
"description": "This module deploys a Machine Learning Services Workspaces Compute.\n\nAttaching a compute is not idempotent and will fail in case you try to redeploy over an existing compute in AML (see parameter `deployCompute`).",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "2277907099827503661"
"version": "0.30.23.60470",
"templateHash": "11897886685116125832"
},
"name": "Machine Learning Services Workspaces Connections",
"description": "This module creates a connection in a Machine Learning Services workspace.",
Expand Down
12 changes: 6 additions & 6 deletions avm/res/machine-learning-services/workspace/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "6210663004291725942"
"version": "0.30.23.60470",
"templateHash": "13428062064493278756"
},
"name": "Machine Learning Services Workspaces",
"description": "This module deploys a Machine Learning Services Workspace.",
Expand Down Expand Up @@ -1981,8 +1981,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "8580750401363518569"
"version": "0.30.23.60470",
"templateHash": "6461308246344228681"
},
"name": "Machine Learning Services Workspaces Computes",
"description": "This module deploys a Machine Learning Services Workspaces Compute.\n\nAttaching a compute is not idempotent and will fail in case you try to redeploy over an existing compute in AML (see parameter `deployCompute`).",
Expand Down Expand Up @@ -2244,8 +2244,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "2277907099827503661"
"version": "0.30.23.60470",
"templateHash": "11897886685116125832"
},
"name": "Machine Learning Services Workspaces Connections",
"description": "This module creates a connection in a Machine Learning Services workspace.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,42 @@ resource keyVaultServicePermissions 'Microsoft.Authorization/roleAssignments@202
principalType: 'ServicePrincipal'
}
}
resource keyVaultDataPermissions 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid('msi-${keyVault.id}-${location}-${managedIdentity.id}-KeyVault-Data-Admin-RoleAssignment')
scope: keyVault::key

resource keyVaultAdminPermissions 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid('msi-${keyVault.id}-${location}-${managedIdentity.id}-KeyVault-Admin-RoleAssignment')
scope: keyVault
properties: {
principalId: managedIdentity.properties.principalId
roleDefinitionId: subscriptionResourceId(
'Microsoft.Authorization/roleDefinitions',
'00482a5a-887f-4fb3-b363-3b7fe8e74483'
) // Key Vault Administrator
principalType: 'ServicePrincipal'
}
}

resource keyVaultUserPermissions 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid('msi-${keyVault.id}-${location}-${managedIdentity.id}-KeyVault-Crypto-User-RoleAssignment')
scope: keyVault
properties: {
principalId: managedIdentity.properties.principalId
roleDefinitionId: subscriptionResourceId(
'Microsoft.Authorization/roleDefinitions',
'e147488a-f6f5-4113-8e2d-b22465e65bf6'
) // Key Vault Crypto Service Encryption User
principalType: 'ServicePrincipal'
}
}

resource storageAccountPermissions 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid('msi-${secondaryStorageAccount.id}-${location}-${managedIdentity.id}-StorageAccount-RoleAssignment')
scope: secondaryStorageAccount
properties: {
principalId: managedIdentity.properties.principalId
roleDefinitionId: subscriptionResourceId(
'Microsoft.Authorization/roleDefinitions',
'12338af0-0e69-4776-bea7-57ae8d297424'
) // Key Vault Crypto User
'b556d68e-0be0-4f35-a333-ad7ee1ce17ea'
) // Azure AI Enterprise Network Connection Approver
principalType: 'ServicePrincipal'
}
}
Expand Down

0 comments on commit 0e259f5

Please sign in to comment.