public async Task<IEnumerable<Microsoft.Azure.Management.Resources.Models.ResourceGroup>> ListResourceGroups()
        {
            var client = await ResourceUtilities.GetClient().ConfigureAwait(continueOnCapturedContext: false);

            var parameters = new Microsoft.Azure.Management.Resources.Models.ResourceGroupListParameters();
            var result = await client.ResourceGroups.ListAsync(parameters, CancellationToken.None).ConfigureAwait(continueOnCapturedContext: false);

            return result.ResourceGroups;
        }
 /// <summary>
 /// Gets a collection of resource groups.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Resources.IResourceGroupOperations.
 /// </param>
 /// <param name='parameters'>
 /// Optional. Query parameters. If null is passed returns all resource
 /// groups.
 /// </param>
 /// <returns>
 /// List of resource groups.
 /// </returns>
 public static Task<ResourceGroupListResult> ListAsync(this IResourceGroupOperations operations, ResourceGroupListParameters parameters)
 {
     return operations.ListAsync(parameters, CancellationToken.None);
 }
 /// <summary>
 /// Gets a collection of resource groups.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Resources.IResourceGroupOperations.
 /// </param>
 /// <param name='parameters'>
 /// Optional. Query parameters. If null is passed returns all resource
 /// groups.
 /// </param>
 /// <returns>
 /// List of resource groups.
 /// </returns>
 public static ResourceGroupListResult List(this IResourceGroupOperations operations, ResourceGroupListParameters parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IResourceGroupOperations)s).ListAsync(parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }