private static Profile2018Compute.ComputeManagementClient GetComputeClient(Uri baseUri, CustomLoginCredentials customCredential, string subscriptionId) { var client = new Profile2018Compute.ComputeManagementClient(baseUri: baseUri, credentials: customCredential) { SubscriptionId = subscriptionId }; client.SetUserAgent(ComponentName); return(client); }
private void GetComputeClient() { if (client != null) { return; } if (customCredential != null) { client = new Profile2018Compute.ComputeManagementClient(baseUri: baseUri, credentials: customCredential) { SubscriptionId = this.subscriotionId }; } else { client = new Profile2018Compute.ComputeManagementClient(baseUri: baseUri, credentials: azureCredential) { SubscriptionId = this.azureCredential.DefaultSubscriptionId }; } client.SetUserAgent(ComponentName); }