Can't create logic apps in VS Code
Describe the Bug with repro steps
- Open a folder in VS Code
- Select Create new logic app workspace
- Enter values, (I used current folder, plain logic app template, stateful workflow)
- Right click workflow.json choose open designer
- Designer fails to open and gives this message:
What type of Logic App Is this happening in?
Standard (VSCode)
Which operating system are you using?
Windows
Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg
Yes
Workflow JSON
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {},
"contentVersion": "1.0.0.0",
"outputs": {},
"triggers": {}
},
"kind": "Stateful"
}
Screenshots or Videos
Browser
N/A
Additional context
No response
Make sure you open the workspace first, then right click workflow.json and choose open designer
Make sure you open the workspace first, then right click workflow.json and choose open designer
The issue is creating the workspace in the first place. Can't open it if it hasn't created properly!
I have found the cause of this, but want it raised as a defect. We had a general program of increasing the stability of logic apps and this is a good example of how we can improve.
The cause is this: If you have a folder open VS Code, and you create the workspace in that folder, or a child folder, then you get the error. If you create the workspace in a separate folder entirely then it works.
This should be resolved or at least given a prompt to say you can't create a workspace here, my customer must work the same way I do, go to a folder, right click, open with Code.
Hi @RussSmi thank you so much for raising this issue. I have marked this as a feature request. However, as Brian said, it looks like the issue is not related to creating the logic app workspace, is more related to how the user opens the workspace. This is a general vscode implementation/behavior, workspaces helped us to have a better control over Logic Apps projects and workflows.
I don't think we are capable on controlling where the user creates a workspace. Please, if you create a workspace inside another folder please use the Open workspace from file command and select the newly crated workspace file.
As I said, indeed there is a lack of implementation to tell the user to open the workspace through the file or open the workspace from the file directly even if there is a folder open
I think even that is still very confusing because the workspace file is in the parent folder, when you create a logic app its not clear what a workspace file is or where it should go. I raised this issue because it was flagged to me by a customer, I'm a MSFT CSA. With most other VS Code projects you just open a folder, if the workspace is there it should detect it. If the user cannot create a workspace under the folder currently open in VS Code then perhaps we should prompt to use another location. The flow customer used (and I thought reasonable) was - open folder in VS code, create logic app. If there is another step required here we really should flag it
Hi @RussSmi agree, I know this causes lots of confusion. Having a workspace file is not a specifically for logic apps, it's a general vscode behavior to create a "close" context on the folders that are inside of it. We have also updated our documentation to have a better understanding on why we did that and what those workspaces are. https://learn.microsoft.com/en-us/azure/logic-apps/create-standard-workflows-visual-studio-code
- We do have a feature that is meant to catch the scenarios on when the Logic App project is not getting opened through a workspace file. Do you see something similar as this?
- I don't think there should be a limitation on where does the can user create a file or not. I think this issue is more related to not opening the project through the workspace file.
I will keep this open as I can see an improvement on always open the Logic App project through the workspace file when its get created.