0

I created one maven project in ItelliJ IDEA tool and add dependence azure-analytics-purview-catalog;azure-identity;azure-core-experimental;azure-core. BTW I have permission to access azure purview account in azure portal

here is my code content

    EntityBaseClient client = new PurviewCatalogClientBuilder()
            .endpoint("https://signofftest0517.catalog.purview.azure.com")
            .credential(new DefaultAzureCredentialBuilder().build())
            .buildEntityBaseClient();
            DynamicRequest  request= client.getByGuid("3bb7fcf9-50ec-4218-97fb-25ac0a459e37");

            //3bb7fcf9-50ec-4218-97fb-25ac0a459e37  364e4e74-eb7c-4358-96bc-9b750cf275e2
            DynamicResponse  response=   request.send();
            int status= response.getStatusCode();
            System.out.println(status); 

running results: enter image description here

Alex Wang
  • 103
  • 1
  • 10
  • Authenticating a service principal with a client secret could resolve this issue ,refer to https://github.com/Azure/azure-sdk-for-java/wiki/Azure-Identity-Examples#authenticating-a-user-account-with-visual-studio-code – Alex Wang Aug 06 '21 at 02:58

1 Answers1

0

@Alex Wang Thank you for your answer.

As mentioned in the Git hub link, Authenticating with client secret will work.

JayakrishnaGunnam-MT
  • 1,548
  • 1
  • 5
  • 9