title: How to pass google credential to google pub sub
body: <p>I am trying publish to google PubSub from my .NET Core App. I have already created the PubSub and a Topic in Google PubSub. I downloaded the private key json file and included in my project. I am able to read the file and create the credential but I don't see a way to pass the credential to Google's PubSub Publisher client. I have looked at the GitHub <a href="https://github.com/GoogleCloudPlatform/google-cloud-dotnet/issues/1576" rel="nofollow noreferrer">Post</a> but unfortunately I am not seeing a property named DefaultEndPoint.</p>
  
  <p>Running my code generates an error which is looking for environment variable for credential. I do not want to set the environment variable for now and if there is no alternative I will try that.</p>
  
  <p>Following is my code and let me know what I am doing wrong of is something that got changed recently.</p>
  
  <p>var credential = GoogleCredential.FromFile("app-services.json");
   PublisherClient publisher = PublisherClient.CreateAsync(topicName).Result;</p>