Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
MartinaHawkins
Frequent Visitor

Index was out of range. Must be non-negative and less than the size of the collection.

Hi, I am getting this error when trying to connect an Azure Storage datalake V2 table to Power BI.

 

Can anyone please explain what this means or what the solution is

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @MartinaHawkins 

The error message “Index was out of range. Must be non-negative and less than the size of the collection” typically indicates that an invalid index has been used when accessing a collection, such as an array or list. Specifically, this means that the index you are trying to access is either negative or exceeds the size of the collection.

 

I have looked into several solutions for similar issues you might be facing, and you can try the following steps:

1.Firstly, please check that the URL you have entered for Data Lake Storage Gen2 meets the required specifications.

 Here is a screenshot from the relevant documentation:

vlinyulumsft_0-1730957583854.png

For further details, please refer to the documentation.

Azure Data Lake Storage Gen2 - Power Query | Microsoft Learn
Analyze data in Azure Data Lake Storage Gen2 by using Power BI - Power Query | Microsoft Learn
 

2.Secondly, ensure that the correct ports are open for your network/firewall.

vlinyulumsft_1-1730957583857.png

For more information, please consult the documentation.

Azure AD Connect Error - ArgumentOutOfRangeException: Index was out of range - Microsoft Q&A

https://learn.microsoft.com/en-us/azure/active-directory/hybrid/reference-connect-ports#table-1---az...

 

3.Next, based on another document related to the same error, you might also consider upgrading Az.Resources to see if that resolves the issue:

vlinyulumsft_2-1730957652337.png

For detailed guidance, please refer to the documentation.

PowerShell Gallery | Az.Resources 7.5.0

Get-AzRoleAssignment: Index was out of range. Must be non-negative and less than the size of the col...

 

4.Finally, you could try changing the account privileges to see if that helps resolve the problem.

vlinyulumsft_3-1730957652342.png

Azure AD Connect Error - ArgumentOutOfRangeException: Index was out of range - Microsoft Q&A
Microsoft Entra Connect: Accounts and permissions - Microsoft Entra ID | Microsoft Learn


Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi, @MartinaHawkins 

The error message “Index was out of range. Must be non-negative and less than the size of the collection” typically indicates that an invalid index has been used when accessing a collection, such as an array or list. Specifically, this means that the index you are trying to access is either negative or exceeds the size of the collection.

 

I have looked into several solutions for similar issues you might be facing, and you can try the following steps:

1.Firstly, please check that the URL you have entered for Data Lake Storage Gen2 meets the required specifications.

 Here is a screenshot from the relevant documentation:

vlinyulumsft_0-1730957583854.png

For further details, please refer to the documentation.

Azure Data Lake Storage Gen2 - Power Query | Microsoft Learn
Analyze data in Azure Data Lake Storage Gen2 by using Power BI - Power Query | Microsoft Learn
 

2.Secondly, ensure that the correct ports are open for your network/firewall.

vlinyulumsft_1-1730957583857.png

For more information, please consult the documentation.

Azure AD Connect Error - ArgumentOutOfRangeException: Index was out of range - Microsoft Q&A

https://learn.microsoft.com/en-us/azure/active-directory/hybrid/reference-connect-ports#table-1---az...

 

3.Next, based on another document related to the same error, you might also consider upgrading Az.Resources to see if that resolves the issue:

vlinyulumsft_2-1730957652337.png

For detailed guidance, please refer to the documentation.

PowerShell Gallery | Az.Resources 7.5.0

Get-AzRoleAssignment: Index was out of range. Must be non-negative and less than the size of the col...

 

4.Finally, you could try changing the account privileges to see if that helps resolve the problem.

vlinyulumsft_3-1730957652342.png

Azure AD Connect Error - ArgumentOutOfRangeException: Index was out of range - Microsoft Q&A
Microsoft Entra Connect: Accounts and permissions - Microsoft Entra ID | Microsoft Learn


Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.