def post_azure(self, alerts_and_incidents, triage_items, app):
        """
            posts to azure after appending triage information on it
        """

        data = {}
        for item in triage_items:
            # Getting all the present triage items into the data dict
            if 'alert-id' in item['source'] and item['source']['alert-id'] is not None:
                data[item['source']['alert-id']] = [item, None]
            elif 'incident-id' in item['source'] and item['source']['incident-id'] is not None:
                data[item['source']['incident-id']] = [item, None]
            else:
                raise Exception(f'Triage item missing expected source ID field: {item}')

        for item in alerts_and_incidents:
            # Replacing None in the list with the incident/alert corresponding to respective triage item. 
            if item['id'] in data:
                data[item['id']][1] = item
            else:
                raise Exception(f'No matching triage item found for alert/incident: {item}')

        for triage_item, alert_or_incident in data.values():
            # validate we actually have an alert/incident before proceeding
            if not alert_or_incident:
                raise Exception(f'Triage item had no matching alert/incident data: {triage_item}')
            alert_or_incident['status'] = triage_item['state']
            alert_or_incident['triage_id'] = triage_item['id']
            alert_or_incident['triage_raised_time'] = triage_item['raised']
            alert_or_incident['triage_updated_time'] = triage_item['updated']
            
            #creating a custom json data to post into azure
            azure_obj = {
                **alert_or_incident,
                'status': triage_item['state'],
                'triage_id': triage_item['id'],
                'triage_raised_time': triage_item['raised'],
                'triage_updated_time': triage_item['updated'],
                'comments': [],
                'app': app
            }

            comment_data = self.DS_obj.get_triage_comments(triage_item['id'])

            for comment in comment_data:
                if 'content' not in comment:
                    continue
                uname = comment['user']['name'] if comment['user'] and 'name' in comment['user'] else None
                azure_obj['comments'].append({
                    'user_name': uname,
                    'content': comment['content'],
                    'id': comment['id'],
                    'created': comment['created']
                })


            self.AS_obj.post_data(json.dumps(azure_obj), constant.LOG_NAME)

            posts to azure after appending triage information on it
        
Solutions/Digital Shadows/Data Connectors/Digital Shadows/DigitalShadowsConnectorAzureFunction/DS_poller.py