Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This repository is for the active development of the Azure Functions extensions for the Python worker.
For consumers of these extensions we recommend
visiting our [public developer docs](https://docs.microsoft.com/python/azure/).
visiting the [Python developer reference for Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-reference-python).

## Getting started

Expand All @@ -12,15 +12,21 @@ in the library's project folder.

### Prerequisites

The libraries are supported on Function Apps using Python 3.9 or later. For more details, please read our page on
[Python Functions version support policy](https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions?tabs=isolated-process%2Cv4&pivots=programming-language-python#languages).
A supported Python version is required - see
[Python Functions version support policy](https://learn.microsoft.com/azure/azure-functions/functions-versions?tabs=isolated-process%2Cv4&pivots=programming-language-python#languages) for more information.

## SDK Support
* Azure Storage Blob
## Available extensions
* [Base extension](azurefunctions-extensions-base/README.md)
* [Azure Blob Storage bindings](azurefunctions-extensions-bindings-blob/README.md)
* [Azure Cosmos DB bindings](azurefunctions-extensions-bindings-cosmosdb/README.md)
* [Azure Event Hubs bindings](azurefunctions-extensions-bindings-eventhub/README.md)
* [Azure Service Bus bindings](azurefunctions-extensions-bindings-servicebus/README.md)
* [Connector bindings](azurefunctions-extensions-connectors/README.md)
* [FastAPI HTTP streaming](azurefunctions-extensions-http-fastapi/README.md)

## Need help?

* For detailed documentation visit our [Azure Functions Extensions for Python documentation]()
* Read the [Python developer reference for Azure Functions](https://learn.microsoft.com/azure/azure-functions/functions-reference-python)
* File an issue via [GitHub Issues](https://github.com/Azure/azure-functions-python-extensions/issues)
* Check [previous questions](https://stackoverflow.com/questions/tagged/azure+python) or ask new ones on StackOverflow using `azure` and `python` tags.

Expand All @@ -46,6 +52,6 @@ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additio

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
trademarks or logos is subject to and must follow
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.
14 changes: 7 additions & 7 deletions azurefunctions-extensions-bindings-blob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Blob client types can be generated from:
## Getting started

### Prerequisites
* Python 3.9 or later is required to use this package. For more details, please read our page on [Python Functions version support policy](https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions?tabs=isolated-process%2Cv4&pivots=programming-language-python#languages).
* A supported Python version is required. For more details, see the [Python Functions version support policy](https://learn.microsoft.com/azure/azure-functions/functions-versions?tabs=isolated-process%2Cv4&pivots=programming-language-python#languages).

* You must have an [Azure subscription](https://azure.microsoft.com/free/) and an
[Azure storage account](https://docs.microsoft.com/azure/storage/common/storage-account-overview) to use this package.
[Azure storage account](https://learn.microsoft.com/azure/storage/common/storage-account-overview) to use this package.

### Install the package
Install the Azure Functions Extensions Bindings Blob library for Python with pip:
Expand All @@ -31,9 +31,9 @@ pip install azurefunctions-extensions-bindings-blob

### Create a storage account
If you wish to create a new storage account, you can use the
[Azure Portal](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal),
[Azure PowerShell](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell),
or [Azure CLI](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli):
[Azure portal](https://learn.microsoft.com/azure/storage/common/storage-account-create?tabs=azure-portal),
[Azure PowerShell](https://learn.microsoft.com/azure/storage/common/storage-account-create?tabs=azure-powershell),
or [Azure CLI](https://learn.microsoft.com/azure/storage/common/storage-account-create?tabs=azure-cli):

```bash
# Create a new resource group to hold the storage account -
Expand Down Expand Up @@ -104,11 +104,11 @@ Several samples are available in this GitHub repository. These samples provide e
* From BlobInput

### Additional documentation
For more information on the Azure Storage Blob SDK, see the [Azure Blob storage documentation](https://docs.microsoft.com/azure/storage/blobs/) on docs.microsoft.com
For more information on the Azure Storage Blob SDK, see the [Azure Blob storage documentation](https://learn.microsoft.com/azure/storage/blobs/)
and the [Azure Storage Blobs README](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob).

## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

Expand Down
8 changes: 4 additions & 4 deletions azurefunctions-extensions-bindings-blob/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ examples on how to use the Azure Storage Blob client library, please see [Azure
* From BlobInput

## Prerequisites
* Python 3.9 or later is required to use this package. For more details, please read our page on [Python Functions version support policy](https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions?tabs=isolated-process%2Cv4&pivots=programming-language-python#languages).
* A supported Python version is required. For more details, see the [Python Functions version support policy](https://learn.microsoft.com/azure/azure-functions/functions-versions?tabs=isolated-process%2Cv4&pivots=programming-language-python#languages).
* You must have an [Azure subscription](https://azure.microsoft.com/free/) and an
[Azure storage account](https://docs.microsoft.com/azure/storage/common/storage-account-overview) to use this package.
[Azure storage account](https://learn.microsoft.com/azure/storage/common/storage-account-overview) to use this package.

## Setup

1. Install [Core Tools](https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=windows%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&pivots=programming-language-python)
1. Install [Core Tools](https://learn.microsoft.com/azure/azure-functions/functions-run-local?tabs=windows%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&pivots=programming-language-python)
2. Install the Azure Functions Extension Blob library for Python with [pip](https://pypi.org/project/pip/):

```bash
Expand All @@ -63,6 +63,6 @@ based on the type of function you wish to execute.

## Next steps

Visit the [SDK-type bindings in Python reference documentation](https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=get-started%2Casgi%2Capplication-level&pivots=python-mode-decorators#sdk-type-bindings-preview) to learn more about how to use SDK-type bindings in a Python Function App and the
Visit the [SDK-type bindings in Python reference documentation](https://learn.microsoft.com/azure/azure-functions/functions-reference-python?pivots=python-mode-decorators#sdk-type-bindings) to learn more about how to use SDK-type bindings in a Python Function App and the
[API reference documentation](https://aka.ms/azsdk-python-storage-blob-ref) to learn more about
what you can do with the Azure Storage Blob client library.
36 changes: 19 additions & 17 deletions azurefunctions-extensions-bindings-cosmosdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Cosmos DB client types can be generated from:
## Getting started

### Prerequisites
* Python 3.9 or later is required to use this package. For more details, please read our page on [Python Functions version support policy](https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions?tabs=isolated-process%2Cv4&pivots=programming-language-python#languages).
* A supported Python version is required. For more details, see the [Python Functions version support policy](https://learn.microsoft.com/azure/azure-functions/functions-versions?tabs=isolated-process%2Cv4&pivots=programming-language-python#languages).

* You must have an [Azure subscription](https://azure.microsoft.com/free/) and an
[Azure storage account](https://docs.microsoft.com/azure/storage/common/storage-account-overview) to use this package.
[Azure Cosmos DB for NoSQL account](https://learn.microsoft.com/azure/cosmos-db/nosql/quickstart-portal) to use this package.

### Install the package
Install the Azure Functions Extensions Bindings Cosmos DB library for Python with pip:
Expand All @@ -26,26 +26,28 @@ Install the Azure Functions Extensions Bindings Cosmos DB library for Python wit
pip install azurefunctions-extensions-bindings-cosmosdb
```

### Create a storage account
If you wish to create a new storage account, you can use the
[Azure Portal](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal),
[Azure PowerShell](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell),
or [Azure CLI](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli):
### Create a Cosmos DB account
If you wish to create a new Azure Cosmos DB for NoSQL account, you can use the
[Azure portal](https://learn.microsoft.com/azure/cosmos-db/nosql/quickstart-portal)
or [Azure CLI](https://learn.microsoft.com/cli/azure/cosmosdb?view=azure-cli-latest):

```bash
# Create a new resource group to hold the storage account -
# Create a new resource group to hold the Cosmos DB account -
# if using an existing resource group, skip this step
az group create --name my-resource-group --location westus2
resourceGroupName="my-resource-group"
accountName="my-unique-cosmos-account"

# Create the storage account
az storage account create -n my-storage-account-name -g my-resource-group
az group create --name $resourceGroupName --location westus2

# Create the Cosmos DB for NoSQL account
az cosmosdb create --resource-group $resourceGroupName --name $accountName --locations regionName=westus2
```

### Bind to the SDK-type
The Azure Functions Extensions Bindings Cosmos DB library for Python allows you to create a function app with
Cosmos DB Input and define the type as a CosmosClient, DatabaseProxy, or ContainerProxy. Instead of receiving
a DocumentList, 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 Cosmos DB library for Python.
properties and methods available as seen in the Azure Cosmos DB library for Python.


```python
Expand All @@ -56,7 +58,7 @@ import azurefunctions.extensions.bindings.cosmosdb as cosmos
app = func.FunctionApp(http_auth_level=func.AuthLevel.FUNCTION)

@app.route(route="cosmos")
@app.cosmos_db_input(arg_name="container",
@app.cosmos_db_input(arg_name="client",
connection="CosmosDBConnection",
database_name="db_name",
container_name="container_name")
Expand All @@ -82,21 +84,21 @@ Get started with our [Cosmos DB samples](https://github.com/Azure/azure-function

Several samples are available in this GitHub repository. These samples provide example code for additional scenarios commonly encountered while working with Cosmos DB:

* [cosmosdb_samples_cosmosclient](https://github.com/Azure/azure-functions-python-extensions/tree/dev/azurefunctions-extensions-binding-cosmosdb/samples/cosmosdb_samples_cosmosclient) - Examples for using the CosmosClient type:
* [cosmosdb_samples_cosmosclient](https://github.com/Azure/azure-functions-python-extensions/tree/dev/azurefunctions-extensions-bindings-cosmosdb/samples/cosmosdb_samples_cosmosclient) - Examples for using the CosmosClient type:
* From CosmosDBInput

* [cosmosdb_samples_databaseproxy](https://github.com/Azure/azure-functions-python-extensions/tree/dev/azurefunctions-extensions-bindings-cosmosdb/samples/cosmosdb_samples_databaseproxy) - Examples for using the DatabaseProxy type:
* From CosmosDBInput

* [cosmosdb_samples_containerclient](https://github.com/Azure/azure-functions-python-extensions/tree/dev/azurefunctions-extensions-bindings-cosmosdb/samples/cosmosdb_samples_containerproxy) - Examples for using the ContainerProxy type:
* [cosmosdb_samples_containerproxy](https://github.com/Azure/azure-functions-python-extensions/tree/dev/azurefunctions-extensions-bindings-cosmosdb/samples/cosmosdb_samples_containerproxy) - Examples for using the ContainerProxy type:
* From CosmosDBInput

### Additional documentation
For more information on the Azure Cosmos DB SDK, see the [Azure Cosmos DB documentation](https://learn.microsoft.com/en-us/azure/cosmos-db/) on learn.microsoft.com
For more information on the Azure Cosmos DB SDK, see the [Azure Cosmos DB documentation](https://learn.microsoft.com/azure/cosmos-db/) on learn.microsoft.com
and the [Azure Cosmos DB README](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cosmos/azure-cosmos).

## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

Expand Down
19 changes: 10 additions & 9 deletions azurefunctions-extensions-bindings-cosmosdb/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@ urlFragment: extension-cosmosdb-samples

These are code samples that show common scenario operations with the Azure Functions Extension Cosmos DB library.

These samples relate to the Azure Storage Cosmos DB client library being used as part of a Python Function App. For
examples on how to use the Azure Storage Cosmos DB client library, please see [Azure Cosmos samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cosmos/azure-cosmos/samples)
These samples relate to the Azure Cosmos DB client library being used as part of a Python Function App. For
examples on how to use the Azure Cosmos DB client library, please see [Azure Cosmos samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/cosmos/azure-cosmos/samples)

* [cosmosdb_samples_cosmosclient](https://github.com/Azure/azure-functions-python-extensions/tree/dev/azurefunctions-extensions-binding-cosmosdb/samples/cosmosdb_samples_cosmosclient) - Examples for using the CosmosClient type:
* [cosmosdb_samples_cosmosclient](https://github.com/Azure/azure-functions-python-extensions/tree/dev/azurefunctions-extensions-bindings-cosmosdb/samples/cosmosdb_samples_cosmosclient) - Examples for using the CosmosClient type:
* From CosmosDBInput

* [cosmosdb_samples_databaseproxy](https://github.com/Azure/azure-functions-python-extensions/tree/dev/azurefunctions-extensions-bindings-cosmosdb/samples/cosmosdb_samples_databaseproxy) - Examples for using the DatabaseProxy type:
* From CosmosDBInput

* [cosmosdb_samples_containerclient](https://github.com/Azure/azure-functions-python-extensions/tree/dev/azurefunctions-extensions-bindings-cosmosdb/samples/cosmosdb_samples_containerproxy) - Examples for using the ContainerProxy type:
* [cosmosdb_samples_containerproxy](https://github.com/Azure/azure-functions-python-extensions/tree/dev/azurefunctions-extensions-bindings-cosmosdb/samples/cosmosdb_samples_containerproxy) - Examples for using the ContainerProxy type:
* From CosmosDBInput

## Prerequisites
* Python 3.9 or later is required to use this package. For more details, please read our page on [Python Functions version support policy](https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions?tabs=isolated-process%2Cv4&pivots=programming-language-python#languages).
* A supported Python version is required. For more details, see the [Python Functions version support policy](https://learn.microsoft.com/azure/azure-functions/functions-versions?tabs=isolated-process%2Cv4&pivots=programming-language-python#languages).
* You must have an [Azure subscription](https://azure.microsoft.com/free/) and an
[Azure storage account](https://docs.microsoft.com/azure/storage/common/storage-account-overview) to use this package.
[Azure Cosmos DB for NoSQL account](https://learn.microsoft.com/azure/cosmos-db/nosql/quickstart-portal) to use these samples.
* You must run [Azurite](https://learn.microsoft.com/azure/storage/common/storage-use-azurite) or configure an Azure storage account for the Functions host.

## Setup

1. Install [Core Tools](https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=windows%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&pivots=programming-language-python)
1. Install [Core Tools](https://learn.microsoft.com/azure/azure-functions/functions-run-local?tabs=windows%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&pivots=programming-language-python)
2. Install the Azure Functions Extension Cosmos DB library for Python with [pip](https://pypi.org/project/pip/):

```bash
Expand All @@ -60,6 +61,6 @@ based on the type of function you wish to execute.

## Next steps

Visit the [SDK-type bindings in Python reference documentation](https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=get-started%2Casgi%2Capplication-level&pivots=python-mode-decorators#sdk-type-bindings-preview) to learn more about how to use SDK-type bindings in a Python Function App and the
[API reference documentation](https://learn.microsoft.com/en-us/python/api/azure-cosmos/azure.cosmos?view=azure-python) to learn more about
Visit the [SDK-type bindings in Python reference documentation](https://learn.microsoft.com/azure/azure-functions/functions-reference-python?pivots=python-mode-decorators#sdk-type-bindings) to learn more about how to use SDK-type bindings in a Python Function App and the
[API reference documentation](https://learn.microsoft.com/python/api/azure-cosmos/azure.cosmos?view=azure-python) to learn more about
what you can do with the Azure Cosmos DB client library.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


@app.route(route="database")
@app.cosmos_db_input(arg_name="container",
@app.cosmos_db_input(arg_name="database",
connection="CosmosDBConnection",
database_name="db_name",
container_name=None)
Expand Down
Loading
Loading