Skip to content

Azure Function that exposes an HTTP endpoint for uploading base64‑encoded files to Microsoft Universal Print, handling the necessary PUT headers so Power Automate can send print jobs smoothly

Notifications You must be signed in to change notification settings

jumc1998/Universalprint-functionapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Universalprint Function App

This repository contains an Azure Function written in C# (.NET 8.0, isolated worker) to upload files to Microsoft Universal Print. The function exposes an HTTP endpoint that accepts a JSON payload with an upload URL, a base64-encoded file, and the file size. It handles constructing a PUT request with the correct Content-Range and Content-Length headers so that Power Automate can upload files to Universal Print.

Project Structure

  • UploadToUniversalPrintFunctionApp/
    • UploadToUniversalPrintFunctionApp.csproj – Azure Functions project file targeting .NET 8 (isolated).
  • UploadToUniversalPrint.cs – Implementation of the UploadToUniversalPrint function.
    • Program.cs – Entry point that starts the isolated Functions host.

Building

Use the Azure Functions Core Tools or the .NET SDK to build and run the function locally.

# build
dotnet build UploadToUniversalPrintFunctionApp/UploadToUniversalPrintFunctionApp.csproj
# start the function host
func start

Example Request

{
  "uploadUrl": "https://print.print.microsoft.com/uploadSessions/abc123?tempauthtoken=xyz",
  "fileBase64": "<Base64EncodedPDFContent>",
  "fileSize": 4533322
}

Send a POST request with the above payload to the function endpoint. The response will include the status code, reason phrase, headers, and body returned by the Universal Print upload server.

About

Azure Function that exposes an HTTP endpoint for uploading base64‑encoded files to Microsoft Universal Print, handling the necessary PUT headers so Power Automate can send print jobs smoothly

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages