示例#1
0
        private static Profile2018Network.NetworkManagementClient GetNetworkClient(Uri baseUri, CustomLoginCredentials customCredential, string subscriptionId)
        {
            var client = new Profile2018Network.NetworkManagementClient(baseUri: baseUri, credentials: customCredential)
            {
                SubscriptionId = subscriptionId
            };

            client.SetUserAgent(ComponentName);

            return(client);
        }
 private void GetNetworkClient()
 {
     if (client != null)
     {
         return;
     }
     if (customCredential != null)
     {
         client = new Profile2018Network.NetworkManagementClient(baseUri: baseUri, credentials: customCredential)
         {
             SubscriptionId = this.subscriotionId
         };
     }
     else
     {
         client = new Profile2018Network.NetworkManagementClient(baseUri: baseUri, credentials: azureCredential)
         {
             SubscriptionId = this.azureCredential.DefaultSubscriptionId
         };
     }
     client.SetUserAgent(ComponentName);
 }