Open svrooij opened 9 months ago
There is absolutely no documentation on how to commit a file once uploaded.
deviceAppManagement/mobileApps/{appId}/microsoft.graph.win32LobApp/contentVersions
deviceAppManagement/mobileApps/{appId}/microsoft.graph.win32LobApp/contentVersions/{contentVersionId}/files
deviceAppManagement/mobileApps/{appId}/microsoft.graph.win32LobApp/contentVersions/{contentVersionId}/files/{fileId}
deviceAppManagement/mobileApps/{appId}/microsoft.graph.win32LobApp/contentVersions/{contentVersionId}/files/{fileId}/commit
Here is my Graph SDK .NET hack extension method (as part of WinTuner):
public static Task Intune_CommitWin32LobAppContentVersionFileAsync(this GraphServiceClient graphServiceClient, string win32LobAppId, string contentVersionId, string mobileAppContentFileId, FileEncryptionInfo fileEncryptionInfo, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(graphServiceClient); ArgumentException.ThrowIfNullOrEmpty(win32LobAppId); ArgumentException.ThrowIfNullOrEmpty(contentVersionId); ArgumentException.ThrowIfNullOrEmpty(mobileAppContentFileId); ArgumentNullException.ThrowIfNull(fileEncryptionInfo); var body = new MobileAppContentFileCommitBody { FileEncryptionInfo = fileEncryptionInfo, }; var data = JsonSerializer.SerializeToUtf8Bytes(body, new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }); var requestInfo = new RequestInformation { HttpMethod = Method.POST, Content = new MemoryStream(data), URI = new Uri($"https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/{win32LobAppId}/microsoft.graph.win32LobApp/contentVersions/{contentVersionId}/files/{mobileAppContentFileId}/commit"), }; requestInfo.Headers.Add("Content-Type", "application/json"); return graphServiceClient.RequestAdapter.SendNoContentAsync(requestInfo, errorMapping: ErrorMapping, cancellationToken: cancellationToken); }
This issue is related to #510 as in things missing in the app management stuff.
Where are these paths missing from? These paths are available in the the OpenAPI file.
@irvinesunday From the docs and from the graph sdk in dotnet
Might be related to #179
There is absolutely no documentation on how to commit a file once uploaded.
Related missing paths:
deviceAppManagement/mobileApps/{appId}/microsoft.graph.win32LobApp/contentVersions
deviceAppManagement/mobileApps/{appId}/microsoft.graph.win32LobApp/contentVersions/{contentVersionId}/files
deviceAppManagement/mobileApps/{appId}/microsoft.graph.win32LobApp/contentVersions/{contentVersionId}/files/{fileId}
deviceAppManagement/mobileApps/{appId}/microsoft.graph.win32LobApp/contentVersions/{contentVersionId}/files/{fileId}/commit
Working solution for other facing this issue
Here is my Graph SDK .NET
hackextension method (as part of WinTuner):This issue is related to #510 as in things missing in the app management stuff.