HTTP Publish of MQTT messages returning 404 error

Jonas 21 Reputation points
2025-08-28T20:12:47.94+00:00

Testing the HTTP Publish feature for MQTT messages, currently in public preview, results in multiple issues. Following the steps outlined in the HTTP Publish of MQTT messages with Azure Event Grid documentation:

  1. Running the command az account get-access-token --resource=https://<namespaceFQDN> --query accessToken -o tsv returns the error The resource principal named ____ was not found in the tenant named [redacted].
  2. Attempts to use --resource https://eventgrid.azure.net as the scope for the token, along with following the remainder of the guide, result in a 404 Resource not found error when calling the endpoint https://<namespaceFQDN>/mqtt/messages, suggesting that the URL in the documentation may not be available.

Sample request

POST https://[eventgridnamespace].westeurope-1.ts.eventgrid.azure.net/mqtt/messages?topic=helloworld/device1&api-version=2025-08-01-preview

Headers:
Authorization:Bearer [token]
mqtt-qos:1
mqtt-retain:0
mqtt-response-topic:devices%2FCXa-23112%2Freply
mqtt-correlation-data:PlXCscK2wrbCuy8=
mqtt-user-properties:[{"Urgency":"alert"},{"RequestId":"55f4a7ee-b0b4-4d7f-8eb5-2edba2ced5d7"}]
content-type:text/plain;charset=UTF-8

Body:
Please accept terms of licensing and agreement

Testing has been conducted on an Event Grid Namespace in both West Europe and East US regions, yielding identical results.

Questions

  • Is the HTTP Publish feature publicly available?
  • Is the URL provided in the documentation accurate?
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jose Benjamin Solis Nolasco 5,406 Reputation points
    2025-08-28T20:21:02.39+00:00

    Hello, Welcome to Microsoft Q&A

    The 404 isn’t because you misconfigured your request , it’s because MQTT-over-HTTP Publish is not enabled on your namespace yet, even though the docs describe it. The right token resource is https://eventgrid.azure.net, but until your namespace is in a region/feature ring that supports the /mqtt/messages endpoint, you’ll continue to see 404s.

    1. Verify Feature Availability
      • Run:
             az eventgrid namespace show --name <namespace> --resource-group <rg>
        
        and check for mqtt/preview flags in the output.
      • If not present, your namespace doesn’t support HTTP publish yet.
    2. Token Acquisition Fix Use:
    az account get-access-token --resource=https://eventgrid.azure.net --query accessToken -o tsv
    

    This gives the correct bearer token.

    Public preview is rolling out region by region. If you’re outside the enabled set, you’ll always get a 404. If you need this feature for testing, log a support ticket with Microsoft or upvote/comment on the GitHub issues linked from the Event Grid preview docs.

    😊 If my answer helped you resolve your issue, please consider marking it as the correct answer. This helps others in the community find solutions more easily. Thanks!

    0 comments No comments

  2. Jose Benjamin Solis Nolasco 5,406 Reputation points
    2025-08-28T20:32:00.4833333+00:00

    Post by error delete.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.