title: How to set DataChangePolicy Azure search sdk 3.0.3
body: <p>I have enabled change policy my db</p>
  
  <pre><code>ALTER Database EMR
  SET CHANGE_TRACKING = ON  
  (CHANGE_RETENTION = 2 DAYS, AUTO_CLEANUP = ON)  
  
  ALTER TABLE EMR.dbo.ICDCodePCS  
  ENABLE CHANGE_TRACKING  
  WITH (TRACK_COLUMNS_UPDATED = OFF)  
  </code></pre>
  
  <p>and on azure index side i use below for Datasource.AzureSql</p>
  
  <pre><code> DataChangePolicy = new SqlIntegratedChangeTrackingPolicy()
  </code></pre>
  
  <p>when i insert a new row to this table it does not seem to update the index automatically in azure search side. i have to pretty much run the index job after i add new row. how do i trace or debug what am i doing wrong?</p>
  
  <p>i am using azure sql and azure search with sdk 3.0.3</p>
  
  <pre><code>var dataIndexer = new AzureDataIndexer()
              {
                  DataSource = $"{EMRConsts.EMRAzureIndexNameICD10PCS}-datasource",
                  Description = "ICD10 Procedueral Code",
                  IndexName = EMRConsts.EMRAzureIndexNameICD10PCS,
                  Indexer = $"{EMRConsts.EMRAzureIndexNameICD10PCS}-indexer",
                  TableName = EMRConsts.EMRAzureIndexNameICD10PCS,
                  DataChangePolicy = new SqlIntegratedChangeTrackingPolicy(),
                  Settings = new AzureDataIndexerSettings()
                  {
                      ServiceName = _settingManager.GetSettingValue(EMRSettingNames.EmrSearchServiceName),
                      ApiKey = _settingManager.GetSettingValue(EMRSettingNames.EmrSearchServiceApiKeyAdmin)
                  },
                  Definition = new Index()
                  {
                      Name = EMRConsts.EMRAzureIndexNameICD10PCS,
                      Fields = new[]
                      {
                          new Field("ICDCodePCSId", DataType.String)
                          {
                              IsKey = true,
                              IsSearchable = true,
                              IsFilterable = true,
                              IsSortable = true,
                              IsFacetable = false,
                              IsRetrievable = true
                          },
                          new Field("ICDCodePCSName", DataType.String)
                          {
                              IsKey = false,
                              IsSearchable = true,
                              IsFilterable = true,
                              IsSortable = false,
                              IsFacetable = false,
                              IsRetrievable = true
                          },
                          new Field("ICDCodePCSShortName", DataType.String)
                          {
                              IsKey = false,
                              IsSearchable = true,
                              IsFilterable = true,
                              IsSortable = false,
                              IsFacetable = false,
                              IsRetrievable = true
                          }
                      },
                      Suggesters = new[]
                      {
                          new Suggester()
                          {
                              Name = SuggesterName,
                              SearchMode = SuggesterSearchMode.AnalyzingInfixMatching,
                              SourceFields = new List&lt;string&gt;() {"ICDCodePCSName", "ICDCodePCSId", "ICDCodePCSShortName" }
                          },
                      }
  </code></pre>
  
  <p>DataSource</p>
  
  <pre><code>    var dataSource =
          DataSource.AzureSql(
              name: dataIndexer.DataSource,
              sqlConnectionString: _appConfigSqlConnection.GetConnection().ConnectionString,
              tableOrViewName: dataIndexer.TableName,
             changeDetectionPolicy: dataIndexer.DataChangePolicy,
              description: dataIndexer.Description);
  
      try
      {
              _searchClient.Indexes.Create(dataIndexer.Definition);
     var indexer =
              new Indexer()
              {
                  Name = dataIndexer.Indexer,
                  Description = dataIndexer.Description,
                  DataSourceName = dataSource.Name,
                  TargetIndexName = dataIndexer.IndexName
              };
  
              _searchClient.Indexers.Create(indexer);
          _searchClient.DataSources.Create(dataSource);
      }
  </code></pre>