def get_or_store_secrets(self, inputs, logger):
    '\n        Either read existing encyrpted password or encrypt clear text password and store it\n        Either way, return a set of clear text credentials\n    '
    input_items = inputs.inputs.itervalues().next()
    input_name = inputs.inputs.iterkeys().next()
    credentials = {}
    storage_passwords = self.service.storage_passwords
    props_app_id = {}
    props_app_id['username'] = 'AzureMonitorMetricsAppID-{0}'.format(input_name.replace(':', '_'))
    props_app_id['password'] = input_items.get('SPNApplicationId')
    props_app_key = {}
    props_app_key['username'] = 'AzureMonitorMetricsAppKey-{0}'.format(input_name.replace(':', '_'))
    props_app_key['password'] = input_items.get('SPNApplicationKey')
    app_id = input_items.get('SPNApplicationId')
    app_key = input_items.get('SPNApplicationKey')
    if ((app_id is not None) and (app_key is not None)):
        try:
            if (('AzureMonitorMetricsAppID' in storage_passwords) and (props_app_id['username'] not in storage_passwords)):
                modify_storage_password(self, 'AzureMonitorMetricsAppID', props_app_id['username'], logger)
            if (('AzureMonitorMetricsAppKey' in storage_passwords) and (props_app_key['username'] not in storage_passwords)):
                modify_storage_password(self, 'AzureMonitorMetricsAppKey', props_app_key['username'], logger)
            if (props_app_id['password'] == MASK):
                (app_id, app_key) = get_app_id_and_key(self, props_app_id, props_app_key, logger)
            else:
                create_or_update_storage_password(self, props_app_id, logger)
                create_or_update_storage_password(self, props_app_key, logger)
                mask_id_and_key(self, input_name, logger)
        except Exception as e:
            logger('ERROR', 'Error caught in get_or_store_secrets: {0}'.format(e))
        credentials['app_id'] = app_id
        credentials['app_key'] = app_key
    return credentials
Either read existing encyrpted password or encrypt clear text password and store it
Either way, return a set of clear text credentials
def get_or_store_secrets(self, inputs, logger):
    '\n        Either read existing encyrpted password or encrypt clear text password and store it\n        Either way, return a set of clear text credentials\n    '
    input_items = inputs.inputs.itervalues().next()
    input_name = inputs.inputs.iterkeys().next()
    credentials = {}
    storage_passwords = self.service.storage_passwords
    props_app_id = {}
    props_app_id['username'] = 'AzureMonitorMetricsAppID-{0}'.format(input_name.replace(':', '_'))
    props_app_id['password'] = input_items.get('SPNApplicationId')
    props_app_key = {}
    props_app_key['username'] = 'AzureMonitorMetricsAppKey-{0}'.format(input_name.replace(':', '_'))
    props_app_key['password'] = input_items.get('SPNApplicationKey')
    app_id = input_items.get('SPNApplicationId')
    app_key = input_items.get('SPNApplicationKey')
    if ((app_id is not None) and (app_key is not None)):
        try:
            if (('AzureMonitorMetricsAppID' in storage_passwords) and (props_app_id['username'] not in storage_passwords)):
                modify_storage_password(self, 'AzureMonitorMetricsAppID', props_app_id['username'], logger)
            if (('AzureMonitorMetricsAppKey' in storage_passwords) and (props_app_key['username'] not in storage_passwords)):
                modify_storage_password(self, 'AzureMonitorMetricsAppKey', props_app_key['username'], logger)
            if (props_app_id['password'] == MASK):
                (app_id, app_key) = get_app_id_and_key(self, props_app_id, props_app_key, logger)
            else:
                create_or_update_storage_password(self, props_app_id, logger)
                create_or_update_storage_password(self, props_app_key, logger)
                mask_id_and_key(self, input_name, logger)
        except Exception as e:
            logger('ERROR', 'Error caught in get_or_store_secrets: {0}'.format(e))
        credentials['app_id'] = app_id
        credentials['app_key'] = app_key
    return credentials