0

I am working on a .NET Core project. I am trying to connect to the service bus queue using a connection string. I am able access the service bus with QueueClient using the API function 'new QueueClient(< connection string >, < queue name >). However Queue client does not have any functions to get the size / message count.

I have tried the NamespaceaManager.CreateFromConnectionString (< connection string >) function, but looks like its been deprecated in .NET Core (and it keeps throwing dependency errors).

I tried the Microsoft.Azure.Management.Fluent package but could not get it to work either.

Are any of these the right way to do it, and is there any other way to make this work?

1 Answer 1

1

NamespaceaManager is not available with the new Azure Service Bus client library. It's planned to add support for some of the functionality NamespaceManager used to provide, but not queue size. For that, you will need to use Azure Monitor service that can provide message counts and entity size (additional information and a sample). Also, entity metrics via REST API were deprecated and Azure Monitor should be used instead.

Sign up to request clarification or add additional context in comments.

3 Comments

I am trying to follow the code on the sample. I am not able to locate client id, tenant id and secret. I do have a connection string that was generated by the service bus. Is there any way to find this information or use the connection string instead for authentication?
For management operations, you can't use the current version of the current client. It will come later. Anything else, you can already do.
Thanks that helped!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.