New to Claude Skills? Learn how to install them →

sickn33 on GitHub

Azure Weights and Biases SDK

Free

Manage ML experiment tracking with Azure and Weights & Biases.

Get this skill

Free · Opens the source repo

What Azure Weights and Biases SDK does

The Azure Weights and Biases SDK for .NET provides developers with a streamlined way to deploy and manage Weights & Biases (W&B) instances through the Azure Marketplace. This SDK simplifies the process of creating, updating, and deleting W&B instances, enabling effective machine learning experiment tracking and model management. By leveraging Azure's infrastructure, users can integrate W&B's capabilities into their existing workflows, making it easier to monitor and optimize machine learning projects.

With this SDK, you can quickly set up a W&B instance by specifying your Azure subscription and resource group. The SDK supports a range of operations, including creating new instances, retrieving existing ones, and configuring essential features like Single Sign-On (SSO) for enhanced security. The resource hierarchy is clearly defined, allowing users to manage their instances efficiently and understand the relationships between resources within Azure.

This skill is particularly beneficial for data scientists and machine learning engineers who are already using Azure and want to incorporate W&B for better tracking and management of their ML experiments. It provides a robust solution for those looking to enhance their machine learning workflows with minimal friction and maximum integration into the Azure ecosystem.

As a preview version, the SDK is designed to evolve, and users can expect future updates that may enhance its functionality and usability. However, it is important to note that being in beta means some features may change as the SDK matures.

When to use it

Use this SDK when you need to deploy and manage Weights & Biases instances on Azure for machine learning projects.

When not to use it

Avoid this SDK if you are not using Azure or if you require a fully stable version, as this is currently in beta.

What you can build with it

Deploying a New W&B Instance

Quickly set up a Weights & Biases instance on Azure using the SDK to enhance your ML tracking capabilities.

Updating Instance Configurations

Easily update configurations, such as SSO settings or resource tags, for existing W&B instances.

Monitoring ML Experiment States

Retrieve and list the states of your W&B instances to monitor their provisioning and operational status.

How to install Azure Weights and Biases SDK

View source

1. Install with the skills CLI

npx skills add sickn33/agentic-awesome-skills/azure-mgmt-weightsandbiases-dotnet --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by sickn33

Azure.ResourceManager.WeightsAndBiases (.NET)

Azure Resource Manager SDK for deploying and managing Weights & Biases ML experiment tracking instances via Azure Marketplace.

Installation

dotnet add package Azure.ResourceManager.WeightsAndBiases --prerelease
dotnet add package Azure.Identity

Current Version: v1.0.0-beta.1 (preview)
API Version: 2024-09-18-preview

Environment Variables

AZURE_SUBSCRIPTION_ID=<your-subscription-id>
AZURE_RESOURCE_GROUP=<your-resource-group>
AZURE_WANDB_INSTANCE_NAME=<your-wandb-instance>

Authentication

using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.WeightsAndBiases;

ArmClient client = new ArmClient(new DefaultAzureCredential());

Resource Hierarchy

Subscription
└── ResourceGroup
    └── WeightsAndBiasesInstance    # W&B deployment from Azure Marketplace
        ├── Properties
        │   ├── Marketplace          # Offer details, plan, publisher
        │   ├── User                 # Admin user info
        │   ├── PartnerProperties    # W&B-specific config (region, subdomain)
        │   └── SingleSignOnPropertiesV2  # Entra ID SSO configuration
        └── Identity                 # Managed identity (optional)

Core Workflows

1. Create Weights & Biases Instance

using Azure.ResourceManager.WeightsAndBiases;
using Azure.ResourceManager.WeightsAndBiases.Models;

ResourceGroupResource resourceGroup = await client
    .GetDefaultSubscriptionAsync()
    .Result
    .GetResourceGroupAsync("my-resource-group");

WeightsAndBiasesInstanceCollection instances = resourceGroup.GetWeightsAndBiasesInstances();

