Skip to content

Commit

Permalink
azure blob storage etag and ifmatch support
Browse files Browse the repository at this point in the history
  • Loading branch information
akhenakh committed Aug 8, 2024
1 parent c3a785a commit 3ccbb95
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 131 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,27 @@ To upload your files to AWS S3 you will need an IAM policy for writing/reading t
]
}

## Azure Specific Dev Notes
Run a local blobstore emulator:
```shell
podman run -p 10000:10000 -v .:/log mcr.microsoft.com/azure-storage/azurite \
azurite-blob --debug /log/debug.log
```
Azurite accepts the same well-known account and key used by the legacy Azure Storage Emulator.

- Account name: `devstoreaccount1`
- Account key: `Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==`

Uploading files:
```sh
export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;"
az storage container create --name data
az storage blob upload --file a1.pmtiles --container-name data --name a.pmtiles
az storage blob upload --overwrite --file a2.pmtiles --container-name data --name a.pmtiles
```


Starting pmtiles:
```sh
AZURE_STORAGE_ACCOUNT=devstoreaccount1 AZURE_STORAGE_KEY="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" ./go-pmtiles serve --port=8084 / --bucket="azblob://data?protocol=http&domain=127.0.0.1:10000"
```
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ go 1.21.0
toolchain go1.21.5

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0
github.com/RoaringBitmap/roaring v1.5.0
github.com/alecthomas/kong v0.8.0
github.com/aws/aws-sdk-go v1.51.30
Expand All @@ -30,10 +32,8 @@ require (
cloud.google.com/go/storage v1.41.0 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
Expand Down
Loading

0 comments on commit 3ccbb95

Please sign in to comment.