azure 二头肌ADF LinkedService

wfveoks0  于 2023-01-02  发布在  其他
关注(0)|答案(1)|浏览(180)

我花了很长时间尝试使用二头肌(我才真正开始学习)将一个简单的Azure BlobFS链接服务部署到ADF中。
目前我的二头肌是:

//---Data Factory
resource datafactory 'Microsoft.DataFactory/factories@2018-06-01' = {
  name: adf_name
  location: loc_name
  identity: {
    type: 'SystemAssigned'
  }
  properties: {
    globalParameters: {}
    publicNetworkAccess: 'Enabled'
  }
}

//--- Data Factory Linked Service
resource adls_linked_service 'Microsoft.DataFactory/factories/linkedservices@2018-06-01' = {
  name: 'ls_adf_to_adls'
  parent: datafactory
  properties: {
    annotations: []
    connectVia: {
      parameters: {}
      referenceName: 'AutoResolveIntegrationRuntime'
      type: 'IntegrationRuntimeReference'
    }
    description: 'linked_service_for_adls'
    parameters: {}
    type: 'AzureBlobFS'
    typeProperties: {
      accountKey: datafactory.identity.principalId
      azureCloudType: 'AzurePublic'
      credential: {
        referenceName: 'string'
        type: 'CredentialReference'
      }
      servicePrincipalCredentialType: 'SecureString'
      servicePrincipalId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
      servicePrincipalKey: {
        type: 'SecureString'
        value: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
      }
      tenant: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
      url: bicepstorage.properties.primaryEndpoints.blob
    }
  }
}

ADF资源可以像ADLS(符号名称为:bicepstorage).问题是当我添加linkedservice资源块时.我得到:

New-AzResourceGroupDeployment: /home/vsts/work/1/s/psh/deploy_main.ps1:12
Line |
  12 |  New-AzResourceGroupDeployment `
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | 22:46:27 - The deployment 'main' failed with error(s). Showing 1 out of
     | 1 error(s). Status Message: Input is malformed. Reason: Could not get
     | integration runtime details for AutoResolveIntegrationRuntime
     | (Code:InputIsMalformedDetailed)  CorrelationId:
     | f77ef878-5314-46ea-9de6-65807845a104

ADF中唯一的集成运行时是"AutoResolveIntegrationRuntime"。当我在门户中检查它时,它是绿色的,正在运行并且健康。
我正在使用任务:AzurePowerShell@5 on ubuntu-latest in ADF,但是当我尝试直接从vscode部署模板时,我得到了同样的错误。
我没有主意了,真的很感激一些帮助。我发现"connectVia"块的文档(实际上是所有关于二头肌链接服务的文档!)真的很混乱;如果有人能确切地告诉我里面应该放些什么,我会非常感激的.
谢谢。

nwnhqdif

nwnhqdif1#

如本文档中所述,如果您希望使用默认Azure IR(自动解析集成运行时)创建adls(blobfs)的链接服务,则可以在二头肌模板的链接服务块中删除ConnectionVia属性。

为了测试这一点,我创建了一个bicep模板,它将使用基于服务主体的身份验证部署adlsgen2存储帐户、数据工厂和链接到它的服务。

以下是供您参考的模板示例

param location string='westus'

//---Data Factory
resource storage 'Microsoft.Storage/storageAccounts@2022-09-01'={
  name:'<storageAccountName>'
  location:location
  kind:'StorageV2'
  sku:{
    name:'Standard_GRS'
  }
  properties:{
    accessTier:'Hot'
    supportsHttpsTrafficOnly:true
    isHnsEnabled:true
  }
}
resource datafactory 'Microsoft.DataFactory/factories@2018-06-01' = {
  name: '<AdfName>'
  location: location
  identity: {
    type: 'SystemAssigned'
  }
  properties: {
    globalParameters: {}
    publicNetworkAccess: 'Enabled'
  }
}
//--- Data Factory Linked Service
resource adls_linked_service 'Microsoft.DataFactory/factories/linkedservices@2018-06-01' = {
  name: '<linkedserviceName>'
  parent: datafactory
  properties: {
    annotations: []
    description: 'linked_service_for_adls'
    parameters: {}
    type: 'AzureBlobFS'
    typeProperties: {
      url: storage.properties.primaryEndpoints.dfs
      //encryptedCredential:storage.listKeys(storage.id).keys[0].value
      servicePrincipalCredential: {
        type: 'SecureString'
        value: '<serviceprincipalKey>'
      }
      servicePrincipalId:'<serviceprincipalappId>'
      servicePrincipalCredentialType:'ServicePrincipalKey'
      azureCloudType:'AzurePublic'
      servicePrincipalKey: {
        type: 'SecureString'
        value: '<serviceprincipalKey>'
      }
      tenant: '<tenantId>'      
    }
  }
}

相关问题