Hi @Anonymous
Sorry for the delayed response. But in your httpselect.cs
file, you're using the wrong attribute. That's why the function isn't showing. Change [FunctionName("SqlSelect")]
to [Function("SqlSelect")]
.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I've tried many permutations but with so many files and options I think that listing them would be overkill. I'm using Visual Studio 2022 on Windows 10 to create an Azure Functions app (in C# using .Net6 isolated). I am new to Azure Functions but I'm not new to coding. I'm basically creating a repository of Azure functions (each in a separate file) for eventual use. I started with the boilerplate HttpTrigger that simply responds with an acknowledgement on the browser (see fn_httpget.txt). Then I created an HttpTrigger with endpoints to respond with some information (see httpendpoint.txt). Everything so far works.
My issue has to do with the third function where I'm trying to use the same type of HttpTrigger to query an Azure SQL database. See the file httpselect.txt. Assume that the query works. Also, there are no outstanding errors. When I debug/run the project I don't see the "SqlSelect" function like I see the other two.
I've defined the SqlConnectionString inside local.settings.json and it looks as follows:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"SqlConnectionString": "Server={xyz,1433};Initial Catalog={dbname};Persist Security Info=False;User ID={username};Password={passwd};"
}
}
I set a breakpoint in the httpselect.cs file right after the definition of the variable 'connectionString' and the code never seems to reach that point, as if the entire function file is skipped. Note that I've defined the HttpTrigger with a null as well as non-null ("httpselect") Route. I've tried to look for a log file but there doesn't seem to be one (one suggestion was to look a the logs in the Azure "monitor" and so I'm looking for the corresponding thing locally). I realize that the connection to the Azure SQL database could be an issue but I figure that at least there would be an error during the build or when running that particular function/end point. My expectation would be to see three functions in the output, "SqlSelect" being one of them.
If anyone has any suggestions on what could possibly be the problem please send them through. I've tried too many things and I think that a fresh perspective would be helpful. Thank you in advance!
p.s. This is what my host.json looks like.
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
}
}
Hi @Anonymous
Sorry for the delayed response. But in your httpselect.cs
file, you're using the wrong attribute. That's why the function isn't showing. Change [FunctionName("SqlSelect")]
to [Function("SqlSelect")]
.