Hello,
I have a Power Apps and Power Pages project in production for a while that uses Microsoft Dataverse and I have encountered a limitation that I am trying to resolve.
In my schema, I have a column of type "File" for which the "Maximum file size" is set to 32MB. I need to increase this limit to accommodate larger files, but the option to edit this setting is grayed out in the column properties.
Is there a simple way to increase the file size limit beyond 32MB for an existing "File" column in Dataverse ?
I appreciate any guidance or suggestions you might have on how to address this issue.
Thank you !
Charles
Hello,
I'd like to reopen the subject.
Do you have any idea why I'm getting the 401 Unauthorized error with the following code? I did create an Azure AD application with the Dynamics CRM.user_impersonation permission.
Here is the code used to generate the token:
public static async Task<string> GetToken(string tenantId, string clientId, string clientSecret, string instanceUrl)
{
using (var client = new HttpClient())
{
string url = $"https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token";
var data = new Dictionary<string, string>
{
["client_id"] = clientId,
["scope"] = $"{instanceUrl}/.default",
["client_secret"] = clientSecret,
["grant_type"] = "client_credentials"
};
var request = new HttpRequestMessage(HttpMethod.Post, url) { Content = new FormUrlEncodedContent(data) };
var response = await client.SendAsync(request);
if (!response.IsSuccessStatusCode)
{
Console.WriteLine($"Error obtaining token: {response.StatusCode}");
return null;
}
var json = await response.Content.ReadAsStringAsync();
var tokenResponse = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
return tokenResponse != null && tokenResponse.ContainsKey("access_token") ? tokenResponse["access_token"] : null;
}
}
}
Many thanks in advance !
Charles
Thank you @AhmedSalih @for your reply, which sounds promising!
However, I can't get the result I'm looking for. I've written the code below, but I get a 401 (Unauthorized) error on the first request.
To obtain the token, I created an Azure AD application with Dynamics CRM -> user_impersonation permissions.
Here's the C# code I used:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace Change_Dataverse_file_column_max_size
{
internal class Program
{
static async Task Main(string[] args)
{
await UpdateColumn();
}
private static async Task UpdateColumn()
{
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "[my_token]");
client.DefaultRequestHeaders.Add("OData-MaxVersion", "4.0");
client.DefaultRequestHeaders.Add("OData-Version", "4.0");
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
string instanceUrl = "https://[my_org].crm12.dynamics.com";
string tableName = "cg_commande";
string columnName = "cg_fichierstl";
string attributeUrl = $"{instanceUrl}/api/data/v9.2/EntityDefinitions(LogicalName='{tableName}')/Attributes(LogicalName='{columnName}')/Microsoft.Dynamics.CRM.ImageAttributeMetadata";
// Get existing attributes
HttpResponseMessage response = await client.GetAsync(attributeUrl);
response.EnsureSuccessStatusCode();
string attributeJson = await response.Content.ReadAsStringAsync();
// Update the column by changing the MaxSizeInKB property and then sending a PUT request with the updated JSON
attributeJson = attributeJson.Replace("\"MaxSizeInKB\": 32768", "\"MaxSizeInKB\": 65536");
HttpContent content = new StringContent(attributeJson, Encoding.UTF8, "application/json");
HttpResponseMessage updateResponse = await client.PutAsync(attributeUrl, content);
response.EnsureSuccessStatusCode();
Console.ReadKey();
}
}
}
}
Thanks in advance!
Charles
Thanks @Rahman1005 , but I have the impression that this article explains the change at column creation, not at editing.
Thank you @GuidoPreite for this proposal, which seems feasible and not too risky!
Hello, @CharlesPP, to add to what what @GuidoPreite, has mentioned, The MaxSizeInKB value cannot be changed in Power Apps using the designer after you create the file column. You can use the API to update the MaxSizeInKB property. Update a column using Web API and Update a column using SDK
More information: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/create-update-column-definitions-using-web-api#update-a-column
If my reply helped you, please give a 👍 If it solved your issue, please give a 👍 & accept it as the Solution to help other community members find it more.
Visit my Blog: ahmedsalih.blog
Visit my YouTube Channel: https://www.youtube.com/@powerplatformplace/videos
Hi,
Could you please refer below article to increase file size
the size cannot be changed after it has been created, so the field should be deleted and recreated.
there is a post explaining another approach to update the value
https://www.c-sharpcorner.com/article/update-size-of-file-column-in-dataverse-table/
but I don't know if it still work (so my suggestion will be to delete and recreate the field)
mmbr1606
22
Super User 2025 Season 1
stampcoin
19
Michael E. Gernaey
15
Super User 2025 Season 1