public static ValidateSubscription ( |
||
subscription | The |
|
return | void |
/// <summary> /// Retrieve the SQL Management client for the currently selected subscription. /// </summary> /// <returns>The SQL Management client for the currently selected subscription.</returns> public static SqlManagementClient GetCurrentSqlClient() { // Get the SQL management client for the current subscription WindowsAzureSubscription subscription = WindowsAzureProfile.Instance.CurrentSubscription; SqlDatabaseCmdletBase.ValidateSubscription(subscription); return(subscription.CreateClient <SqlManagementClient>()); }
/// <summary> /// Retrieve the SQL Management client for the currently selected subscription, adding the session and request /// id tracing headers for the current cmdlet invocation. /// </summary> /// <returns>The SQL Management client for the currently selected subscription.</returns> protected SqlManagementClient GetCurrentSqlClient() { // Get the SQL management client for the current subscription WindowsAzureSubscription subscription = WindowsAzureProfile.Instance.CurrentSubscription; SqlDatabaseCmdletBase.ValidateSubscription(subscription); SqlManagementClient client = subscription.CreateClient <SqlManagementClient>(); client.HttpClient.DefaultRequestHeaders.Add(Constants.ClientSessionIdHeaderName, clientSessionId); client.HttpClient.DefaultRequestHeaders.Add(Constants.ClientRequestIdHeaderName, clientRequestId); return(client); }
/// <summary> /// Retrieve the SQL Management client for the currently selected subscription, adding the session and request /// id tracing headers for the current cmdlet invocation. /// </summary> /// <returns>The SQL Management client for the currently selected subscription.</returns> protected SqlManagementClient GetCurrentSqlClient() { // Get the SQL management client for the current subscription IAzureSubscription subscription = Profile.Context.Subscription; SqlDatabaseCmdletBase.ValidateSubscription(subscription); SqlManagementClient client = AzureSession.Instance.ClientFactory.CreateClient <SqlManagementClient>(Profile, subscription, AzureEnvironment.Endpoint.ServiceManagement); client.HttpClient.DefaultRequestHeaders.Add(Constants.ClientSessionIdHeaderName, clientSessionId); client.HttpClient.DefaultRequestHeaders.Add(Constants.ClientRequestIdHeaderName, clientRequestId); return(client); }