I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.
Issue:
You created a Bicep template which contains an Azure Data Factory and a Key Vault.
In the main bicep file you define objectId as: dataFactory.outputs.dataFactoryObjectID And tenantId is defined as subscription().tenantId
What's the appropriate reference for adding the ObjectId of the DataFactory in the Access Policies?
Cause: It's not enough with adding the ADF ObjectId in the KeyVault access policy creation.
Solution: You defined another access policy with network ACL as well in the vault policy:
resource symbolicname 'Microsoft.KeyVault/vaults@2022-07-01' = {
name: 'string'
location: 'string'
tags: {
tagName1: 'tagValue1'
tagName2: 'tagValue2'
}
properties: {
accessPolicies: [
{
applicationId: 'string'
objectId: 'string'
permissions: {
certificates: [
'string'
]
keys: [
'string'
]
secrets: [
'string'
]
storage: [
'string'
]
}
tenantId: 'string'
}
]
createMode: 'string'
enabledForDeployment: bool
enabledForDiskEncryption: bool
enabledForTemplateDeployment: bool
enablePurgeProtection: bool
enableRbacAuthorization: bool
enableSoftDelete: bool
networkAcls: {
bypass: 'string'
defaultAction: 'string'
ipRules: [
{
value: 'string'
}
]
virtualNetworkRules: [
{
id: 'string'
ignoreMissingVnetServiceEndpoint: bool
}
]
}
provisioningState: 'string'
publicNetworkAccess: 'string'
sku: {
family: 'A'
name: 'string'
}
softDeleteRetentionInDays: int
tenantId: 'string'
vaultUri: 'string'
}
}
Thanks,
Akshay Kaushik
Please "Accept the answer" (Yes), and share your feedback if the suggestion answers you’re your query. This will help us and others in the community as well.