Skip to content

build: update azurefunctions-extensions-blob to 1.0.0b1 #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 24, 2024
13 changes: 6 additions & 7 deletions azurefunctions-extensions-bindings-blob/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Azure Functions Extension Blob library for Python
# Azure Functions Extensions Bindings Blob library for Python
This library allows Blob Trigger and Blob Input bindings in Python Function Apps to recognize and bind to client types from the
Azure Storage Blob sdk.

Expand All @@ -8,8 +8,7 @@ Blob client types can be generated from:
* Blob Input

[Source code](https://github.com/Azure/azure-functions-python-extensions/tree/main/azurefunctions-extensions-bindings-blob)
| Package (PyPi)
| Package (Conda)
[Package (PyPi)](https://pypi.org/project/azurefunctions-extensions-bindings-blob/)
| API reference documentation
| Product documentation
| [Samples](hhttps://github.com/Azure/azure-functions-python-extensions/tree/main/azurefunctions-extensions-bindings-blob/samples)
Expand All @@ -24,7 +23,7 @@ Blob client types can be generated from:
[Azure storage account](https://docs.microsoft.com/azure/storage/common/storage-account-overview) to use this package.

### Install the package
Install the Azure Functions Extension Blob library for Python with pip:
Install the Azure Functions Extensions Bindings Blob library for Python with pip:

```bash
pip install azurefunctions-extensions-bindings-blob
Expand All @@ -46,7 +45,7 @@ az storage account create -n my-storage-account-name -g my-resource-group
```

### Bind to the SDK-type
The Azure Functions Extension Blob library for Python allows you to create a function app with a Blob Trigger or
The Azure Functions Extensions Bindings Blob library for Python allows you to create a function app with a Blob Trigger or
Blob Input and define the type as a BlobClient, ContainerClient, or StorageStreamDownloader. Instead of receiving
an InputStream, when the function is executed, the type returned will be the defined SDK-type and have all of the
properties and methods available as seen in the Azure Storage Blob library for Python.
Expand All @@ -63,7 +62,7 @@ import azurefunctions.extensions.bindings.blob as blob
def blob_trigger(client: blob.BlobClient):
logging.info(f"Python blob trigger function processed blob \n"
f"Properties: {client.get_blob_properties()}\n"
f"Blob content: {client.download_blob(encoding="utf-8").readall()}")
f"Blob content head: {client.download_blob(encoding="utf-8").read(size=1)}")


@app.route(route="file")
Expand All @@ -73,7 +72,7 @@ def blob_trigger(client: blob.BlobClient):
def blob_input(req: func.HttpRequest, client: blob.BlobClient):
logging.info(f"Python blob input function processed blob \n"
f"Properties: {client.get_blob_properties()}\n"
f"Blob content: {client.download_blob(encoding="utf-8").readall()}")
f"Blob content head: {client.download_blob(encoding="utf-8").read(size=1)}")
```

## Troubleshooting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"BlobClientConverter",
]

__version__ = "1.0.0a1"
__version__ = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def blob_trigger(client: blob.BlobClient):
logging.info(
f"Python blob trigger function processed blob \n"
f"Properties: {client.get_blob_properties()}\n"
f"Blob content: {client.download_blob().readall()}"
f"Blob content head: {client.download_blob().read(size=1)}"
)


Expand All @@ -45,8 +45,8 @@ def blob_trigger(client: blob.BlobClient):
)
def blob_input(req: func.HttpRequest, client: blob.BlobClient):
logging.info(
f"Python blob trigger function processed blob \n"
f"Python blob input function processed blob \n"
f"Properties: {client.get_blob_properties()}\n"
f"Blob content: {client.download_blob().readall()}"
f"Blob content head: {client.download_blob().read(size=1)}"
)
return "ok"
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def blob_trigger(client: blob.ContainerClient):
@app.blob_input(arg_name="client", path="CONTAINER", connection="AzureWebJobsStorage")
def blob_input(req: func.HttpRequest, client: blob.BlobClient):
logging.info(
f"Python blob trigger function processed blob \n"
f"Python blob input function processed blob \n"
f"Properties: {client.get_container_properties()}\n"
)
return "ok"
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def blob_trigger(stream: blob.StorageStreamDownloader):
def blob_input(req: func.HttpRequest, stream: blob.StorageStreamDownloader):
for chunk in stream.chunks():
logging.info(
f"Python blob trigger function processed blob chunk \n"
f"Python blob input function processed blob chunk \n"
f"Chunk: {chunk.decode()}"
)
return "ok"