I've deployed an SSDT project using the project deployment model.
I've configured two environments Development and Production.
If I view the environment Identifier by viewing their properties the ID is listed as 5 and 6 respectively.
I've configured the project to use those two environments.
I have to launch the packages via Powershell and the dtexec command.
When I specify the dtexec command as:
dtexec.exe /server "MYSERVER" /isserver "\SSISDB\MyFolder\MyProject\MyPackage.dtsx" /env 5
I get this error:
Failed to execute IS server package because of error 0x80131904. Server: MYSERVER, Package path: \SSISDB\MyFolder\MyProject\MyPackage.dtsx, Environment reference Id: 5.
Description: The environment reference '5' is not associated with the project.
Googling around I found this query:
FROM SSISDB.[catalog].environment_references er
JOIN SSISDB.[catalog].projects p ON p.project_id = er.project_id
WHERE er.environment_name = 'Development'
AND p.name = 'MyProject';
This query returns 11.
This value works in dtexec.
What the ...???