Where to place code for authentication and file actions for NodeJS API?
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.
1 answer
Sort by: Most helpful
-
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