|
41 | 41 | import com.microsoft.azure.toolkit.lib.auth.AzureCloud; |
42 | 42 | import com.microsoft.azure.toolkit.lib.auth.AzureEnvironmentUtils; |
43 | 43 | import com.microsoft.azure.toolkit.lib.common.bundle.AzureString; |
| 44 | +import com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException; |
44 | 45 | import com.microsoft.azure.toolkit.lib.common.messager.AzureMessager; |
45 | 46 | import com.microsoft.azure.toolkit.lib.common.messager.IAzureMessage; |
46 | 47 | import com.microsoft.azure.toolkit.lib.common.messager.IAzureMessager; |
@@ -109,12 +110,16 @@ public void deploy(DeployConfig deployConfig, AzureFunctionsConfig config, |
109 | 110 | Azure.az().config().setLogLevel(HttpLogDetailLevel.NONE.name()); |
110 | 111 | initAzureAppServiceClient(config); |
111 | 112 |
|
112 | | - final FunctionAppBase<?, ?, ?> target = createOrUpdateResource( |
113 | | - config.toFunctionAppConfig(subscriptionId, appName.getAppName())); |
114 | | - Path outputDirectory = output.getOutputDirectory(); |
115 | | - Path functionStagingDir = outputDirectory.resolve(AZURE_FUNCTIONS).resolve(appName.getAppName()); |
116 | | - |
117 | | - deployArtifact(functionStagingDir, target); |
| 113 | + try { |
| 114 | + final FunctionAppBase<?, ?, ?> target = createOrUpdateResource( |
| 115 | + config.toFunctionAppConfig(subscriptionId, appName.getAppName())); |
| 116 | + Path outputDirectory = output.getOutputDirectory(); |
| 117 | + Path functionStagingDir = outputDirectory.resolve(AZURE_FUNCTIONS).resolve(appName.getAppName()); |
| 118 | + |
| 119 | + deployArtifact(functionStagingDir, target); |
| 120 | + } catch (AzureToolkitRuntimeException e) { |
| 121 | + throw new DeploymentException("Unable to deploy Azure function: " + e.getMessage().replace("\\r\\n", "\n"), e); |
| 122 | + } |
118 | 123 | producer.produce(new DeployCommandActionBuildItem(AZURE_FUNCTIONS, true)); |
119 | 124 | } |
120 | 125 |
|
|
0 commit comments