Hunter Bowling Thanks for posting your question in Microsoft Q&A. Based on your description, you have created a function createContainerSas
in Server-side code, but this function is not directly accessible in the client-side code via HTML. This is expected and see similar discussion in Node.js. Instead, you would need to define a Function as HttpTrigger in Functions app and make a HTTP request from the client-side to that endpoint. Here is HTTP Triggers guide that would help (also Use Azure Functions to develop Node.js serverless solutions).
Looking at the approach, you are trying to generate a SAS token with storage account key, but I suggest you using managed identity of Azure Functions. Here are the steps you can follow:
- Enable System-assigned managed identity for your Function App
- Assign necessary RBAC roles for the identity to your storage account.
- Then add
Azure.Identity
package to your Function app and useDefaultAzureCredential
instead of StorageSharedKeyCredential in your code.
You can refer doc Access Azure services from a .NET web app for more detailed info on this. The steps described are alternative to using Storage account key to generate SAS token.
Regarding how to pass the generated SAS token to UI, you can either directly call this Azure Function app endpoint from API/UI or embed this SAS token generation process in your existing Function app itself depending on the design/approach. I hope this helps and let me know if you have any questions.
If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.