File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -587,14 +587,23 @@ private static TokenCredentialData CreateTokenCredentialInstance(TokenCredential
587587 // specify 'Authentication = Active Directory Default' in
588588 // connection string.
589589 //
590- // CodeQL Suppression - do not modify this comment:
591- //
592- // CodeQL [SM05137] Default Azure Credential is instantiated by
593- // the calling application when using "Active Directory Default"
590+ // Default Azure Credential is instantiated by the calling
591+ // application when using "Active Directory Default"
594592 // authentication code to connect to Azure SQL instance.
595593 // SqlClient is a library, doesn't instantiate the credential
596594 // without running application instructions.
597- return new TokenCredentialData ( new DefaultAzureCredential ( defaultAzureCredentialOptions ) , GetHash ( secret ) ) ;
595+ //
596+ // Note that CodeQL suppression support can only detect
597+ // suppression comments that appear immediately above the
598+ // flagged statement, or appended to the end of the statement.
599+ // Multi-line justifications are not supported.
600+ //
601+ // https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/codeql/codeql-semmle#guidance-on-suppressions
602+ //
603+ // CodeQL [SM05137] See above for justification.
604+ DefaultAzureCredential cred = new ( defaultAzureCredentialOptions ) ;
605+
606+ return new TokenCredentialData ( cred , GetHash ( secret ) ) ;
598607 }
599608
600609 TokenCredentialOptions tokenCredentialOptions = new ( ) { AuthorityHost = new Uri ( tokenCredentialKey . _authority ) } ;
You can’t perform that action at this time.
0 commit comments