title: Event Grid-triggered Function Keeps Triggering After Function Successfully Runs?
body: <p>I have an Azure Function triggered by Event Grid Events. Event Grid Events are created only when a blob is uploaded to a Storage Account.</p>
  <p>This is now deployed and working well although for some reason, the Function keeps getting triggered by the same event even though it successfully processed?</p>
  <p><strong>Example:</strong></p>
  <ul>
  <li><p>Yesterday, 8 successful tests; all good:
  <a href="https://i.stack.imgur.com/ReetW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ReetW.png" alt="enter image description here" /></a></p>
  </li>
  <li><p>Today I review the logs, and the function has continued to execute!</p>
  </li>
  <li><p>Error: &quot;Blob does not exist&quot;</p>
  </li>
  <li><p>I deleted the blob after last test yesterday. Why is the Event Grid still firing?
  <a href="https://i.stack.imgur.com/rGOfp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rGOfp.png" alt="enter image description here" /></a></p>
  </li>
  </ul>
  <p><strong>Code snippet:</strong></p>
  <pre><code>def main(event: func.EventGridEvent):
  
          result = json.dumps({
              'id' : event.id,
              'data' : event.get_json(),
              'topic' : event.topic,
              'subject' : event.subject,
              'event_type' : event.event_type
          })
  
          logging.info('EventGrid trigger processing an event: %s', result)
  
          credential = DefaultAzureCredential()
  
          download_start_time = datetime.datetime.now()
          logging.info(f'######## Starting downloading blob from storage at ' + str(download_start_time) + ' ########')
  
          # =============================
          # Download blob from storage container:
          # =============================
  
          blob_client = BlobClient.from_blob_url(event.get_json()[&quot;url&quot;], credential)
          blob_data = blob_client.download_blob().readall()
          blob_byte_stream = io.BytesIO(blob_data)
  </code></pre>
  <p><strong>EDIT 1: This is still happening, this time a bit different.</strong></p>
  <ul>
  <li>Now, the EventGrid keeps firing after SUCCESSFULLY passing messages and the Function running</li>
  </ul>
  <p><strong>How do I debug this?</strong></p>
  <p><a href="https://i.stack.imgur.com/QrPGS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QrPGS.png" alt="enter image description here" /></a></p>