Search in sources :

Example 6 with IFunctionApp

use of com.microsoft.azure.toolkit.lib.appservice.service.IFunctionApp in project azure-tools-for-java by Microsoft.

the class FunctionDeploymentState method executeSteps.

@Nullable
@Override
@AzureOperation(name = "function.deploy.state", type = AzureOperation.Type.ACTION)
public IFunctionApp executeSteps(@NotNull RunProcessHandler processHandler, @NotNull Operation operation) throws IOException {
    final FunctionDeploymentMessenger messenger = new FunctionDeploymentMessenger(processHandler);
    AzureMessager.getContext().setMessager(messenger);
    final IFunctionApp functionApp;
    if (StringUtils.isEmpty(functionDeployConfiguration.getFunctionId())) {
        functionApp = createFunctionApp(processHandler);
    } else {
        functionApp = Azure.az(AzureAppService.class).subscription(functionDeployConfiguration.getSubscriptionId()).functionApp(functionDeployConfiguration.getFunctionId());
        updateApplicationSettings(functionApp);
    }
    stagingFolder = FunctionUtils.getTempStagingFolder();
    prepareStagingFolder(stagingFolder, processHandler, operation);
    // deploy function to Azure
    FunctionAppService.getInstance().deployFunctionApp(functionApp, stagingFolder);
    // list triggers after deployment
    listHTTPTriggerUrls(functionApp);
    operation.trackProperties(AzureTelemetry.getActionContext().getProperties());
    return functionApp;
}
Also used : AzureAppService(com.microsoft.azure.toolkit.lib.appservice.AzureAppService) IFunctionApp(com.microsoft.azure.toolkit.lib.appservice.service.IFunctionApp) AzureOperation(com.microsoft.azure.toolkit.lib.common.operation.AzureOperation) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

IFunctionApp (com.microsoft.azure.toolkit.lib.appservice.service.IFunctionApp)6 AzureAppService (com.microsoft.azure.toolkit.lib.appservice.AzureAppService)2 AzureOperation (com.microsoft.azure.toolkit.lib.common.operation.AzureOperation)2 FunctionAppConfig (com.microsoft.azure.toolkit.lib.function.FunctionAppConfig)2 RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)1 ConfigurationFactory (com.intellij.execution.configurations.ConfigurationFactory)1 RunConfiguration (com.intellij.execution.configurations.RunConfiguration)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 IntellijAzureMessager (com.microsoft.azure.toolkit.intellij.common.messager.IntellijAzureMessager)1 FunctionDeployConfiguration (com.microsoft.azure.toolkit.intellij.function.runner.deploy.FunctionDeployConfiguration)1 FunctionDeploymentConfigurationFactory (com.microsoft.azure.toolkit.intellij.function.runner.deploy.FunctionDeploymentConfigurationFactory)1 IAppServicePlan (com.microsoft.azure.toolkit.lib.appservice.service.IAppServicePlan)1 IAppServiceUpdater (com.microsoft.azure.toolkit.lib.appservice.service.IAppServiceUpdater)1 AzureString (com.microsoft.azure.toolkit.lib.common.bundle.AzureString)1 IAzureMessage (com.microsoft.azure.toolkit.lib.common.messager.IAzureMessage)1 ResourceGroup (com.microsoft.azure.toolkit.lib.common.model.ResourceGroup)1 AzureTask (com.microsoft.azure.toolkit.lib.common.task.AzureTask)1 Operation (com.microsoft.azuretools.telemetrywrapper.Operation)1 AzureUIRefreshEvent (com.microsoft.azuretools.utils.AzureUIRefreshEvent)1 WebAppBasePropertyViewPresenter (com.microsoft.tooling.msservices.serviceexplorer.azure.webapp.base.WebAppBasePropertyViewPresenter)1