admin管理员组文章数量:1026190
Im trying to do a role assignment usig BICEP. My goal is to assign the Databricks Access connector as the storage blob data contributor on Storage account.
Im deploying both, Databricks (with managed RG which contains my access connector) and storage account too.
I have the below code to do so: main.bicep
module databricks 'platform/modules/databricks/deploy.bicep' = {
name: 'DeployDatabricksWorkspace'
params: {
workspaceName: workspaceName
pricingTier: pricingTier
location: location
disablePublicIp: disablePublicIp
vnetID: vNetId
environment: environment
}
dependsOn: [
virtualNetwrok
]
}
module accessConnectorStorageRbac 'platform/modules/roles/accessConnector/deploy.bicep' = {
name: 'AccessConnector-rbac'
params: {
storageAccountName: storageAccountName
principalId: accessConnectorPrincipalId
roleId: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' // Storage Blob Data Contributor
}
dependsOn: [
storageAccountModule
databricks
]
}
and then I have the module where the actual deployment happens:
param disablePublicIp bool
param workspaceName string
param pricingTier string
param location string = resourceGroup().location
param vnetID string
param environment string
var managedResourceGroupName = 'rg-mgd-databricks-${workspaceName}-${uniqueString(workspaceName, resourceGroup().id)}'
resource workspace 'Microsoft.Databricks/workspaces@2024-05-01' = {
name: workspaceName
location: location
sku: {
name: pricingTier
}
properties: {
managedResourceGroupId: managedResourceGroup.id
parameters: {
customVirtualNetworkId: {
value: vnetID
}
customPublicSubnetName: {
value: 'snet-ads-public-${environment}-weu-01'
}
customPrivateSubnetName: {
value: 'snet-ads-private-${environment}-weu-01'
}
enableNoPublicIp: {
value: disablePublicIp
}
}
}
}
resource managedResourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' existing = {
scope: subscription()
name: managedResourceGroupName
}
resource accessConnector 'Microsoft.Databricks/accessConnectors@2024-05-01' existing = {
name:'unity-catalog-access-connector'
scope:resourceGroup(managedResourceGroupName)
dependsOn: [
managedResourceGroup
]
}
output accessConnectorPrincipalId string = accessConnector.identity.principalId
Error Im getting is below:
Resource group 'rg-mgd-databricks-ads-mdp-comm-dev-weu-01-ntm7hk4xxjyda' could not be found
so the rg-mgd-databricks-ads-mdp-comm-dev-weu-01-ntm7hk4xxjyda is the name where my access connector is. Not sure why I get this error since I have the dependencies.
Im trying to do a role assignment usig BICEP. My goal is to assign the Databricks Access connector as the storage blob data contributor on Storage account.
Im deploying both, Databricks (with managed RG which contains my access connector) and storage account too.
I have the below code to do so: main.bicep
module databricks 'platform/modules/databricks/deploy.bicep' = {
name: 'DeployDatabricksWorkspace'
params: {
workspaceName: workspaceName
pricingTier: pricingTier
location: location
disablePublicIp: disablePublicIp
vnetID: vNetId
environment: environment
}
dependsOn: [
virtualNetwrok
]
}
module accessConnectorStorageRbac 'platform/modules/roles/accessConnector/deploy.bicep' = {
name: 'AccessConnector-rbac'
params: {
storageAccountName: storageAccountName
principalId: accessConnectorPrincipalId
roleId: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' // Storage Blob Data Contributor
}
dependsOn: [
storageAccountModule
databricks
]
}
and then I have the module where the actual deployment happens:
param disablePublicIp bool
param workspaceName string
param pricingTier string
param location string = resourceGroup().location
param vnetID string
param environment string
var managedResourceGroupName = 'rg-mgd-databricks-${workspaceName}-${uniqueString(workspaceName, resourceGroup().id)}'
resource workspace 'Microsoft.Databricks/workspaces@2024-05-01' = {
name: workspaceName
location: location
sku: {
name: pricingTier
}
properties: {
managedResourceGroupId: managedResourceGroup.id
parameters: {
customVirtualNetworkId: {
value: vnetID
}
customPublicSubnetName: {
value: 'snet-ads-public-${environment}-weu-01'
}
customPrivateSubnetName: {
value: 'snet-ads-private-${environment}-weu-01'
}
enableNoPublicIp: {
value: disablePublicIp
}
}
}
}
resource managedResourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' existing = {
scope: subscription()
name: managedResourceGroupName
}
resource accessConnector 'Microsoft.Databricks/accessConnectors@2024-05-01' existing = {
name:'unity-catalog-access-connector'
scope:resourceGroup(managedResourceGroupName)
dependsOn: [
managedResourceGroup
]
}
output accessConnectorPrincipalId string = accessConnector.identity.principalId
Error Im getting is below:
Resource group 'rg-mgd-databricks-ads-mdp-comm-dev-weu-01-ntm7hk4xxjyda' could not be found
so the rg-mgd-databricks-ads-mdp-comm-dev-weu-01-ntm7hk4xxjyda is the name where my access connector is. Not sure why I get this error since I have the dependencies.
Share Improve this question edited Nov 18, 2024 at 10:45 play_something_good asked Nov 18, 2024 at 10:24 play_something_goodplay_something_good 1432 silver badges12 bronze badges 10 | Show 5 more comments1 Answer
Reset to default -1Resource group 'rg-mgd-databricks-ads-mdp-comm-dev-weu-01-ntm7hk4xxjyda' could not be found
You have provided managed resource group of databricks workspace as
rg-mgd-databricks-${workspaceName}-${uniqueString(workspaceName, resourceGroup().id)}
But it is not the correct format of managed resource group. According to this
For Azure Databricks: By default, a managed resource group is created for you when your workspace is created. It will be named as
databricks-rg-<WorspaceName>-<RandomNumber>
.
The managed resource group is not modifiable. you will be able to find the resource group and managed resource group in the overview page of data bricks as shown below:
Use that name as managed resource group name. Along with that instead of referring the name directly try to refer the managed rg property of workspace in a separate file this will be helpful to fetch the correct managed rg name as per the requiremnt:
param managedResourceGroupId string
resource accessConnector 'Microsoft.Databricks/accessConnectors@2024-05-01' = {
name: accessConnectorName
location: location
scope: resourceGroup(managedResourceGroupId)
properties: {
// Specify any required properties here if necessary.
}
}
Im trying to do a role assignment usig BICEP. My goal is to assign the Databricks Access connector as the storage blob data contributor on Storage account.
Im deploying both, Databricks (with managed RG which contains my access connector) and storage account too.
I have the below code to do so: main.bicep
module databricks 'platform/modules/databricks/deploy.bicep' = {
name: 'DeployDatabricksWorkspace'
params: {
workspaceName: workspaceName
pricingTier: pricingTier
location: location
disablePublicIp: disablePublicIp
vnetID: vNetId
environment: environment
}
dependsOn: [
virtualNetwrok
]
}
module accessConnectorStorageRbac 'platform/modules/roles/accessConnector/deploy.bicep' = {
name: 'AccessConnector-rbac'
params: {
storageAccountName: storageAccountName
principalId: accessConnectorPrincipalId
roleId: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' // Storage Blob Data Contributor
}
dependsOn: [
storageAccountModule
databricks
]
}
and then I have the module where the actual deployment happens:
param disablePublicIp bool
param workspaceName string
param pricingTier string
param location string = resourceGroup().location
param vnetID string
param environment string
var managedResourceGroupName = 'rg-mgd-databricks-${workspaceName}-${uniqueString(workspaceName, resourceGroup().id)}'
resource workspace 'Microsoft.Databricks/workspaces@2024-05-01' = {
name: workspaceName
location: location
sku: {
name: pricingTier
}
properties: {
managedResourceGroupId: managedResourceGroup.id
parameters: {
customVirtualNetworkId: {
value: vnetID
}
customPublicSubnetName: {
value: 'snet-ads-public-${environment}-weu-01'
}
customPrivateSubnetName: {
value: 'snet-ads-private-${environment}-weu-01'
}
enableNoPublicIp: {
value: disablePublicIp
}
}
}
}
resource managedResourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' existing = {
scope: subscription()
name: managedResourceGroupName
}
resource accessConnector 'Microsoft.Databricks/accessConnectors@2024-05-01' existing = {
name:'unity-catalog-access-connector'
scope:resourceGroup(managedResourceGroupName)
dependsOn: [
managedResourceGroup
]
}
output accessConnectorPrincipalId string = accessConnector.identity.principalId
Error Im getting is below:
Resource group 'rg-mgd-databricks-ads-mdp-comm-dev-weu-01-ntm7hk4xxjyda' could not be found
so the rg-mgd-databricks-ads-mdp-comm-dev-weu-01-ntm7hk4xxjyda is the name where my access connector is. Not sure why I get this error since I have the dependencies.
Im trying to do a role assignment usig BICEP. My goal is to assign the Databricks Access connector as the storage blob data contributor on Storage account.
Im deploying both, Databricks (with managed RG which contains my access connector) and storage account too.
I have the below code to do so: main.bicep
module databricks 'platform/modules/databricks/deploy.bicep' = {
name: 'DeployDatabricksWorkspace'
params: {
workspaceName: workspaceName
pricingTier: pricingTier
location: location
disablePublicIp: disablePublicIp
vnetID: vNetId
environment: environment
}
dependsOn: [
virtualNetwrok
]
}
module accessConnectorStorageRbac 'platform/modules/roles/accessConnector/deploy.bicep' = {
name: 'AccessConnector-rbac'
params: {
storageAccountName: storageAccountName
principalId: accessConnectorPrincipalId
roleId: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' // Storage Blob Data Contributor
}
dependsOn: [
storageAccountModule
databricks
]
}
and then I have the module where the actual deployment happens:
param disablePublicIp bool
param workspaceName string
param pricingTier string
param location string = resourceGroup().location
param vnetID string
param environment string
var managedResourceGroupName = 'rg-mgd-databricks-${workspaceName}-${uniqueString(workspaceName, resourceGroup().id)}'
resource workspace 'Microsoft.Databricks/workspaces@2024-05-01' = {
name: workspaceName
location: location
sku: {
name: pricingTier
}
properties: {
managedResourceGroupId: managedResourceGroup.id
parameters: {
customVirtualNetworkId: {
value: vnetID
}
customPublicSubnetName: {
value: 'snet-ads-public-${environment}-weu-01'
}
customPrivateSubnetName: {
value: 'snet-ads-private-${environment}-weu-01'
}
enableNoPublicIp: {
value: disablePublicIp
}
}
}
}
resource managedResourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' existing = {
scope: subscription()
name: managedResourceGroupName
}
resource accessConnector 'Microsoft.Databricks/accessConnectors@2024-05-01' existing = {
name:'unity-catalog-access-connector'
scope:resourceGroup(managedResourceGroupName)
dependsOn: [
managedResourceGroup
]
}
output accessConnectorPrincipalId string = accessConnector.identity.principalId
Error Im getting is below:
Resource group 'rg-mgd-databricks-ads-mdp-comm-dev-weu-01-ntm7hk4xxjyda' could not be found
so the rg-mgd-databricks-ads-mdp-comm-dev-weu-01-ntm7hk4xxjyda is the name where my access connector is. Not sure why I get this error since I have the dependencies.
Share Improve this question edited Nov 18, 2024 at 10:45 play_something_good asked Nov 18, 2024 at 10:24 play_something_goodplay_something_good 1432 silver badges12 bronze badges 10- Cross check your resource resource group name once? – Bhavani Commented Nov 18, 2024 at 11:20
- @Bhavani what do you mean? My RG name is correct when I compare the one generted by the error and the deployed one – play_something_good Commented Nov 18, 2024 at 11:54
- can you check the below answer, and let me know any concerns are there. – Bhavani Commented Nov 18, 2024 at 12:10
-
you shouldn't be deploying the connector in the managed RG cause it is
managed
by the azure platform. Ff you remove the scope / dependsOn on theaccessConnector
that should work fine. – Thomas Commented Nov 18, 2024 at 20:49 -
If you would like to deploy the
accessConnector
resource in the managed resource group, it has to be done in a different module because the scope of the module deployment is different from the scope of theaccessConnector
resource (scope:resourceGroup(managedResourceGroupName)
) – Thomas Commented Nov 18, 2024 at 20:50
1 Answer
Reset to default -1Resource group 'rg-mgd-databricks-ads-mdp-comm-dev-weu-01-ntm7hk4xxjyda' could not be found
You have provided managed resource group of databricks workspace as
rg-mgd-databricks-${workspaceName}-${uniqueString(workspaceName, resourceGroup().id)}
But it is not the correct format of managed resource group. According to this
For Azure Databricks: By default, a managed resource group is created for you when your workspace is created. It will be named as
databricks-rg-<WorspaceName>-<RandomNumber>
.
The managed resource group is not modifiable. you will be able to find the resource group and managed resource group in the overview page of data bricks as shown below:
Use that name as managed resource group name. Along with that instead of referring the name directly try to refer the managed rg property of workspace in a separate file this will be helpful to fetch the correct managed rg name as per the requiremnt:
param managedResourceGroupId string
resource accessConnector 'Microsoft.Databricks/accessConnectors@2024-05-01' = {
name: accessConnectorName
location: location
scope: resourceGroup(managedResourceGroupId)
properties: {
// Specify any required properties here if necessary.
}
}
本文标签: azure databricksBicep role assignmentStack Overflow
版权声明:本文标题:azure databricks - Bicep role assignment - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745626290a2159881.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
managed
by the azure platform. Ff you remove the scope / dependsOn on theaccessConnector
that should work fine. – Thomas Commented Nov 18, 2024 at 20:49accessConnector
resource in the managed resource group, it has to be done in a different module because the scope of the module deployment is different from the scope of theaccessConnector
resource (scope:resourceGroup(managedResourceGroupName)
) – Thomas Commented Nov 18, 2024 at 20:50