WeightsAndBiasesInstanceData data = new WeightsAndBiasesInstanceData(AzureLocation.EastUS)
{
    Properties = new WeightsAndBiasesInstanceProperties
    {
        // Marketplace configuration
        Marketplace = new WeightsAndBiasesMarketplaceDetails
        {
            SubscriptionId = "<marketplace-subscription-id>",
            OfferDetails = new WeightsAndBiasesOfferDetails
            {
                PublisherId = "wandb",
                OfferId = "wandb-pay-as-you-go",
                PlanId = "wandb-payg",
                PlanName = "Pay As You Go",
                TermId = "monthly",
                TermUnit = "P1M"
            }
        },
        // Admin user
        User = new WeightsAndBiasesUserDetails
        {
            FirstName = "Admin",
            LastName = "User",
            EmailAddress = "admin@example.com",
            Upn = "admin@example.com"
        },
        // W&B-specific configuration
        PartnerProperties = new WeightsAndBiasesPartnerProperties
        {
            Region = WeightsAndBiasesRegion.EastUS,
            Subdomain = "my-company-wandb"
        }
    },
    // Optional: Enable managed identity
    Identity = new ManagedServiceIdentity(ManagedServiceIdentityType.SystemAssigned)
};

ArmOperation<WeightsAndBiasesInstanceResource> operation = await instances
    .CreateOrUpdateAsync(WaitUntil.Completed, "my-wandb-instance", data);

WeightsAndBiasesInstanceResource instance = operation.Value;

Console.WriteLine($"W&B Instance created: {instance.Data.Name}");
Console.WriteLine($"Provisioning state: {instance.Data.Properties.ProvisioningState}");

2. Get Existing Instance

WeightsAndBiasesInstanceResource instance = await resourceGroup
    .GetWeightsAndBiasesInstanceAsync("my-wandb-instance");

Console.WriteLine($"Instance: {instance.Data.Name}");
Console.WriteLine($"Location: {instance.Data.Location}");
Console.WriteLine($"State: {instance.Data.Properties.ProvisioningState}");

if (instance.Data.Properties.PartnerProperties != null)
{
    Console.WriteLine($"Region: {instance.Data.Properties.PartnerProperties.Region}");
    Console.WriteLine($"Subdomain: {instance.Data.Properties.PartnerProperties.Subdomain}");
}

3. List All Instances

// List in resource group
await foreach (WeightsAndBiasesInstanceResource instance in 
    resourceGroup.GetWeightsAndBiasesInstances())
{
    Console.WriteLine($"Instance: {instance.Data.Name}");
    Console.WriteLine($"  Location: {instance.Data.Location}");
    Console.WriteLine($"  State: {instance.Data.Properties.ProvisioningState}");
}

// List in subscription
SubscriptionResource subscription = await client.GetDefaultSubscriptionAsync();
await foreach (WeightsAndBiasesInstanceResource instance in 
    subscription.GetWeightsAndBiasesInstancesAsync())
{
    Console.WriteLine($"{instance.Data.Name} in {instance.Id.ResourceGroupName}");
}

4. Configure Single Sign-On (SSO)

WeightsAndBiasesInstanceResource instance = await resourceGroup
    .GetWeightsAndBiasesInstanceAsync("my-wandb-instance");

// Update with SSO configuration
WeightsAndBiasesInstanceData updateData = instance.Data;

updateData.Properties.SingleSignOnPropertiesV2 = new WeightsAndBiasSingleSignOnPropertiesV2
{
    Type = WeightsAndBiasSingleSignOnType.Saml,
    State = WeightsAndBiasSingleSignOnState.Enable,
    EnterpriseAppId = "<entra-app-id>",
    AadDomains = { "example.com", "contoso.com" }
};

ArmOperation<WeightsAndBiasesInstanceResource> operation = await resourceGroup
    .GetWeightsAndBiasesInstances()
    .CreateOrUpdateAsync(WaitUntil.Completed, "my-wandb-instance", updateData);

5. Update Instance

WeightsAndBiasesInstanceResource instance = await resourceGroup
    .GetWeightsAndBiasesInstanceAsync("my-wandb-instance");

// Update tags
WeightsAndBiasesInstancePatch patch = new WeightsAndBiasesInstancePatch
{
    Tags =
    {
        { "environment", "production" },
        { "team", "ml-platform" },
        { "costCenter", "CC-ML-001" }
    }
};

instance = await instance.UpdateAsync(patch);
Console.WriteLine($"Updated instance: {instance.Data.Name}");

6. Delete Instance

WeightsAndBiasesInstanceResource instance = await resourceGroup
    .GetWeightsAndBiasesInstanceAsync("my-wandb-instance");

