How to set the User Agent in Java SDK v12?

Somansh Reddy 141 Reputation points
2020-08-17T13:54:51.713+00:00

What is the content of the User Agent field that must be sent?

UserAgentPolicy userAgentPolicy = new UserAgentPolicy(USER_AGENT);
this.serviceClient = new BlobServiceClientBuilder().endpoint(endpoint).credential(credential).addPolicy(userAgentPolicy).buildClient();

This content of this USER_AGENT field is the question.

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,529 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
0 comments No comments
{count} votes

Accepted answer
  1. deherman-MSFT 38,021 Reputation points Microsoft Employee Moderator
    2020-08-17T18:55:32.913+00:00

    @Somansh Reddy
    Please see the UserAgentPolicy page for more information about this. "Pipeline policy that adds "User-Agent" header to a request. The format for the "User-Agent" string is outlined in Azure Core: Telemetry policy."

    [<application_id> ]azsdk-<sdk_language>-<package_name>/<package_version> <platform_info>  
    

    I hope this answers your question. If not I also recommend posting this on StackOverflow using the azure-java-sdk tag.

    --------------

    Please don’t forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.