Azure / Azure/Azure-Functions

Enhancing Configuration Flexibility for Azure Functions Triggers

Open
#2,455 0 comments 3 reactions 0 assignees View on GitHub
feature
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

As developers, we appreciate the guidance provided through various tutorials, guides, and documentation regarding the integration of Azure Functions with various triggers like QueueTrigger, ServiceBusTrigger, and EventHub. The standard practice involves specifying connection configurations within the local.settings.json for local development and transitioning to Environment Variables within the Azure portal for production environments. This approach is depicted in the following snippets:

## local.settings.json
```json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"ServiceBusConnection__fullyQualifiedNamespace": "namespace.servicebus.windows.net"
},
"Host": {
"CORS": "*"
}
}
```
## Azure Service Bus Triggered Function

```c#
[Function("ServiceBusProcessDataAsync")]
public async Task ProcessDataAsync(
[ServiceBusTrigger("sbq-data", Connection = "ServiceBusConnection")]
ServiceBusReceivedMessage message,
ServiceBusMessageActions messageActions)
{
var data = JsonConvert.DeserializeObject(message.Body.ToString());
_logger.LogInformation($"Processing data: {data.Id}");

// Process data
await Task.Delay(1000);

// Complete the message
await messageActions.CompleteMessageAsync(message);
}
```

We understand and agree with the rationale behind keeping connection strings, credentials, and sensitive data out of the codebase and source control to uphold security best practices. However, the current methodology, while effective in separating configuration from code, seems to lack flexibility, especially for scenarios involving identity-based connections that are inherently credential-less and managed through Role-Based Access Control (RBAC).

It would be beneficial to consider extending the configuration mechanism to also allow the use of appsettings.json for loading configurations related to such identity-based connections. This could streamline the development process, reduce manual configuration overhead, and potentially simplify the deployment and CI/CD pipelines without compromising security or best practices.

In summary, while we value the existing configuration methodologies for their security benefits, an enhanced approach that includes support for appsettings.json in identity-based connection scenarios could significantly improve developer experience and efficiency.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.