await instance.DeleteAsync(WaitUntil.Completed);
Console.WriteLine("Instance deleted");

7. Check Resource Name Availability

// Check if name is available before creating
// (Implement via direct ARM call if SDK doesn't expose this)
try
{
    await resourceGroup.GetWeightsAndBiasesInstanceAsync("desired-name");
    Console.WriteLine("Name is already taken");
}
catch (RequestFailedException ex) when (ex.Status == 404)
{
    Console.WriteLine("Name is available");
}

Key Types Reference

TypePurpose
WeightsAndBiasesInstanceResourceW&B instance resource
WeightsAndBiasesInstanceDataInstance configuration data
WeightsAndBiasesInstanceCollectionCollection of instances
WeightsAndBiasesInstancePropertiesInstance properties
WeightsAndBiasesMarketplaceDetailsMarketplace subscription info
WeightsAndBiasesOfferDetailsMarketplace offer details
WeightsAndBiasesUserDetailsAdmin user information
WeightsAndBiasesPartnerPropertiesW&B-specific configuration
WeightsAndBiasSingleSignOnPropertiesV2SSO configuration
WeightsAndBiasesInstancePatchPatch for updates
WeightsAndBiasesRegionSupported regions enum

Available Regions

Region EnumAzure Region
WeightsAndBiasesRegion.EastUSEast US
WeightsAndBiasesRegion.CentralUSCentral US
WeightsAndBiasesRegion.WestUSWest US
WeightsAndBiasesRegion.WestEuropeWest Europe
WeightsAndBiasesRegion.JapanEastJapan East
WeightsAndBiasesRegion.KoreaCentralKorea Central

Marketplace Offer Details

For Azure Marketplace integration:

PropertyValue
Publisher IDwandb
Offer IDwandb-pay-as-you-go
Plan IDwandb-payg (Pay As You Go)

Best Practices

  1. Use DefaultAzureCredential — Supports multiple auth methods automatically
  2. Enable managed identity — For secure access to other Azure resources
  3. Configure SSO — Enable Entra ID SSO for enterprise security
  4. Tag resources — Use tags for cost tracking and organization
  5. Check provisioning state — Wait for Succeeded before using instance
  6. Use appropriate region — Choose region closest to your compute
  7. Monitor with Azure — Use Azure Monitor for resource health

Error Handling

using Azure;

try
{
    ArmOperation<WeightsAndBiasesInstanceResource> operation = await instances
        .CreateOrUpdateAsync(WaitUntil.Completed, "my-wandb", data);
}
catch (RequestFailedException ex) when (ex.Status == 409)
{
    Console.WriteLine("Instance already exists or name conflict");
}
catch (RequestFailedException ex) when (ex.Status == 400)
{
    Console.WriteLine($"Invalid configuration: {ex.Message}");
}
catch (RequestFailedException ex)
{
    Console.WriteLine($"Azure error: {ex.Status} - {ex.Message}");
}

Integration with W&B SDK

After creating the Azure resource, use the W&B Python SDK for experiment tracking:

# Install: pip install wandb
import wandb

# Login with your W&B API key from the Azure-deployed instance
wandb.login(host="https://my-company-wandb.wandb.ai")

# Initialize a run
run = wandb.init(project="my-ml-project")

# Log metrics
wandb.log({"accuracy": 0.95, "loss": 0.05})

# Finish run
run.finish()

Related SDKs

SDKPurposeInstall
Azure.ResourceManager.WeightsAndBiasesW&B instance management (this SDK)dotnet add package Azure.ResourceManager.WeightsAndBiases --prerelease
Azure.ResourceManager.MachineLearningAzure ML workspacesdotnet add package Azure.ResourceManager.MachineLearning

Reference Links

ResourceURL
NuGet Packagehttps://www.nuget.org/packages/Azure.ResourceManager.WeightsAndBiases
W&B Documentationhttps://docs.wandb.ai/
Azure Marketplacehttps://azuremarketplace.microsoft.com/marketplace/apps/wandb.wandb-pay-as-you-go
GitHub Sourcehttps://github.com/Azure/azure-sdk-for-net/tree/main/sdk/weightsandbiases

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Frequently asked questions about Azure Weights and Biases SDK

Similar skills