Это похоже на то, что здесь обсуждалось: https://www.mail-archive.com/user@hadoo ... 24204.html
конечная точка MSI, которую клиент Hadoop-azure ожидает (я думаю) применима только к виртуальной машине, а не для функций. Итак, я получил конечную точку MSI из переменной среды Identity_endPoint
sparkContext.hadoopConfiguration().set("fs.azure.account.auth.type", "OAuth");
sparkContext.hadoopConfiguration().set("fs.azure.account.oauth.provider.type", "org.apache.hadoop.fs.azurebfs.oauth2.MsiTokenProvider");
if (System.getenv("IDENTITY_ENDPOINT") != null) {
sparkContext.hadoopConfiguration().set("fs.azure.account.oauth2.msi.endpoint", System.getenv("MSI_ENDPOINT"));
}
sparkContext.hadoopConfiguration().set("fs.azure.account.oauth2.msi.tenant", "xx");
sparkContext.hadoopConfiguration().set("fs.azure.account.oauth2.client.id", "yy");
spark.parquet.read("")
< /code>
Запуск выше дает мне следующую ошибку: < /p>
Код состояния: -1 Код ошибки: Сообщение об ошибке NULL: AUTH affer: http
error 400; url = 'http: //169.254.138.2: 8081/msi/token' aadtoken: http
соединение с http://169.254.138.2:8081/msi/token не удалось получить
token от azuread.; ContentType = 'Application/json; charset = utf-8 ';
response' {"error": {"code": "unsupportedApiversion", "Message": "http
ресурс, который соответствует запросу uri
'http://169.254.138.2:8081/msi/token 'Не поддерживает версию api bri. />'2018-02-01'.","innererror":null}'org.apache.hadoop.fs.azurebfs.oath2 url = 'http: //169.254.138.2: 8081/msi/token' aadtoken:
http connection с http://169.254.138.2:8081/msi/token не удалось для
token от azuread.; contentType = 'application /json;
charset = utf-8'; Ответ
'{"error": {"code": "unsupportedapiversion", "Сообщение": "Ресурс http
, который соответствует запросу uri' http://169.254.138.2:8081/msi/token'token'br/> не поддерживает версию API. '2018-02-01'. "," InnerError ": null}} '
at
орг.apache.hadoop.fs.azurebfs.services.abfsrestoperation.executehttpoperation мило org.apache.hadoop.fs.azurebfs.services.absrestoperation.completeexecute (abfsrestoperation.java:217)
at org.apache.hadoop.fs.azurebfs.services.abfsrestoperation.lambda $ execute $ 0 (abfsrestoperes.javas.javestoperes org.apache.hadoop.fs.statistics.impl.iostatisticsbinding.trackdurationofinvocation (iostatisticsbinding.java:464)
at org.apache.hadoop.fs.azurebfs.services.abfsrestoperation.execute (abfsrestoration.java: 1)
org.apache.hadoop.fs.azurebfs.services.abfsclient.getaclstatus(abfsclient.java:911) org.apache.hadoop.fs.azurebfs.azureblobfilesystemstore.getisnamespaceenabled (azureblobfilesystemstore.java:358)
at org.apache.hadoop.fs.azurebfs.azureblobfilesystemstore.getfilestatus (azureblobfilesystemstore.java:932)
at org.apache.hadoop.fs.azurebfs.azureblobfilesystem.getfilestatus (azureblobfilesy.j.jazureblobfilesystem.getfilestatus (azureblobfilesy.j.jazureblobfilesystem.getfilest /> at
орг.apache.hadoop.fs.azurebfs.azureblobfilesystem.getfilestatus(azureblobfilesystem.java:599)
at org.apache.hadoop.fs.filesystem.exist />орг.apache.hadoop.fs.azurebfs.azureblobfilesystem.exists(azureblobfilesystem.java:1177)
at
org.apache.spark.sql.execution.datasources.datasource$.nanonfun $checkandglobpathifnecessary$4(datasource.scala:784)
at org.apache.spark.sql.execution.datasources.datasource $. $ anonfun $ checkandglobpathifnecessary $ 4 $ Адаптирован (DataSource.Scala: 782)
at org.apache.spark.util.treadutils $. $. $ /> at scala.concurrent.future $. $ anonfun $ Применить 1 долл. США (Future.scala: 678)
at scala.concurrent.impl.promise $ transformation.run (Orders.Scala: 467)
at
Java.base/java.util.concurrent.forkjointask$runnableExeCuteAction.exec(forkjointask.java:1426)
at java.base /java.util.concurrent.forkjointas java.base /java.util.concurrent.forkjoinpool $ borkqueue.toplevelexec (forkjoinpool.java:1020)
at
Java.base/java.util.concurrent.forkjoinpool.scan(forkjoinpool.java:1656 6:> /> Java.base/java.util.concurrent.forkjoinpool.runworker(forkjoinpool.java:1594)
at java.base /java.util.concurrent.forkjoinworkerthread.run (forkjoinworkerthrh />орг.apache.hadoop.fs.azurebfs.oath2.azureadauthenticator $httpexception:
http error 400; url = 'http: //169.254.138.2: 8081/msi/token' aadtoken:
http connection с http://169.254.138.2:8081/msi/token не удалось для
token от azuread.; contentType = 'application /json;
charset = utf-8'; Ответ
'{"error": {"code": "unsupportedapiversion", "Сообщение": "Ресурс http
, который соответствует запросу uri' http://169.254.138.2:8081/msi/token'token'br/> не поддерживает версию API. '2018-02-01'. "," InnerError ": null}} '
at
орг.apache.hadoop.fs.azurebfs.oauth2 org.apache.hadoop.fs.azurebfs.oauth2.azureadauthenticator.gettokencall (azureadauthenticator.java:306)
at
org.apache.hadoop.fs.azurebfs.oath2.azureadauthenticator.getTokenFrommsi(azureadauthenticator.java:154)
at
at org.apache.hadoop.fs.azurebfs.oath2.accesstokenprovider.gettoken (accesstokenprovider.java:50)
at org.apache.hadoop.fs.azurebfs.services.abfsclient.getaccesstoken (abfsclient.java:105555555555555555 года. /> org.apache.hadoop.fs.azurebfs.services.absrestoperation.executehttpoperation(abfsrestoperation.java:256)
... 23 еще < /p>
< /blockquote>
Подробнее здесь: https://stackoverflow.com/questions/729 ... pp-service