Program: 63994
Project: 63994
Buggy source:
@Override public void setupProvisioning(Stack stack){
  MDCBuilder.buildMdcContext(stack);
  Credential credential=stack.getCredential();
  AzureTemplate template=(AzureTemplate)stack.getTemplate();
  AzureClient azureClient=azureStackUtil.createAzureClient((AzureCredential)credential);
  if (!azureClient.isImageAvailable(azureStackUtil.getOsImageName(credential,template.getLocation()))) {
    String affinityGroupName=((AzureCredential)credential).getCommonName(template.getLocation());
    createAffinityGroup(stack,azureClient,affinityGroupName);
    String storageName=String.format("String_Node_Str",VM_COMMON_NAME,stack.getId());
    createStorage(stack,azureClient,affinityGroupName);
    String targetBlobContainerUri="String_Node_Str" + affinityGroupName + "String_Node_Str";
    String targetImageUri=targetBlobContainerUri + '/' + storageName+ "String_Node_Str";
    Map<String,String> params=new HashMap<>();
    params.put(AzureStackUtil.NAME,affinityGroupName);
    String keyJson=(String)azureClient.getStorageAccountKeys(params);
    JsonNode actualObj=null;
    try {
      actualObj=MAPPER.readValue(keyJson,JsonNode.class);
    }
 catch (    IOException e) {
      LOGGER.info("String_Node_Str",e);
      throw new InternalServerException("String_Node_Str",e);
    }
    String storageAccountKey=actualObj.get("String_Node_Str").get("String_Node_Str").get("String_Node_Str").asText();
    createBlobContainer(targetBlobContainerUri,storageAccountKey);
    AzureClientUtil.copyOsImage(storageAccountKey,baseImageUri,targetImageUri);
    checkCopyStatus(stack,targetImageUri,storageAccountKey);
    createOsImageLink(credential,azureClient,targetImageUri,template.getLocation());
  }
  LOGGER.info("String_Node_Str",ReactorConfig.PROVISION_SETUP_COMPLETE_EVENT,stack.getId());
  reactor.notify(ReactorConfig.PROVISION_SETUP_COMPLETE_EVENT,Event.wrap(new ProvisionSetupComplete(getCloudPlatform(),stack.getId()).withSetupProperty(CREDENTIAL,stack.getCredential())));
}

Fixed version (ground truth):
@Override public void setupProvisioning(Stack stack){
  MDCBuilder.buildMdcContext(stack);
  Credential credential=stack.getCredential();
  AzureLocation azureLocation=AzureLocation.valueOf(stack.getRegion());
  AzureClient azureClient=azureStackUtil.createAzureClient((AzureCredential)credential);
  if (!azureClient.isImageAvailable(azureStackUtil.getOsImageName(credential,azureLocation))) {
    String affinityGroupName=((AzureCredential)credential).getCommonName(azureLocation);
    createAffinityGroup(stack,azureClient,affinityGroupName);
    String storageName=String.format("String_Node_Str",VM_COMMON_NAME,stack.getId());
    createStorage(stack,azureClient,affinityGroupName);
    String targetBlobContainerUri="String_Node_Str" + affinityGroupName + "String_Node_Str";
    String targetImageUri=targetBlobContainerUri + '/' + storageName+ "String_Node_Str";
    Map<String,String> params=new HashMap<>();
    params.put(AzureStackUtil.NAME,affinityGroupName);
    String keyJson=(String)azureClient.getStorageAccountKeys(params);
    JsonNode actualObj=null;
    try {
      actualObj=MAPPER.readValue(keyJson,JsonNode.class);
    }
 catch (    IOException e) {
      LOGGER.info("String_Node_Str",e);
      throw new InternalServerException("String_Node_Str",e);
    }
    String storageAccountKey=actualObj.get("String_Node_Str").get("String_Node_Str").get("String_Node_Str").asText();
    createBlobContainer(targetBlobContainerUri,storageAccountKey);
    AzureClientUtil.copyOsImage(storageAccountKey,baseImageUri,targetImageUri);
    checkCopyStatus(stack,targetImageUri,storageAccountKey);
    createOsImageLink(credential,azureClient,targetImageUri,azureLocation);
  }
  LOGGER.info("String_Node_Str",ReactorConfig.PROVISION_SETUP_COMPLETE_EVENT,stack.getId());
  reactor.notify(ReactorConfig.PROVISION_SETUP_COMPLETE_EVENT,Event.wrap(new ProvisionSetupComplete(getCloudPlatform(),stack.getId()).withSetupProperty(CREDENTIAL,stack.getCredential())));
}