Skip to content

Issue with Role assignment across resource group #5276

Answered by brwilkinson
akhoslabinary asked this question in Q&A
Discussion options

You must be logged in to vote

Here is a sample of a resource scoped role assignment.

A few things:

  • the lookup of the roledefinitionId
  • The use of scope against the existing keyvault resource on the roleAssignment
  • No scope required on existing kv resource, since you already deployed into the correct RG via the Module (deployment) Scope
param kvName string = 'kvGlobal'

resource kv 'Microsoft.KeyVault/vaults@2021-06-01-preview' existing = {
  name: kvName
}

param roleAssignment object = {
  UserId: '39fbc045-15e0-4855-b63a-e6cdf74ef2ea'
  RoleId: '21090545-7ca7-4776-b22c-e363652d74d2'
  uniqueGUID: 'bce4256e-32fa-4eec-801d-b9c3d7a886dd'
}

resource roleDefinition 'Microsoft.Authorization/roleDefinitions@2018-01-01-pre…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@brwilkinson
Comment options

@brwilkinson
Comment options

@jessicalavoie
Comment options

@brwilkinson
Comment options

@jessicalavoie
Comment options

Answer selected by brwilkinson
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants