Azure 함수에서 Google.Cloud.BigQuery.V2 (1.0.0-beta10) API를 사용하는 방법이 있습니까? 내 project.json에서Azure 함수에서 Google.Cloud.BigQuery.V2 API 사용
error CS0103: The name 'BigQueryClient' does not exist in the current context
error CS0246: The type or namespace name 'BigQueryTable' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'BigQueryJob' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'CreateQueryJobOptions' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'BigQueryResults' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'GetQueryResultsOptions' could not be found (are you missing a using directive or an assembly reference?)
Compilation failed.
나는 다음과 같은 코드가 있습니다 : 나는를
{
"frameworks": {
"net46":{
"dependencies": {
"Google.Cloud.BigQuery.V2": "1.0.0-beta10"
}
}
}
}
생각
나는이 API와 푸른 함수 내 C# 코드를 사용하지만이 오류가 좋아 API는 .NET 버전 4.5이고 Azure 함수는 4.6이 필요합니다. 따라서 AF에서이 API를 사용할 수있는 방법이없는 것 같습니다. "net45"로 시도했지만 동일한 오류가 발생합니다.
업데이트 :이 API는 AF에서 작동합니다 (아래 설명 참조). 편집이 완료되었습니다. 하지만 내 기능은 누락 된 자격 증명 때문에 여전히 작동하지 않습니다. 내 Visual Studio에서 코드를 실행하고해야처럼 작동하지만, AF에서 나는 다음과 같은 오류가 발생했습니다 :
Exception while executing function: Functions.TimerTriggerCSharp1. mscorlib: Exception has been thrown by the target of an invocation. Google.Api.Gax: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
은 이미 JSON은 내 AF에 업로드 파일로 서비스 계정 키를 생성합니다. 이 Google.Cloud.BigQuery.V2을 (사용할 수 있습니다 전에
string projectId = "...";
string datasetId = "...";
var client = BigQueryClient.Create(projectId);
List<BigQueryTable> tables = client.ListTables(datasetId).ToList();
패키지 대상이 괜찮 및 net46에 작동합니다. 코드를 공유 할 수 있습니까? 패키지 복원 프로세스가 진행되고 있습니까? 우연히 project.lock.json 파일을 배포하고 있습니까? –
의견을 보내 주셔서 감사합니다. 왜 그런지 모르지만 몇 분 후에는 이러한 오류없이 작동했습니다. 편집이 완료되었습니다. 하지만 자격 증명이 없어서 내 기능이 작동하지 않습니다. 나는 내 질문을 업데이트 할 것이다. – Mogry