Convert Figma logo to code with AI

Azure logoazure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.

5,245
4,580
5,245
1,219

Top Related Projects

14,331

This repo is the official home of .NET on GitHub. It's a great starting point to find many .NET OSS projects from Microsoft and the community, including many that are part of the .NET Foundation.

Microsoft Azure PowerShell

Azure Command-Line Interface

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.

Quick Overview

The Azure/azure-sdk-for-net repository contains the official Azure SDK for .NET, providing developers with libraries to interact with various Azure services. It offers a consistent and idiomatic way to consume Azure services in .NET applications, supporting both .NET Framework and .NET Core.

Pros

  • Comprehensive coverage of Azure services
  • Consistent API design across different Azure services
  • Regular updates and maintenance by Microsoft
  • Extensive documentation and samples

Cons

  • Large repository size due to multiple service SDKs
  • Learning curve for developers new to Azure
  • Potential version conflicts when using multiple Azure services
  • Some services may have limited features compared to REST API

Code Examples

  1. Authenticating with Azure:
using Azure.Identity;

var credential = new DefaultAzureCredential();

This code creates a default credential object for authenticating with Azure services.

  1. Creating a blob client:
using Azure.Storage.Blobs;

string connectionString = "your_connection_string";
string containerName = "your_container_name";

BlobContainerClient containerClient = new BlobContainerClient(connectionString, containerName);

This example demonstrates how to create a blob container client using a connection string.

  1. Sending a message to a queue:
using Azure.Storage.Queues;

string connectionString = "your_connection_string";
string queueName = "your_queue_name";

QueueClient queueClient = new QueueClient(connectionString, queueName);
await queueClient.SendMessageAsync("Hello, Azure!");

This code sends a message to an Azure Storage queue.

Getting Started

To get started with the Azure SDK for .NET:

  1. Install the desired Azure SDK package(s) via NuGet:

    dotnet add package Azure.Storage.Blobs
    dotnet add package Azure.Identity
    
  2. Add the necessary using statements in your code:

    using Azure.Identity;
    using Azure.Storage.Blobs;
    
  3. Authenticate and create a client:

    var credential = new DefaultAzureCredential();
    var blobServiceClient = new BlobServiceClient(new Uri("https://your-account.blob.core.windows.net"), credential);
    
  4. Use the client to interact with Azure services:

    var containerClient = blobServiceClient.GetBlobContainerClient("your-container-name");
    await containerClient.CreateIfNotExistsAsync();
    

For more detailed instructions and examples, refer to the official Azure SDK documentation.

Competitor Comparisons

14,331

This repo is the official home of .NET on GitHub. It's a great starting point to find many .NET OSS projects from Microsoft and the community, including many that are part of the .NET Foundation.

Pros of dotnet

  • Broader scope, covering the entire .NET ecosystem
  • More active community with a larger number of contributors
  • Includes runtime, libraries, and language implementations

Cons of dotnet

  • Less focused on specific Azure services integration
  • May have a steeper learning curve for Azure-specific development
  • Updates might not align as closely with Azure service changes

Code Comparison

azure-sdk-for-net:

using Azure.Storage.Blobs;
var blobServiceClient = new BlobServiceClient(connectionString);
var containerClient = blobServiceClient.GetBlobContainerClient(containerName);
await containerClient.CreateIfNotExistsAsync();

dotnet:

using System.Net.Http;
using System.Text.Json;
var client = new HttpClient();
var response = await client.GetAsync("https://api.example.com/data");
var content = await response.Content.ReadAsStringAsync();

The azure-sdk-for-net example shows Azure-specific functionality, while the dotnet example demonstrates more general-purpose .NET code. The Azure SDK provides a higher level of abstraction for Azure services, whereas the dotnet repository focuses on core .NET functionality that can be used across various applications and scenarios.

Microsoft Azure PowerShell

Pros of azure-powershell

  • More intuitive for system administrators and IT professionals familiar with PowerShell
  • Easier to automate Azure tasks and integrate with existing PowerShell scripts
  • Provides a command-line interface for quick Azure management tasks

Cons of azure-powershell

  • Limited to PowerShell environment, less flexible for cross-platform development
  • May require more verbose syntax compared to C# SDK for complex operations
  • Less suitable for building large-scale applications or services

Code Comparison

azure-powershell:

