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

Local.Setting.Json issues - ConnectionString #211

Open
BC89 opened this issue Sep 1, 2022 · 4 comments
Open

Local.Setting.Json issues - ConnectionString #211

BC89 opened this issue Sep 1, 2022 · 4 comments

Comments

@BC89
Copy link

BC89 commented Sep 1, 2022

There's definitely some real flakiness when binding values from the local setting file. When using Azure functions input bindings it appears that keyVault or other complex objects (i.e. serilog setting) screws things up wherein the keyvault magic isn't performed or the AzureSignalRConnectionString doesn't bind to the function params. If other complex objects are in the values section, AzureSignalRConnectionString doesn't bind. Very frustrating.

	```
	<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.2" />
	<PackageReference Include="Azure.Identity" Version="1.7.0-beta.1" />
	<PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.3.0" />
	<PackageReference Include="Azure.Storage.Blobs" Version="12.14.0-beta.1" />
	<PackageReference Include="Microsoft.Azure.NotificationHubs" Version="4.1.0" />

		<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0-preview.7.22376.2" />
		<PackageReference Include="Microsoft.EntityFrameworkCore.Cosmos" Version="7.0.0-preview.7.22376.2" />
		<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="7.0.0-preview.7.22375.6" />


		<PackageReference Include="Microsoft.IdentityModel.Protocols" Version="6.22.1" />
		<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="6.22.1" />

		<PackageReference Include="Serilog" Version="2.12.0-dev-01543" />
		<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.1-dev-10301" />
		<PackageReference Include="Serilog.Settings.Configuration" Version="3.3.1-dev-00337" />
		<PackageReference Include="Serilog.Sinks.AzureTableStorage" Version="6.0.0-dev-00146" />
		<PackageReference Include="Serilog.Sinks.Console" Version="4.0.2-dev-00890" />

{
"IsEncrypted": false,
"Values": {

"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",

"Environment": "Development",

"AesIV": "https://star-development.vault.azure.net/secrets/AesIV/",
"AesKey": "https://star-development.vault.azure.net/secrets/AesKey/",
"AgolAppID": "https://star-development.vault.azure.net/secrets/AgolAppID/",
"AgolAppSecret": "https://star-development.vault.azure.net/secrets/AgolAppSecret/",
"AgolPwrd": "https://star-development.vault.azure.net/secrets/AgolPwrd/",
"AgolUrl": "https://star-development.vault.azure.net/secrets/AgolUrl/",
"AgolUser": "https://star-development.vault.azure.net/secrets/AgolUser/",
"AgolViewerUrl": "https://star-development.vault.azure.net/secrets/AgolViewerUrl/",
"AgolWebmapId": "https://star-development.vault.azure.net/secrets/AgolWebmapId/",
"AppVersion": "https://star-development.vault.azure.net/secrets/AppVersion/",
"AzureWebJobsDashboard": "https://star-development.vault.azure.net/secrets/AzureWebJobsDashboard/",
"AzureWebJobsStorage": "https://star-development.vault.azure.net/secrets/AzureWebJobsStorage/",
"CosmoCollectionName": "https://star-development.vault.azure.net/secrets/CosmoCollectionName/",
"CosmoCollectionUserSettings": "https://star-development.vault.azure.net/secrets/CosmoCollectionUserSettings/",
"CosmoDBName": "https://star-development.vault.azure.net/secrets/CosmoDBName/",
"CosmosDBAccountEndpoint": "https://star-development.vault.azure.net/secrets/CosmosDBAccountEndpoint/",
"CosmosDBAccountKey": "https://star-development.vault.azure.net/secrets/CosmosDBAccountKey/",
"CosmosDBAccountKeyRW": "https://star-development.vault.azure.net/secrets/CosmosDBAccountKeyRW/",
"NotifHubEpoint": "https://star-development.vault.azure.net/secrets/NotifHubEpoint/",
"NotifHubName": "https://star-development.vault.azure.net/secrets/NotifHubName/",
"PhotoConainter": "https://star-development.vault.azure.net/secrets/PhotoConainter/",
"PhotoConainterName": "https://star-development.vault.azure.net/secrets/PhotoConainterName/",
"PhotoThumbsConainterName": "https://star-development.vault.azure.net/secrets/PhotoThumbsConainterName/",
"SignalRTargetMethod": "https://star-development.vault.azure.net/secrets/SignalRTargetMethod/",
"TokenAudience": "https://star-development.vault.azure.net/secrets/TokenAudience/",
"TokenIssuer": "https://star-development.vault.azure.net/secrets/TokenIssuer/",

"CosmosDBCollectionV2": "https://star-development.vault.azure.net/secrets/CosmosDBCollectionV2/",
"CosmosDBNameV2": "https://star-development.vault.azure.net/secrets/CosmoDBNameV2/",

"AzureSignalRConnectionString": "Endpoint=https://starsignalr.service.signalr.net;AccessKey=RRHmDcZ8spdxkEuCPXZXIkaADHsenZjdS3+1xSYchZc=;Version=1.0;"

},

"Serilog": {
"Using": [
"Serilog.Sinks.Console",
"Serilog.Sinks.File",
"Serilog.Sinks.AzureBlobStorage"
],
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"writeInBatches": "true"
}
}
]
}

}

@Y-Sindo
Copy link
Contributor

Y-Sindo commented Sep 2, 2022

This seems to be a functions host problem, could you open an issue here https://github.com/Azure/azure-functions-host/issues ?

@BC89
Copy link
Author

BC89 commented Sep 2, 2022

I can do that certainly but have some doubts. When I do get the string from keyvault and the magic conversion happens from url to actual encoded connection string, it never binds correctly. That doesn't seem like a host issue but a binding problem because the string is correct at that point.

Thx!

@Y-Sindo
Copy link
Contributor

Y-Sindo commented Sep 3, 2022

I can do that certainly but have some doubts. When I do get the string from keyvault and the magic conversion happens from url to actual encoded connection string, it never binds correctly. That doesn't seem like a host issue but a binding problem because the string is correct at that point.

Thx!

Do you mean using a key vault URL instead of the actual connection string in the AzureSignalRConnectionString? It's not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants