.Net コア プロジェクトで GCP SecretManager を使用してきましたが、GCP に配置されたシークレットの 1 つにアクセスするとエラーがスローされます
Grpc.Core.RpcException: 'Status(StatusCode="Unavailable", Detail="failed to connect to all addresses", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1621849302.013000000","description" :"サブチャネルの選択に失敗しました","ファイル":"......\src\core\ext\filters\client_channel\client_channel.cc","file_line":5397,"referenced_errors":[{"created" :"@1621849296.458000000","説明":"すべてのアドレスに接続できませんでした","ファイル":"......\src\core\ext\filters\client_channel\lb_policy\pick_first\pick_first.cc", "file_line":398,"grpc_status":14}]}")'
public String AccessSecretVersion(string projectId = "strategic-ivy-310114", string secretId = "connectionString", string secretVersionId = "1")
{
var credential = GoogleCredential.FromFile(@"C:\Learning\SampleApps\CosmosWithSecret\CosmosDBApp\CosmosDb_Demo_Crud\strategic-ivy-615459-a0f786577j32.json");
// Create the client.
SecretManagerServiceClient client = SecretManagerServiceClient.Create();
// Build the resource name.
SecretVersionName secretVersionName = new SecretVersionName(projectId, secretId, secretVersionId);
// Call the API.
AccessSecretVersionResponse result = client.AccessSecretVersion(secretVersionName);
// Convert the payload to a string. Payloads are bytes by default.
String payload = result.Payload.Data.ToStringUtf8();
return payload;
}