https://github.com/diberry/py-e2e-azure-function-passwordless-storage
https://github.com/diberry/py-e2e-azure-function-passwordless-storage
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/diberry/py-e2e-azure-function-passwordless-storage
- Owner: diberry
- Created: 2022-11-03T17:49:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-03T18:02:23.000Z (over 3 years ago)
- Last Synced: 2025-06-04T20:15:57.754Z (about 1 year ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 1. Create service principal
```
az ad sp create-for-rbac --name myServicePrincipalName
```
Save result JSON, use in `local.settings.json`.
# 2. Configure local Azure function
* AZURE_CLIENT_ID: The app (client) id
* AZURE_CLIENT_SECRET: The app password
* AZURE_TENANT_ID: The tenant the AAD app was created in
* AZURE_STORAGE_RESOURCE_NAME: The Azure storage account name
* AZURE_STORAGE_CONTAINER_NAME: Existing container name in storage account - should have at least 1 blob uploaded
# 3. Configure Azure Blob Storage IAM
1. In Azure portal, add service principal as IAM identity with **Storage Blob Data Contributor role**.
# 4. Run function in local debug
1. Use Postman or cURL for 'http://localhost:7071/api/list
2. Returns JSON as list of blobs in container
```json
["README.md"]
```