Add support for creating functions projects with dockerfiles #3929
Add support for creating functions projects with dockerfiles #3929
Conversation
| import { type IProjectWizardContext } from "../IProjectWizardContext"; | ||
|
|
||
| export interface IDockerfileProjectContext extends IActionContext, ExecuteActivityContext, IProjectWizardContext { | ||
| projectLanguage?: string; |
There was a problem hiding this comment.
IProjectWizardContext already should have a language: ProjectLanguage property that you should be able to leverage.
| import { ProjectLanguage } from "../../../constants"; | ||
| import { type IDockerfileProjectContext } from "./IDockerfileProjectContext"; | ||
|
|
||
| export class DockerfileProjectLanguageStep extends AzureWizardPromptStep<IDockerfileProjectContext> { |
There was a problem hiding this comment.
You could probably just use the NewProjectLanguageStep and add some filtering in the case for DockerfileProjectLanguageStep instead of creating a new file that does largely the same thing.
There was a problem hiding this comment.
I did think about that but the data property in the NewProjectLanguageStep does not match up with the data property I need. I can utilize language: ProjectLanguage property that you commented about above but will probably still need the new step since the data is different.
There was a problem hiding this comment.
Actually update since I am not using the NewProjectLanguageStep I don't think I can use the language: ProjectLanguage since the data types don't match up.
There was a problem hiding this comment.
Yeah but you should be able to just change the type instead of using a string.
There was a problem hiding this comment.
Looking at this more, I think we should just speak offline about this.
…o meganmott/dockerfileProject
| "azureFunctions.createFunctionAppAdvanced": "Create Function App in Azure... (Advanced)", | ||
| "azureFunctions.createFunctionAppDetail": "For serverless, event driven apps and automation.", | ||
| "azureFunctions.createNewProject": "Create New Project...", | ||
| "azureFunctions.createNewProjectWithDockerfile": "Create New Project With Dockerfile...", |
There was a problem hiding this comment.
Maybe we should call it Create New Containerized Project...?
I don't have a strong preference, but the learn document does refer to it as a containerized function app.
|
|
||
| targetFramework?: string | string[]; | ||
|
|
||
| dockerfile?: boolean; |
There was a problem hiding this comment.
Property name is a bit odd for a boolean. If I see dockerfile, I think it's the dockerfile path or Uri. I would have called it addDockerfile or something like that.
But that being said, I don't think you need this property anymore. I'm assuming it used to be used to determine whether or not to add the CreateDockerfileProjectStep but we've covered that in another way.
| public priority: number = 100; | ||
|
|
||
| public async execute(context: IFunctionWizardContext): Promise<void> { | ||
| const message: string = localize('installFuncTools', 'You must have the Azure Functions Core Tools installed to run this command.'); |
There was a problem hiding this comment.
I mentioned this in another PR, but you should front-load this error. Nothing more annoying than going through a project wizard and then having it fail right at the end.
nturinski
left a comment
There was a problem hiding this comment.
It's a just a nit, so if you disagree, feel free to just merge! Looks good!
| const optionalExecuteStep = options.executeStep; | ||
|
|
||
| if (optionalExecuteStep instanceof CreateDockerfileProjectStep) { | ||
| const message: string = localize('installFuncTools', 'You must have the Azure Functions Core Tools installed to run this command.'); |
There was a problem hiding this comment.
nit: Since we know what command they are running, I think we should tell them specifically that they need to have the core tools installed to create a containerized function project or whatever.
Contributes to #3523
Currently the entry point is next to the current "Create New Project..." command in the workspace view:
