Home > Net >  Bicep - data factory identity property
Bicep - data factory identity property

Time:03-22

I'm running bicep 0.4.1318.

I have a "main" bicep module that calls a sub module to provision data factory:

var adfName = 'adf-ctaxrebate-${envPlusSuffix}-${formattedInstanceNum}'
module adfDeploy 'CTaxRebate.dataFactory.bicep' = {
  name: 'adfDeploy'
  params: {
    adfName: adfName
  }
}

The data factory module is as follows:

param adfName string

resource adf 'Microsoft.DataFactory/factories@2018-06-01' = {
  name:adfName
  location: resourceGroup().location
}

output dfId string = adf.identity.principalId

I used the PowerShell cdmlet New-AzResourceGroupDeployment to run the main bicep but I'm getting the following error:

The template output 'dfId' is not valid: The language expression
| property 'identity' doesn't exist, available properties are 'apiVersion, location, tags, etc...

I think this is trying to tell me that the following line from the adf module is wrong:

output dfId string = adf.identity.principalId

I'm puzzled by this since I've used the same code on a previous project and it works ok.

Also, the identity property does appear in the intellisense:

enter image description here

CodePudding user response:

You need to add

identity: {
  type: 'SystemAssigned'
}

to the definition of your DataFactory in the module to tell the system it should generate a system assigned ID for you.

  • Related