Skip to content
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

Support WebJobs configuration fallback logic #14825

Merged
merged 3 commits into from
Sep 4, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Readme
  • Loading branch information
pakrym committed Sep 2, 2020
commit 59e7213a6ebfa7e32efa9430c38208921560ac41
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static class Function1
[FunctionName("Function1")]
public static IActionResult Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
[AzureClient("StorageConnection")] BlobServiceClient client)
[AzureClient("MyStorageConnection")] BlobServiceClient client)
{
return new OkObjectResult(client.GetBlobContainers().ToArray());
}
Expand All @@ -33,21 +33,29 @@ public static class Function1

The connection name should correspond to a configuration section with a connection string or a set of connection parameters that correspond to a client constructor.

For example to construct a BlobClient using a connection string use the following configuration:
For example to construct a `BlobServiceClient` using a connection string use the following configuration:

```json
{
"StorageConnection": "UseDevelopmentStorage=true"
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"MyStorageConnection": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
}
}
```

To construct a client using a `blobUri`:
To construct a client using a `serviceUri`:

```json
{
"StorageConnection": {
"blobUri": "https://{storage_account}.blob.core.windows.net/"
}
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"MyStorageConnection__serviceUri": "http://127.0.0.1:10000/devstoreaccount1/container/blob",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
}
}
```

Expand Down