use of com.microsoft.azure.toolkit.intellij.function.runner.deploy.FunctionDeploymentConfigurationFactory in project azure-tools-for-java by Microsoft.
the class DeployFunctionAppAction method getRunConfigurationSettings.
private RunnerAndConfigurationSettings getRunConfigurationSettings(RunManagerEx manager) {
final ConfigurationFactory factory = new FunctionDeploymentConfigurationFactory(functionType);
final String runConfigurationName = String.format("%s: %s:%s", factory.getName(), project.getName(), functionNode.getName());
RunnerAndConfigurationSettings settings = manager.findConfigurationByName(runConfigurationName);
if (settings == null) {
settings = manager.createConfiguration(runConfigurationName, factory);
}
final RunConfiguration runConfiguration = settings.getConfiguration();
if (runConfiguration instanceof FunctionDeployConfiguration) {
final IFunctionApp functionApp = Azure.az(AzureAppService.class).functionApp(functionNode.getId());
final FunctionAppConfig config = FunctionAppService.getInstance().getFunctionAppConfigFromExistingFunction(functionApp);
((FunctionDeployConfiguration) runConfiguration).saveConfig(config);
}
return settings;
}
use of com.microsoft.azure.toolkit.intellij.function.runner.deploy.FunctionDeploymentConfigurationFactory in project azure-tools-for-java by Microsoft.
the class DeployFunctionAction method runConfiguration.
private void runConfiguration(Module module) {
// todo: investigate when will module be null
if (module == null) {
return;
}
final Project project = module.getProject();
final RunManagerEx manager = RunManagerEx.getInstanceEx(project);
final ConfigurationFactory factory = new FunctionDeploymentConfigurationFactory(configType);
final RunnerAndConfigurationSettings settings = RunConfigurationUtils.getOrCreateRunConfigurationSettings(module, manager, factory);
if (RunDialog.editConfiguration(project, settings, message("function.deploy.configuration.title"), DefaultRunExecutor.getRunExecutorInstance())) {
final List<BeforeRunTask> tasks = new ArrayList<>(manager.getBeforeRunTasks(settings.getConfiguration()));
manager.addConfiguration(settings, false, tasks, false);
manager.setSelectedConfiguration(settings);
ProgramRunnerUtil.executeConfiguration(project, settings, DefaultRunExecutor.getRunExecutorInstance());
}
}
Aggregations