Hello @Satyam Chauhan,
welcome to this moderated Azure community forum.
Can you check out this part of the documentation?
Topic templates support MQTT wildcards (+ and #) and the following variables: ${client.attributes.x}: this variable represents an assigned attribute to a client during client creation/update, such as "x" would be equal to the exact string of the attribute key
An example seen there is:
area/${client.attributes.area}/telemetry
If you want to limit access to certain topics, you probably need to add the 'client.authenticationName' name too in the topics (either for publishing or subscribing).
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.