azure - Creating a linked service with bicep file does not generate `encryptedCredential` property like the UI does - Stack Over

I have a bicep file that creates a linked service from a data factory to a storage account. It's p

I have a bicep file that creates a linked service from a data factory to a storage account. It's pretty basic:

module Storage 'linked_services/linked_services.bicep' = {
  name: 'AzureFileStorage'
  params: {
    name: '${factoryName}/AzureFileStorage'
    referenceName: 'STORAGECONNECTION'
    storageType: 'AzureFileStorage'
    typeProperties: {
      connectionString: AzureFileStorage_connectionString
      fileShare: 'datafiles'
    }
  }
  dependsOn: [
    factoryName_STORAGECONNECTION
  ]
}

resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
  name: storageAccountName
  location: location
  tags: {
    Application: tags.Application
    Environment: tags.Environment
  }
  sku: {
    name: 'Standard_LRS'
    tier: 'Standard'
  }
  kind: 'StorageV2'
  properties: {
    publicNetworkAccess: 'Enabled'
    minimumTlsVersion: 'TLS1_2'
    allowBlobPublicAccess: true
    allowSharedKeyAccess: true
    bypass: 'AzureServices'
    defaultAction: 'Deny'
    supportsHttpsTrafficOnly: true
    encryption: {
      services: {
        file: {
          keyType: 'Account'
          enabled: true
        }
        blob: {
          keyType: 'Account'
          enabled: true
        }
      }
      keySource: 'Microsoft.Storage'
    }
    accessTier: 'Hot'
  }
}

resource datafiles 'Microsoft.Storage/storageAccounts/fileServices/shares@2023-05-01' = {
  name: '${storageAccount.name}/default/${storageAccountName}'
  properties: {
    accessTier: 'TransactionOptimized'
    shareQuota: 5120
  }
  dependsOn: [
    storageAccount
  ]
}

linked_services.bicep

param referenceName string
param storageType string
param name string
param typeProperties object

resource linkedService 'Microsoft.DataFactory/factories/linkedServices@2018-06-01' = {
  name: name
  properties: {
    type: storageType
    connectVia: {
      referenceName: referenceName
      type: 'IntegrationRuntimeReference'
    }
    typeProperties: typeProperties
  }
}

I deployed it with ADO and it creates it but when I test the connection it doesn't work. When I go into the ADF UI and edit it manually, selecting the storage account, then the test connection works. I compared the JSON between the two and it adds the encryptedCredential property when using the UI. I'm probably going about this all wrong but I'm not sure how to get this working with a bicep file. For now I am using the account key option to authenticate. I don't have any credentials to put into a key vault or into my bicep file, nor do I want to. They just get created when I configure it in the UI. So how can I deploy my linked service with a bicep file so that it works from the start?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743762508a4502890.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信