Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Rishab Bhattacharjee
    @RISHAB3824
    Hi every one Can anyone tell me how can I retrive my Cosmos db secret from Azure keyvault ans extract the database password to connect to databse using java jdbc .I have created a java jdbc wrapper that can connect to Cosmos using passowrd But now I am trying to do this for users who will store their password in keyvault
    Rishab Bhattacharjee
    @RISHAB3824
    ?
    abhikt48
    @abhikt48
    HI All - I need to encrypt blob using keyVault. Azure AAD generated secret stored in Azure Key Vault. I am trying to use EncryptedBlobClient with AsyncKeyEncryptionKey. But i have not found any implemantation sample of AsyncKeyEncryptionKey. Could you please provide any sample to use this?
    Connie Yau
    @conniey
    @alzimmermsft Do you know of any samples for this?
    Alan Zimmer
    @alzimmermsft

    This issue should be tracking the question above

    Azure/azure-sdk-for-java#15210

    abhikt48
    @abhikt48
    Thanks a lot for update !!
    frothyauthy
    @frothyauthy
    hey, probably the wrong place to ask but ive had no luck elsewhere. im trying to debug cpu usage in a java app on azure app service. java flight recordings, top, azure metrics show my app with low cpu usage. The app service plan however shows it with much higher cpu usage. im running 1 app service on the app service plan. Any ideas?
    Connie Yau
    @conniey

    @frothyauthy Hey. Thanks for the question. I'm not sure of the answer myself aside from looking at Kudu.
    https://docs.microsoft.com/azure/app-service/troubleshoot-performance-degradation#use-the-kudu-debug-console

    I'm trying to look for other resources to point you to.

    frothyauthy
    @frothyauthy
    ive got a support ticket open -- i want to say this is not my apps fault, but i really cant tell
    ive taken jfr flight recordings confirming my app is idle, and checked all other metrics on the app service and it points to low cpu usage.
    the plan however is reporting high cpu usage. similarly, the "full process list" diagnostic setting doesnt show any processes with high cpu.
    i should have added that ive been stress testing my application. during the stress test app service and service plan cpu go up. after the test, the service plan stays up, while the app service itself returns to near 0.
    frothyauthy
    @frothyauthy
    ahh, resolved this (I think) in case yall strangers were wondering. azure support told me netstat -pnutl was using up the cpu after my stress tests were completed. i ran more stress tests without restarting to clean cpu. Eventually ran out of file descriptors. It turns out I was afflicted by reactor/reactor-netty#1163 , since fixing this, all seems good
    my guess is azure's monitoring tools use netstat, and it was hurtin because of so many unclosed sockets
    Connie Yau
    @conniey
    Oooh. Thanks for updating us! I was unable to find extra contacts.
    That's interesting... I wonder what the code path was that was doing this.
    Chris Whalen
    @thewhale1
    Hello everyone! I found this great project and I'm looking to use it against the Azure cognitive face service. Looking at the code, after pulling master, in the package "com.microsoft.azure.cognitiveservices.vision.faceapi", I see that a number of faceapi abilities are missing. From there I went poking around and found what looks like an automated code build (Azure/azure-sdk-for-java@24996e0) that never quite made it. Am I looking in the right place, or does anyone know of a branch that is working on this?
    anicoder
    @anicoder_gitlab
    HI Everyone
    Can anyone help me to junit for cosmosclient in java
    Connie Yau
    @conniey
    @anicoder_gitlab Could you be more explicit? What do you mean? https://github.com/Azure/azure-sdk-for-java/wiki/Unit-Testing#mocking-azure-service-clients
    Connie Yau
    @conniey
    @thewhale1 Hey, could you create an issue for what features you're looking for from the face API? We try our best to address all issues. https://github.com/Azure/azure-sdk-for-java/issues
    Rishabh Sharma
    @Rish02Sharma
    Hi Everyone,
    I was trying to implement Azure key vault's new Portal based implementation using SDK and directly fetching keys through applications.properties files...but even after providing values for client id, key and key vaults domain uri...still values are not fetched to spring boot application.properties file..API calls are fetched and can be seen on app insights but not able to see values on applications.properties file
    can anyone help me with this...it would be very helpful
    thanks
    Connie Yau
    @conniey
    @Rish02Sharma Could you elaborate? Are you trying to fetch Key Vault secrets and write them to your application.properties files? Do you have a code snippet?
    Rishabh Sharma
    @Rish02Sharma

    In my gradle i imported this library...
    runtime group: 'com.microsoft.azure', name: 'azure-keyvault-secrets-spring-boot-starter', version: '2.3.2'

    in applications.properties files
    azure.keyvault.uri=
    azure.keyvault.client-id=
    azure.keyvault.client-key=

    Fetching the keys like
    @Value("${DatabaseAddress}")
    private String keyV;

    Rishabh Sharma
    @Rish02Sharma
    I have added some secrets to key vaults via portal and was trying to fetch them to my spring boot project
    Krunal Satwara
    @ksatwara
    @joshfree recently i have joined this community and i have open the coupled couple of PR's related to test coverage. I want to contribute more so please provide me some testing project so I can work more on it and contribute.
    Vamshidhar
    @notifybuzz_twitter
    Hi anyone implemented Azure Service Bus Sessions
    Connie Yau
    @conniey
    @ksatwara Hey, Do you have some links to your PR?
    Vamshidhar
    @notifybuzz_twitter
    @conniey I have seen those and able to publish and consume messages with sessions. But, how can I release a session lock explicitly ,so that it can re used by some other session or same session in future. I did some testing with few messages with unique sessionIds. For eg: a sessionId with 1 was sent and consumed straight away. SessionId 2 was sent it waited for default locktime i.e 1 minute and processsed 2 message. But, when I send sessionId 1 again its not consumed.
    Praneeth Bobba
    @prbobba

    I am trying to use the SDK tocreate a snapshot for the managed disk using the below

        Snapshot.DefinitionStages.WithGroup withGroup = context.azureSdkClients
                .getComputeManager()
                .snapshots()
                .define(snapshotName)
                .withRegion(disk.regionId);

    Snapshot.DefinitionStages.WithSnapshotSource withSource = withGroup.withExistingResourceGroup(context.resourceGroupName);

                withSource
                        .withWindowsFromDisk(context.azureDisk)
                        .withIncremental(incr)
                        .create()

    But this doesn't have the options forsetting encryption and network acess policy? Is it supported by the SDK API ? or should I use a different API ?

    Rishi
    @urishiraval

    Hi everyone....I'm trying to jar my code snippet with gradle but I keep getting an error when I try to run the built jar.

    Exception in thread "main" java.lang.NoClassDefFoundError: com/azure/core/credential/TokenCredential
    at Controller.main(Controller.java:5)
    Caused by: java.lang.ClassNotFoundException: com.azure.core.credential.TokenCredential
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 1 more

    I've been looking on google forever and can't seem to find the solution...I'm only using azure-identity (1.2.4) and azure-security-keyvault-secerts (4.3.5) and the code runs as intended...theres only an issue after the build occurs

    Ivan Mijailovic
    @ivan-83
    Hi everyone, I’ve created VMSS by ARM where added Custom Script Extension with protectedSetting. The protectedSettings are stored on Azure Key Vault. When i try to obtain protectedSetting for scale set by calling azure.virtualMachineScaleSets().getByResourceGroup(rename, scaleSetName) getting null for custom script extension protectedSetting. Could you help me with what could be an issue? Thanks in advance!
    Connie Yau
    @conniey
    @ivan-83 I've created a GitHub issue here. Azure/azure-sdk-for-java#21779 and looped in folks who may be able to address your question
    Ivan Mijailovic
    @ivan-83
    Thanks @conniey
    ronaldcalazans
    @ronaldcalazans

    Hi everyone, I'm having trouble adding a .jar externally, notice that the .jar in the correct location, apparently has been added to the project, is ms-azure-cs-faceapi.jar, I added by clicking on add external JARs.
    .
    alt
    .
    I'm using this library in a class only, and after adding it to the path the errors are gone, there are no errors in the system, at least red dots are not appearing in any folder, apparently everything is all right.

    However, when I run the "clean install" appear these errors in the console:

    [ERROR]/I:/system/execs/eclipse/test/src/main/java/TestFaceapi.java:[26,67] package com.microsoft.azure.cognitiveservices.vision.faceapi.models does not exist
    [ERROR] /I:/system/execs/eclipse/test/src/main/java/TestFaceapi.java:[190,31] cannot find symbol
    [ERROR] symbol:   class FaceAPI
    [ERROR] location: class TestFaceapi
    [ERROR] /I:/system/execs/eclipse/test/src/main/java/TestFaceapi.java:[239,38] cannot find symbol
    [ERROR] symbol:   class FaceAPI
    [ERROR] location: class TestFaceapi

    As I said, in the class there is no error, everything is ok, but I can not climb the application due to this error ... does anyone have an idea of what might be missing when importing .jar externally?

    bobanbp
    @bobanbp

    Hi all, recently we started experiencing a lot of socket timeout exceptions while performing various API calls. Here is one stack trace snippet:

    Caused by: java.lang.RuntimeException: java.net.SocketTimeoutException: timeout at rx.exceptions.Exceptions.propagate(Exceptions.java:58) ~[?:?] at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:464) ~[?:?] at rx.observables.BlockingObservable.last(BlockingObservable.java:227) ~[?:?] at com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl.getById(GroupableResourcesImpl.java:69) ~[?:?] at com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl.getById(GroupableResourcesImpl.java:34) ~[?:?]

    We use com.microsoft.azure/azure library (https://mvnrepository.com/artifact/com.microsoft.azure/azure). Any idea what a problem could be? We don’t configure read or connection timeout values. I would appreciate any guidance to figure out what causes the issue. Thank you!

    Connie Yau
    @conniey
    @ronaldcalazans , I wouldn't be able to check without seeing your pom.xml, but you shouldn't have to explicitly add it to your java build path. You can include the dependency in your pom.xml. If you're building ms-azure-cs-faceapi.jar from source, you'll want to install the package locally when you build it
    @bobanbp It looks like a similar question was answered: Azure/azure-sdk-for-java#2013. If you have other questions, feel free to open an issue on the GitHub repository.
    bobanbp
    @bobanbp

    @conniey Thanks a lot for prompt reply. Just one short question. In the example you shared it is clearly stated that read timeout happened: java.lang.RuntimeException: java.net.SocketTimeoutException: Read timed out

    In our case we are getting just timeout, like this: java.net.SocketTimeoutException: timeout
    I just wonder what kind of timeout is problematic? I checked our code and we definitely don't configure either read nor connection timeout and that is something that we are going to try. Also, colleague of mine created a github issue some time ago (Azure/azure-libraries-for-java#799), but eventually he just used some retry logic around those API calls, it helped that time, but now we started experiencing a lot of issues all over our code and it is not very convenient to add retry logic everywhere.

    johnespen
    @johnespen:matrix.org
    [m]
    Hi, I was thinking of using azure-spring-cloud-starter-eventhubs or azure-spring-cloud-stream-binder-eventhubs in a spring boot app, but see that the library has a lot of Dependency Convergence errors, also uses different versions of its internal libraries. Are there any plans to fix it?
    Connie Yau
    @conniey
    @bobanbp Hey. I can't make a generalised statement about timeouts because they happen all the time. Clients losing connectivity, etc. That's why all of our libraries have a retry policy that can be applied to them in case a request gets lost in the ether, we can try again.
    @johnespen:matrix.org Hey. We are aware of the dependency convergence errors. What version of Spring Boot were you trying to target?
    1 reply
    Sharad Dutta
    @SabbitRex

    I am trying to access graph API while being behind a proxy which is unathenticated. Below is the code that I wrote, I am getting "SocketTimeoutException" when I am trying to pass okHttpClient object to create GraphServiceClient. and then making a call using it.

    The "if" is the configuration with proxy, which means I will use hostAddress and hostPort, and the "else" is non-proxy configuration.

    `if (this.proxy.equals("true")) {

        final ClientSecretCredential clientSecretCredential = new ClientSecretCredentialBuilder()
                .clientId(this.clientId)
                .clientSecret(this.clientSecret)
                .tenantId(this.b2cTenant)
                .build();
    
        final TokenCredentialAuthProvider tokenCredentialAuthProvider = 
            new TokenCredentialAuthProvider(Constant.scopes, clientSecretCredential);
    
        final Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(this.hostAddress, this.hostPort));
    
        final OkHttpClient httpClient = HttpClients.createDefault(tokenCredentialAuthProvider)
                .newBuilder()
                .proxy(proxy)
                .build();
    
        graphClient = GraphServiceClient.builder()
                .authenticationProvider(tokenCredentialAuthProvider)
                .httpClient(httpClient)
                .buildClient();
    
    } else {
    
        final ClientSecretCredential clientSecretCredential = new ClientSecretCredentialBuilder()
                .clientId(this.clientId)
                .clientSecret(this.clientSecret)
                .tenantId(this.b2cTenant)
                .build();
    
        final TokenCredentialAuthProvider tokenCredentialAuthProvider = 
            new TokenCredentialAuthProvider(Constant.scopes, clientSecretCredential);
    
        graphClient = GraphServiceClient.builder()
                .authenticationProvider(tokenCredentialAuthProvider)
                .buildClient();
    }`

    So now once I get graphClient from "if" (proxy enabled config)...I am using it like this...

    I created a LinkedList of type "QueryOption" and I am trying to check if user is present in B2C AD by using issuerAssignedId.

    But I am getting SocketTimeOutConnection. I dont know what I am doing wrong.

    `String queryTerm = "identities/any(c:c/issuerAssignedId eq '" + issuerAssignedId + "' and c/issuer eq '" + b2cTenant + "')";

    requestOptions.add(new QueryOption("$filter", queryTerm));
    
    UserCollectionPage userCollection = graphClient.users()
            .buildRequest(requestOptions)
            .get();
    
    List<User> userInfoList = userCollection.getCurrentPage();
    
    if (userInfoList.size() == 0) {
        System.out.println("User does not exist in given directory.");
    } else {
        System.out.println("User exists in given directory.");
    }`

    I even tried to setup proxy at JVM level, i.e.

    System.setProperty("java.net.useSystemProxies", "true"); System.setProperty("http.proxyHost", host); System.setProperty("http.proxyPort", port);

    @culmat @baywet @sujitjadhav07 please help. I am confused what am I doing wrong?

    When I am running as non proxy, it is working fine.

    Subham Ashish
    @SubhamAshish
    // Create a blob container client that you use later to build an event processor
            // client to receive and process events
            BlobContainerAsyncClient blobContainerAsyncClient = new BlobContainerClientBuilder()
                    .connectionString(storageConnectionString)
                    .containerName(storageContainerName).buildAsyncClient();
    
            // Create a builder object that you will use later to build an event processor
            // client to receive and process events and errors.
            EventProcessorClientBuilder eventProcessorClientBuilder = new EventProcessorClientBuilder()
                    .connectionString(connectionString, eventHubName).consumerGroup("group1")
                    .processEvent(PARTITION_PROCESSOR).processError(ERROR_HANDLER)
                    .checkpointStore(new BlobCheckpointStore(blobContainerAsyncClient));
    
            // Use the builder object to create an event processor client
            EventProcessorClient eventProcessorClient = eventProcessorClientBuilder.buildEventProcessorClient();
    
            System.out.println("Starting event processor");
            eventProcessorClient.start();
    
            System.out.println("Press enter to stop.");
    
            System.in.read();
    
            System.out.println("Stopping event processor");
            eventProcessorClient.stop();
            System.out.println("Event processor stopped.");
    
            System.out.println("Exiting process");

    hello all am trying to read an event from event hub from specific partition from a cosumergroup and manage offset, can anybody suggest here?

    am unable to write partitionId , it could able to listen all the partition event and managing offset.

    Connie Yau
    @conniey
    @SubhamAshish The processor client is for processing from all partitions in that Event Hub. If you want a single partition, you should leverage EventHubsConsumerAsyncClient. Our samples are here: https://docs.microsoft.com/en-us/samples/azure/azure-sdk-for-java/eventhubs-samples/
    And the sample is "Consume events from an Event Hub partition"
    Connie Yau
    @conniey
    @SabbitRex Your code looks fine to me. Adding logs (ie. Okhttp interceptors) to see the HTTP request/responses would shed more light on this.