New-AzResourceGroup -Name "MyResourceGroup" -Location "EastUS"
$storageAccount = New-AzStorageAccount -ResourceGroupName "MyResourceGroup" `
    -Name "mystorageaccount" -Location "EastUS" -SkuName "Standard_LRS"

azure-sdk-for-net:

var resourceGroup = await resourceGroupClient.CreateOrUpdate("MyResourceGroup", new ResourceGroup("EastUS"));
var storageAccount = await storageManager.StorageAccounts.Define("mystorageaccount")
    .WithRegion(Region.USEast)
    .WithExistingResourceGroup("MyResourceGroup")
    .WithSku(StorageAccountSkuType.Standard_LRS)
    .CreateAsync();

Both repositories provide tools for managing Azure resources, but azure-powershell is more suited for scripting and command-line operations, while azure-sdk-for-net offers deeper integration with .NET applications and more flexibility for developers building complex Azure-based solutions.

Azure Command-Line Interface

Pros of azure-cli

  • Provides a command-line interface for managing Azure resources, making it easier for users who prefer CLI tools
  • Offers cross-platform support (Windows, macOS, Linux) and can be run in Docker containers
  • Includes built-in help and documentation accessible directly from the command line

Cons of azure-cli

  • Limited to command-line operations, lacking the flexibility of programmatic access offered by azure-sdk-for-net
  • May require more manual effort for complex operations that could be automated with scripts using the SDK
  • Updates to Azure services may not be immediately reflected in the CLI, potentially causing delays in feature availability

Code Comparison

azure-cli:

az group create --name myResourceGroup --location eastus
az vm create --resource-group myResourceGroup --name myVM --image Ubuntu2204

azure-sdk-for-net:

var resourceGroup = await resourceGroupClient.CreateOrUpdate("myResourceGroup", new ResourceGroup { Location = "eastus" });
var vm = await computeClient.VirtualMachines.CreateOrUpdate("myResourceGroup", "myVM", new VirtualMachine { Location = "eastus", OSProfile = new OSProfile { ... } });

The CLI example shows simple commands for creating resources, while the SDK example demonstrates programmatic creation with more detailed configuration options.

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.

Pros of azure-sdk-for-java

  • More consistent API design across different Azure services
  • Better support for asynchronous programming with Project Reactor
  • Improved error handling and exception hierarchy

Cons of azure-sdk-for-java

  • Steeper learning curve for developers new to reactive programming
  • Slightly more verbose code compared to the .NET SDK
  • Less mature ecosystem and community support

Code Comparison

azure-sdk-for-java:

BlobServiceClient blobServiceClient = new BlobServiceClientBuilder()
    .connectionString(connectionString)
    .buildClient();

BlobContainerClient containerClient = blobServiceClient.getBlobContainerClient(containerName);
containerClient.createIfNotExists();

azure-sdk-for-net:

BlobServiceClient blobServiceClient = new BlobServiceClient(connectionString);
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(containerName);
await containerClient.CreateIfNotExistsAsync();

The Java SDK uses a builder pattern for client creation, while the .NET SDK uses constructor injection. The Java version also uses synchronous methods by default, whereas the .NET version favors asynchronous operations.

Both SDKs provide similar functionality and abstractions for working with Azure services, but they cater to the idiomatic patterns and best practices of their respective languages and ecosystems.

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.

Pros of azure-sdk-for-python

  • More Pythonic API design, following Python conventions and best practices
  • Better integration with popular Python frameworks and libraries
  • Easier to use for data science and machine learning tasks on Azure

Cons of azure-sdk-for-python

  • Smaller community and fewer resources compared to the .NET ecosystem
  • May have fewer features or less comprehensive coverage of Azure services
  • Potentially slower performance for certain operations due to Python's interpreted nature

Code Comparison

azure-sdk-for-python:

from azure.storage.blob import BlobServiceClient

connection_string = "DefaultEndpointsProtocol=https;AccountName=..."
blob_service_client = BlobServiceClient.from_connection_string(connection_string)
container_client = blob_service_client.get_container_client("mycontainer")
blob_client = container_client.get_blob_client("myblob")

azure-sdk-for-net:

using Azure.Storage.Blobs;

string connectionString = "DefaultEndpointsProtocol=https;AccountName=...";
BlobServiceClient blobServiceClient = new BlobServiceClient(connectionString);
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient("mycontainer");
BlobClient blobClient = containerClient.GetBlobClient("myblob");

Both SDKs provide similar functionality for interacting with Azure services, but the Python version tends to have a more concise and readable syntax. The .NET version may offer better performance and stronger typing, which can be beneficial for large-scale enterprise applications.

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.

Pros of azure-sdk-for-js

  • Better suited for modern web and Node.js applications
  • Supports TypeScript, providing enhanced type safety and developer experience
  • Generally more lightweight and faster to execute in JavaScript environments

Cons of azure-sdk-for-js

  • Less mature compared to the .NET SDK, potentially with fewer features
  • May have limited support for certain Azure services that are more .NET-centric
  • Asynchronous programming model might be more challenging for developers new to JavaScript

Code Comparison

azure-sdk-for-js:

import { BlobServiceClient } from "@azure/storage-blob";

const blobServiceClient = BlobServiceClient.fromConnectionString(connectionString);
const containerClient = blobServiceClient.getContainerClient(containerName);
await containerClient.uploadBlockBlob(blobName, data, data.length);

azure-sdk-for-net:

using Azure.Storage.Blobs;

BlobServiceClient blobServiceClient = new BlobServiceClient(connectionString);
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(containerName);
await containerClient.UploadBlobAsync(blobName, new MemoryStream(data));

Both SDKs provide similar functionality, but the JavaScript version uses a more promise-based approach, while the .NET version relies on async/await patterns. The JavaScript SDK also tends to have a flatter structure in its API design, which can be more intuitive for JavaScript developers.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Azure SDK for .NET

Packages Dependencies Dependencies Graph

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs or our versioned developer docs.

Getting started

To get started with a library, see the README.md file located in the library's project folder. You can find these library folders grouped by service in the /sdk directory.

For tutorials, samples, quick starts, and other documentation, go to Azure for .NET Developers.

Packages available

Each service might have a number of libraries available from each of the following categories:

Client: New Releases

New wave of packages that we are announcing as GA and several that are currently releasing in preview. These libraries follow the Azure SDK Design Guidelines for .NET and share a number of core features such as HTTP retries, logging, transport protocols, authentication protocols, etc., so that once you learn how to use these features in one client library, you will know how to use them in other client libraries. You can learn about these shared features at Azure.Core.

These new client libraries can be identified by the naming used for their folder, package, and namespace. Each will start with Azure, followed by the service category, and then the name of the service. For example Azure.Storage.Blobs.

For a complete list of available packages, please see the latest available packages page.

NOTE: If you need to ensure your code is ready for production we strongly recommend using one of the stable, non-preview libraries.

Client: Previous Versions

Last stable versions of packages that are production-ready. These libraries provide similar functionalities to the preview packages, as they allow you to use and consume existing resources and interact with them, for example: upload a storage blob. Stable library directories typically contain 'Microsoft.Azure' in their names, e.g. 'Microsoft.Azure.KeyVault'. They might not implement the guidelines or have the same feature set as the November releases. They do however offer wider coverage of services.

Management: New Releases

A new set of management libraries that follow the Azure SDK Design Guidelines for .NET and based on Azure.Core libraries are now in Public Preview. These new libraries provide a number of core capabilities that are shared amongst all Azure SDKs, including the intuitive Azure Identity library, an HTTP Pipeline with custom policies, error-handling, distributed tracing, and much more. You can find the list of new packages on this page.

To get started with these new libraries, please see the quickstart guide here. These new libraries can be identified by namespaces that start with Azure.ResourceManager, e.g. Azure.ResourceManager.Network

NOTE: If you need to ensure your code is ready for production use one of the stable, non-preview libraries.

Management: Previous Versions

For a complete list of management libraries which enable you to provision and manage Azure resources, please check here. They might not have the same feature set as the new releases but they do offer wider coverage of services. Previous versions of management libraries can be identified by namespaces that start with Microsoft.Azure.Management, e.g. Microsoft.Azure.Management.Network

Documentation and code samples for these libraries can be found here.

Need help?

Community

  • Chat with other community members Join the chat at https://gitter.im/azure/azure-sdk-for-net

Reporting security issues and security bugs

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

We want your thoughts!

Feature Requests

What features are important to you? You can let us know by looking at our open feature requests and sharing your thoughts by giving the issue a thumbs up or thumbs down. (Note the list is sorted by number of thumbs up in descending order.)

Design Discussions

We would love to incorporate the community's input into our library design process. Here's a list of design discussions that we're currently having. Participate in the discussions by leaving your comments in the issue!

Contributing

For details on contributing to this repository, see the contributing guide.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Impressions