Skip to content

[Bug] Issue using SQL Connection executing stored procedure #245

@mrmwink-wtwco

Description

@mrmwink-wtwco

Describe the bug

I've gone through the documentation (link below) about how to connect and execute a SQL stored procedure, but when executing I get the following error.

Error loading premiums: Execute operation failure: Cannot read properties of undefined (reading 'path').

I've tracked the issue back to the fact that the service created when creating the connection with PAC CLI is setting the "operationname" to the name of the stored procedure BUT it is capitalising the first latter, so a sproc called "sp_get_data", the associated files are all called Sp_get_data which is fine...... but the "operationname" is used in the buildOperationUrl method with the following line (line 25818 in the debugger)

const path = dataSourceInfo.apis[operationName].path;

this line fails due to the key not matching based on the case!

I'm hoping I missed something somewhere and I've got something set wrong in config, but when I change this to the correct case everything works fine.

MSFT Doc

Steps to Reproduce

  1. Set Up new code app following documentation
  2. Create stored procedure in SQL
  3. Connect to SQL database using as per docs

e.g. pac code add-data-source -a "shared_sql" -c "aaaa0000bb11222233cc444444dddddd" -d "sql-codeapps-dev.database.windows.net,sqldb-codeapps-dev" -sp "dbo.getallprojects"

  1. Checked operationame on connectorOperation in generated class of GetallprojectsService.ts

Expected behavior

Should maintain correct casing when creating service class and associated config

Actual behavior

Sets first letter of the operationame to upper case resulting in error

Error loading premiums: Execute operation failure: Cannot read properties of undefined (reading 'path')

Environment information

vite v7.3.1
PAC CLI 2.4.1 (Latest).

Metadata

Metadata

Assignees

Labels

Fix rolling outWe start the rollout with the fix for this issue.bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions