Azure / bicep-types-az

Bicep type definitions for ARM resources
MIT License
86 stars 27 forks source link

Microsoft.DataFactory/factories/pipelines: The property "isolationLevel" is not allowed on objects of type "SqlServerSource" #1567

Closed gabrielweyer closed 1 year ago

gabrielweyer commented 1 year ago

Resource Type

Microsoft.DataFactory/factories/pipelines

Api Version

2018-06-01

Issue Type

Type is unavailable

Other Notes

According to Bicep version 0.17.1 the property isolationLevel is not valid:

Warning BCP037: The property "isolationLevel" is not allowed on objects of type "SqlServerSource". Permissible properties include "additionalColumns", "disableMetricsCollection", "maxConcurrentConnections", "partitionOption", "partitionSettings", "produceAdditionalTypes", "queryTimeout", "sourceRetryCount", "sourceRetryWait", "sqlReaderStoredProcedureName", "storedProcedureParameters". If this is an inaccuracy in the documentation, please report it to the Bicep Team. [https://aka.ms/bicep-type-issues]

According to the documentation, it's a valid property:

image

The Bicep file included below does set the isolationLevel property:

image

I think this is an API specs issue and I raised https://github.com/Azure/azure-rest-api-specs/issues/23857 in the API specs repo.

Bicep Repro

@description('Azure location for the deployed Azure Resources')
param azureLocation string = resourceGroup().location

@description('Azure Data Factory resource name. Globally unique.')
@minLength(1)
param dataFactoryName string = resourceGroup().location

resource dataFactory 'Microsoft.DataFactory/factories@2018-06-01' = {
  name: dataFactoryName
  location: azureLocation
  identity: {
    type: 'SystemAssigned'
  }
}

resource sqlServerLinkedService 'Microsoft.DataFactory/factories/linkedServices@2018-06-01' = {
  name: 'sql_server'
  parent: dataFactory
  properties: {
    type: 'SqlServer'
    typeProperties: {
      connectionString: 'Data Source=.;Initial Catalog=SomeDatabase;Integrated Security=False;User ID=SomeUserName;Password=SomePassword;'
    }
  }
}

resource sqlServerDataset 'Microsoft.DataFactory/factories/datasets@2018-06-01' = {
  name: 'sql_server_some_table'
  parent: dataFactory
  properties: {
    linkedServiceName: {
      referenceName: sqlServerLinkedService.name
      type: 'LinkedServiceReference'
    }
    type: 'SqlServerTable'
    typeProperties: {
      schema: 'dbo'
      table: 'SomeTable'
    }
  }
}

resource pipeline 'Microsoft.DataFactory/factories/pipelines@2018-06-01' = {
  name: 'pipeline'
  parent: dataFactory
  properties: {
    activities: [
      {
        name: 'MyCopy'
        type: 'Copy'
        inputs: [
          {
            type: 'DatasetReference'
            referenceName: sqlServerDataset.name
          }
        ]
        outputs: [
          {
            type: 'DatasetReference'
            referenceName: sqlServerDataset.name
          }
        ]
        typeProperties: {
          source: {
            type: 'SqlServerSource'
            sqlReaderQuery: 'SELECT Id from dbo.SomeTable;'
            isolationLevel: 'RepeatableRead'
          }
          sink: {
            type: 'SqlServerSink'
          }
        }
      }
    ]
  }
}

Confirm

ghost commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Jingshu923, @zhangyd2015, @Frey-Wang. Please see https://aka.ms/biceptypesinfo for troubleshooting help.

Issue Details
### Resource Type Microsoft.DataFactory/factories/pipelines ### Api Version 2018-06-01 ### Issue Type Type is unavailable ### Other Notes According to Bicep version `0.17.1` the property `isolationLevel` is not valid: > Warning BCP037: The property "isolationLevel" is not allowed on objects of type "SqlServerSource". Permissible properties include "additionalColumns", "disableMetricsCollection", "maxConcurrentConnections", "partitionOption", "partitionSettings", "produceAdditionalTypes", "queryTimeout", "sourceRetryCount", "sourceRetryWait", "sqlReaderStoredProcedureName", "storedProcedureParameters". If this is an inaccuracy in the documentation, please report it to the Bicep Team. [https://aka.ms/bicep-type-issues] According to the [documentation](https://learn.microsoft.com/en-us/azure/data-factory/connector-sql-server?tabs=data-factory#sql-server-as-a-source), it's a valid property: ![image](https://user-images.githubusercontent.com/2101647/236804620-0ca3bd4b-e043-499c-aabf-27859c09e58e.png) The Bicep file included below does set the `isolationLevel` property: ![image](https://user-images.githubusercontent.com/2101647/236804828-c37cceb6-77de-4008-8257-6f984f56d2a6.png) I think this is an API specs issue and I raised https://github.com/Azure/azure-rest-api-specs/issues/23857 in the API specs repo. ### Bicep Repro ```bicep @description('Azure location for the deployed Azure Resources') param azureLocation string = resourceGroup().location @description('Azure Data Factory resource name. Globally unique.') @minLength(1) param dataFactoryName string = resourceGroup().location resource dataFactory 'Microsoft.DataFactory/factories@2018-06-01' = { name: dataFactoryName location: azureLocation identity: { type: 'SystemAssigned' } } resource sqlServerLinkedService 'Microsoft.DataFactory/factories/linkedServices@2018-06-01' = { name: 'sql_server' parent: dataFactory properties: { type: 'SqlServer' typeProperties: { connectionString: 'Data Source=.;Initial Catalog=SomeDatabase;Integrated Security=False;User ID=SomeUserName;Password=SomePassword;' } } } resource sqlServerDataset 'Microsoft.DataFactory/factories/datasets@2018-06-01' = { name: 'sql_server_some_table' parent: dataFactory properties: { linkedServiceName: { referenceName: sqlServerLinkedService.name type: 'LinkedServiceReference' } type: 'SqlServerTable' typeProperties: { schema: 'dbo' table: 'SomeTable' } } } resource pipeline 'Microsoft.DataFactory/factories/pipelines@2018-06-01' = { name: 'pipeline' parent: dataFactory properties: { activities: [ { name: 'MyCopy' type: 'Copy' inputs: [ { type: 'DatasetReference' referenceName: sqlServerDataset.name } ] outputs: [ { type: 'DatasetReference' referenceName: sqlServerDataset.name } ] typeProperties: { source: { type: 'SqlServerSource' sqlReaderQuery: 'SELECT Id from dbo.SomeTable;' isolationLevel: 'RepeatableRead' } sink: { type: 'SqlServerSink' } } } ] } } ``` ### Confirm - [X] I have read the troubleshooting guide and looked for duplicates.
Author: gabrielweyer
Assignees: -
Labels: `inaccuracy`, `Needs: Triage :mag:`, `Service Attention`, `Data Factory`
Milestone: -
gabrielweyer commented 1 year ago

Closing this as isolationLevel is present on SqlSource, and this is what I should have been using instead of SqlServerSource. The API specs are correct, and so is the Bicep definition.