Skip to content

Instantly share code, notes, and snippets.

View samvaity's full-sized avatar

Sameeksha Vaity samvaity

View GitHub Profile
@samvaity
samvaity / azure-sdk-mcp-design-tasks.md
Last active July 21, 2025 03:46
Azure SDK MCP Tool Specification - Standardized Cross-Language SDK Generation Tools
@samvaity
samvaity / TestInterfaceClientServiceImpl.java
Last active March 14, 2025 19:20
Generated Implementation
//Copyright (c) Microsoft Corporation. All rights reserved.
//Licensed under the MIT License.
package io.clientcore.annotation.processor.test.implementation;
import io.clientcore.core.http.models.HttpHeaderName;
import io.clientcore.core.http.models.HttpMethod;
import io.clientcore.core.http.models.HttpRequest;
import io.clientcore.core.http.models.RequestOptions;
import io.clientcore.core.http.models.Response;
import io.clientcore.core.http.pipeline.HttpPipeline;
@samvaity
samvaity / Annotation-processor tooling.md
Last active January 29, 2025 00:36
Committing Generated Code from annotation-processor tooling to the Repository

Pros and Cons of Committing Generated Code to the Repository

Pros:

  1. Easier Debugging and Issue Reporting

    • Users can link directly to the broken source code when reporting issues.
    • In scenarios where generated code causes an error, having the code committed ensures visibility and simplifies troubleshooting.
  2. Simplified Exploration

  • Developers can quickly inspect the implementation without needing to regenerate code or resolve dependencies.
@samvaity
samvaity / TestProxyMigration.md
Last active January 30, 2023 18:52
Test Proxy Migration

Test Proxy Architecture

Sanitizers

Default Sanitizers
Custom Sanitizers

Recording tests with Test Proxy + SDK's

image

@samvaity
samvaity / LRO.md
Created June 4, 2020 07:50
LRO throw exception on failed status

LRO Poller never throws on failed status of the Long running OPeration. Here - https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core/src/main/java/com/azure/core/util/polling/PollerFlux.java#L225

In the usage context of Pollers in Form Recognizer, nothing much is gained out of LongRunningOperationState.FAILED.

LRO current implementation fail state usage:

recognizePoller.map(asyncPollResponse -> {
    if (asyncPollResponse.getStatus() == LRO.FAILED) {
       // inspect error or may be cancel server side op if it make sense.
@samvaity
samvaity / FormContentType.md
Last active June 4, 2020 23:25
Form Content Implementation diff

Java Usage

 if (formContent.getTextContentType().equals(TextContentType.WORD)) {
    FormWord formWordElement = (FormWord) (formContent);
    // do something
} else if (formContent.getTextContentType().equals(TextContentType.LINE)) {
    FormLine formLineElement = (FormLine) (formContent);
    // do something else
}
@samvaity
samvaity / TextAnalyticsAPI.md
Last active November 23, 2019 00:34
Text Analytics API draft

TextAnalytics

TextAnalyticsClientBuilder

`public final class TextAnalyticsClientBuilder {

    public TextAnalyticsClientBuilder() {}

    public TextAnalyticsClient buildClient() {}

    public TextAnalyticsAsyncClient buildAsyncClient() {}
import com.azure.core.util.Context;
import com.azure.data.appconfiguration.ConfigurationClient;
import com.azure.data.appconfiguration.ConfigurationClientBuilder;
import com.azure.data.appconfiguration.models.ConfigurationSetting;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import io.opentelemetry.context.Scope;
import io.opentelemetry.exporters.jaeger.JaegerGrpcSpanExporter;
import io.opentelemetry.sdk.trace.TracerSdk;
import io.opentelemetry.sdk.trace.export.SimpleSpansProcessor;
@samvaity
samvaity / TracePublishEvents.md
Created October 10, 2019 23:57
TracePublishEvents.md

Publishing Events with Azure Core Tracing OpenCensus

Publishing events is one of the common use-cases for event publishers. Following documentation describes instructions to run the sample program for publishing events with tracing instrumentation for Java SDK libraries.

Getting Started

Adding the Azure client library for Event Hubs package to your product:

@samvaity
samvaity / SampleTracing.md
Last active August 6, 2019 19:06
Sample for Tracing in Keyvault secrets package using Java tracing opentelemetry package

Sample Code

package com.example;

import com.azure.identity.credential.DefaultAzureCredentialBuilder;
import com.azure.security.keyvault.secrets.SecretClient;
import com.azure.security.keyvault.secrets.SecretClientBuilder;
import com.azure.security.keyvault.secrets.models.Secret;
import com.azure.security.keyvault.secrets.models.SecretBase;