@Sam Stuttard Thanks for reaching out. From the description i understand that you're trying to create a Event grid topic under the namespace.
A namespace exposes two hostnames:
- An HTTP endpoint to support general messaging requirements using Namespace Topics.
- An MQTT endpoint for IoT messaging or solutions that use MQTT.
Retrieve the namespace hostname. You use it to compose the HTTP endpoint to which events are sent. please refer below to create a endpoint for a topic.
publish_operation_uri="https://"$(az resource show --resource-group $resource_group --namespace Microsoft.EventGrid --resource-type namespaces --name $namespace --query "properties.topicsConfiguration.hostname" --output tsv)"/topics/"$topic:publish?api-version=2023-06-01-preview
Do let me know if you have any queries.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.