diff --git a/src/main/java/com/microsoft/jenkins/containeragents/aci/AciCleanTask.java b/src/main/java/com/microsoft/jenkins/containeragents/aci/AciCleanTask.java index 14e62f8..dfa93e1 100644 --- a/src/main/java/com/microsoft/jenkins/containeragents/aci/AciCleanTask.java +++ b/src/main/java/com/microsoft/jenkins/containeragents/aci/AciCleanTask.java @@ -251,7 +251,7 @@ private void cleanDeployments(long successTimeoutInMinutes, long failTimeoutInMi } } catch (Exception e) { LOGGER.log(Level.WARNING, - "AzureAciCleanUpTask: cleanDeployments: Failed to get/delete deployment: {0}", + "AzureAciCleanUpTask: cleanDeployments: Failed to get/delete deployment", e); // Check the number of attempts remaining. If greater than 0, decrement // and add back into the queue. diff --git a/src/main/java/com/microsoft/jenkins/containeragents/aci/AciCloud.java b/src/main/java/com/microsoft/jenkins/containeragents/aci/AciCloud.java index de9b8b4..f46cde7 100644 --- a/src/main/java/com/microsoft/jenkins/containeragents/aci/AciCloud.java +++ b/src/main/java/com/microsoft/jenkins/containeragents/aci/AciCloud.java @@ -80,6 +80,10 @@ public void setLogAnalyticsCredentialsId(String logAnalyticsCredentialsId) { } public AzureResourceManager getAzureClient() { + if (azureClient == null) { + azureClient = createAzureClientSupplier(); + } + return azureClient.get(); }