Where to place code for authentication and file actions for NodeJS API?

hampton123 1,030 Reputation points

Hi, I want users to be able to upload/download files into an Azure Storage account from my API created from an Azure Function. For context, users will first sign in using B2C, and then the user will be redirected to my API's html home page, authenticating the user though the B2C JWT token. The home page will have two buttons, redirecting the user to either an upload or download HTML page depending on what file action they want to perform. Finally, based on the information they input on the upload/download HTML page, they will either get a file downloaded from the storage account or upload a file. For additional context, the storage account's containers only accept AAD authorization, and the Azure Function will be granted an Managed Identity with Blob permissions to manipulate the storage account.

What I was wondering, however, is where should I place the code to not only upload/download a file, but for authentication? I was thinking the Azure Function would authenticate the user before performing any action, but then to perform specific file actions the user needs to submit information through the HTML pages such as the container they are associated with, the file that they want to download/upload, etc. Is there a script source for HTML pages that I could use to load Azure Storage actions?

Please let me know if I need to explain myself further, as I was not sure if this explanation was 100% understandable.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,025 questions
Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,579 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
18,738 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    2 deleted comments

    Comments have been turned off. Learn more