diff --git a/cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/CognitiveServiceBase.scala b/cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/CognitiveServiceBase.scala index 62e27e156f..2d123edf56 100644 --- a/cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/CognitiveServiceBase.scala +++ b/cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/CognitiveServiceBase.scala @@ -330,7 +330,7 @@ trait HasCognitiveServiceInput extends HasURL with HasSubscriptionKey with HasAA val providedCustomAuthHeader = getValueOpt(row, CustomAuthHeader) if (providedCustomAuthHeader .isEmpty && PlatformDetails.runningOnFabric()) { logInfo("Using Default AAD Token On Fabric") - Option(FabricClient.getCognitiveAuthHeader) + Option(FabricClient.getCognitiveMWCTokenAuthHeader) } else { providedCustomAuthHeader } diff --git a/core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/FabricClient.scala b/core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/FabricClient.scala index c983013990..236ffc0565 100644 --- a/core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/FabricClient.scala +++ b/core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/FabricClient.scala @@ -122,7 +122,7 @@ object FabricClient extends RESTUtils { private def getHeaders: Map[String, String] = { Map( - "Authorization" -> s"${getMLWorkloadAuthHeader}", + "Authorization" -> s"${getMLWorkloadAADAuthHeader}", "RequestId" -> UUID.randomUUID().toString, "Content-Type" -> "application/json", "x-ms-workload-resource-moniker" -> UUID.randomUUID().toString @@ -144,9 +144,9 @@ object FabricClient extends RESTUtils { usagePost(url, body, getHeaders); } - def getMLWorkloadAuthHeader: String = TokenLibrary.getMLWorkloadAuthHeader + def getMLWorkloadAADAuthHeader: String = TokenLibrary.getMLWorkloadAADAuthHeader - def getCognitiveAuthHeader: String = { - TokenLibrary.getCognitiveAuthHeader(WorkspaceID.getOrElse(""), ArtifactID.getOrElse("")) + def getCognitiveMWCTokenAuthHeader: String = { + TokenLibrary.getCognitiveMwcTokenAuthHeader(WorkspaceID.getOrElse(""), ArtifactID.getOrElse("")) } } diff --git a/core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/TokenLibrary.scala b/core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/TokenLibrary.scala index d2843cd59d..1ced3b3d7a 100644 --- a/core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/TokenLibrary.scala +++ b/core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/TokenLibrary.scala @@ -44,8 +44,8 @@ object TokenLibrary { } - def getMLWorkloadAuthHeader: String = "Bearer " + getAccessToken + def getMLWorkloadAADAuthHeader: String = "Bearer " + getAccessToken - def getCognitiveAuthHeader(workspaceId: String, artifactId: String): String = "MwcToken " + + def getCognitiveMwcTokenAuthHeader(workspaceId: String, artifactId: String): String = "MwcToken " + getSparkMwcToken(workspaceId, artifactId) }