class AzureCredentialAppCreationCommand {

    public AzureApplicationCreationView generateJSON(String deploymentAddress) {
        try {
            String appIdentifierURI = getAppIdentifierURI(deploymentAddress);
            String appSecret = UUID.randomUUID().toString();
            String replyURL = getReplyURL(deploymentAddress);
            Template template = freemarkerConfiguration.getTemplate(appCreationJSONTemplatePath, ENCODING);
            Map<String, Object> model = buildModel(deploymentAddress, appIdentifierURI, replyURL);
            model.put("appSecret", appSecret);
            model.put("keyId", UUID.randomUUID().toString());

            String creationRequestPayload = processTemplateIntoString(template, model);
            return new AzureApplicationCreationView(appIdentifierURI, appSecret, replyURL, creationRequestPayload);
        } catch (IOException | TemplateException e) {
            String message = String.format(GENERATE_EXCEPTION_MESSAGE_FORMAT, appCreationJSONTemplatePath);
            throw new CloudConnectorException(message, e);
        }
    }

}