azureblog.co.uk
← cd ~/roles
// roles/azure · databases

SQL Managed Instance ContributorAzure built-in role

Lets you manage SQL Managed Instances and required network configuration, but can't give access to others.

Role ID4939a1f6-9ae0-4e48-a1e0-f2cbe897382d
CategoryDatabases
Actions15 (minus 2 NotActions)
Data actions0

What it can do

PermissionWhat it allows
Microsoft.ResourceHealth/availabilityStatuses/readGets the availability statuses for all resources in the specified scope
Microsoft.Resources/deployments/*Every operation under Microsoft.Resources/deployments
Microsoft.Resources/subscriptions/resourceGroups/readGets or lists resource groups.
Microsoft.Network/networkSecurityGroups/*Every operation under Microsoft.Network/networkSecurityGroups
Microsoft.Network/routeTables/*Every operation under Microsoft.Network/routeTables
Microsoft.Sql/locations/*/readAny read operation on anything under Microsoft.Sql/locations
Microsoft.Sql/locations/instanceFailoverGroups/*Every operation under Microsoft.Sql/locations/instanceFailoverGroups
Microsoft.Sql/managedInstances/*Every operation under Microsoft.Sql/managedInstances
Microsoft.Support/*Every operation under Microsoft.Support
Microsoft.Network/virtualNetworks/subnets/*Every operation under Microsoft.Network/virtualNetworks/subnets
Microsoft.Network/virtualNetworks/*Every operation under Microsoft.Network/virtualNetworks
Microsoft.Authorization/*/readAny read operation on anything under Microsoft.Authorization
Microsoft.Insights/alertRules/*Every operation under Microsoft.Insights/alertRules
Microsoft.Insights/metrics/readRead metrics
Microsoft.Insights/metricDefinitions/readRead metric definitions

Can't do

These are taken away from the actions above.

PermissionWhat it allows
Microsoft.Sql/managedInstances/azureADOnlyAuthentications/deleteDeletes a specific managed server Azure Active Directory only authentication object
Microsoft.Sql/managedInstances/azureADOnlyAuthentications/writeAdds or updates a specific managed server Azure Active Directory only authentication object

Assign it

Scope it as tightly as you can: a resource or resource group rather than the whole subscription.

azure cli
az role assignment create \
  --assignee "jane.doe@contoso.com" \
  --role "SQL Managed Instance Contributor" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "SQL Managed Instance Contributor" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, '4939a1f6-9ae0-4e48-a1e0-f2cbe897382d')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '4939a1f6-9ae0-4e48-a1e0-f2cbe897382d')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "4939a1f6-9ae0-4e48-a1e0-f2cbe897382d"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other databases roles

Find the smallest role for a task →