Azure / Azure/azure-functions-host

Feature Request: Blob Binding (out): Set Metadata Properties Like CacheControl and ContentType

Open
#1,664 1 comment 8 reactions 0 assignees View on GitHub
enhancement needs-discussion
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

It would be handy to be able to set metadata properties for Blobs like Cache-Control and Content-Type.

#### Known workarounds

It is required to use the SDK for creating blobs that require custom metadata property values.

#### Related information

Perhaps a "propeties" value could be added to the json for out blob.

To Set the Value Statically with Functions.json

```json
{
"name": "outputBlob",
"type": "blob",
"direction": "out",
"path": "{container}/{blob}",
"connection": "AZURE_STORAGE_CONNECTION_STRING",
"properties": {
"cacheControl": "public, max-age 86400",
"contentType": "application/json",
"contentEncoding": "gzip"
}
}
```

To Set the Value at Runtime:

```javascript

context.bindings.outputBlob = {data: '...'};
context.bindingsMetadata.outputBlob.properties = {contentType:'application/json'};

```

Contributor guide

Open the contributing guide

Research direction

No source files or tests are named. Start by tracing the Blob output binding and how its JSON configuration and runtime metadata are handled; done should mean Cache-Control, Content-Type, Content-Encoding, and similar properties can be supplied statically or at runtime and applied to created blobs.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.