I created an azure function in Python that gets triggered after a blob upload happens. I would like to copy and rename the blob to another storage. This is what I have right now:
// function.json
{
"scriptFile": "main.py",
"bindings": [
{
"name": "myblob",
"type": "blobTrigger",
"direction": "in",
"path": "ingress/upload/{name}",
"connection": "conn_STORAGE"
},
{
"name": "myblobout",
"type": "blob",
"direction": "out",
"path": "ingress/test/{name}",
"connection": "conn_STORAGE"
}]
}
# main.py
import logging
import azure.functions as func
def main(myblob: func.InputStream, myblobout: func.Out[bytes]):
myblobout.set(myblob.read())
This works fine but it only copies the file. How can I rename the file dynamically during runtime?
Thx!