Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Azure SDK for .NET
This repository contains official .NET libraries for Azure services. You can find NuGet packages for these libraries [here](packages.md).

[![Packages](https://img.shields.io/badge/packages-latest-blue.svg)](https://azure.github.io/azure-sdk/releases/latest/dotnet.html) [![Dependencies](https://img.shields.io/badge/dependencies-analyzed-blue.svg)](https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-net/dependencies/dependencies.html)

This repository is intended for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our [public developer docs](https://docs.microsoft.com/en-us/dotnet/azure/) or our versioned [developer docs](https://azure.github.io/azure-sdk-for-net).

## Getting started

Expand All @@ -12,7 +15,7 @@ For tutorials, samples, quick starts, and other documentation, go to [Azure for
### Client: November 2019 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](https://azure.github.io/azure-sdk/dotnet/guidelines/) 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](/sdk/core/Azure.Core/README.md).

These preview libraries can be easily identified by their folder, package, and namespaces names starting with 'Azure', e.g. Azure.Storage.Blobs.
These preview libraries can be easily identified by their folder, package, and namespaces names starting with 'Azure', e.g. Azure.Storage.Blobs.

The libraries released in the November 2019 GA release:
* [Azure.Identity](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/identity/Azure.Identity/README.md)
Expand All @@ -31,12 +34,15 @@ The libraries released in the November 2019 preview:
> NOTE: If you need to ensure your code is ready for production use 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](https://azure.github.io/azure-sdk/dotnet_introduction.html) or have the same feature set as the Novemeber releases. They do however offer wider coverage of services.

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](https://azure.github.io/azure-sdk/dotnet_introduction.html) or have the same feature set as the Novemeber releases. They do however offer wider coverage of services.

### Management

Libraries which enable you to provision specific server resources. They are directly mirroring Azure service's REST endpoints. Management library directories typically contain the word 'Management' in their names, e.g. 'Microsoft.Azure.Management.Storage'.

## Need help?

* For reference documentation visit the [Azure SDK for .NET API Reference](http://aka.ms/net-docs).
* For tutorials, samples, quick starts, and other documentation, go to [Azure for .NET Developers](https://docs.microsoft.com/en-us/dotnet/azure/).
* File an issue via [Github Issues](https://github.com/Azure/azure-sdk-for-net/issues/new/choose).
Expand All @@ -56,8 +62,4 @@ When you submit a pull request, a CLA-bot will automatically determine whether y

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

| Component | Build Status |
| --------- | ------------ |
| Management Libraries | [![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/529?branchName=master)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=529&branchName=master) |

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2FREADME.png)
39 changes: 20 additions & 19 deletions common/SmokeTests/SmokeTest/EventHubsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,19 @@
// Copyright(c) Microsoft Corporation.
// Licensed under the MIT License.
// ------------------------------------
using Azure;
using Azure.Messaging.EventHubs;
using Microsoft.Azure.Amqp.Framing;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net.Http;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace SmokeTest
{
class EventHubsTest
{
private static EventHubClient client;
private static EventHubProducer sender;
private static EventHubConsumer receiver;
private static EventHubProducerClient sender;
private static EventHubConsumerClient receiver;

/// <summary>
/// Test the Event Hubs SDK by sending and receiving events
Expand All @@ -37,22 +29,31 @@ public static async Task RunTests()
Console.WriteLine("2.- Recieve those events\n");

var connectionString = Environment.GetEnvironmentVariable("EVENT_HUBS_CONNECTION_STRING");
client = new EventHubClient(connectionString);

await CreateSenderAndReceiver();
await CreateSenderAndReceiver(connectionString);
await SendAndReceiveEvents();
}

private static async Task CreateSenderAndReceiver()
private static async Task<string> GetPartitionId(string connectionString)
{
var client = new EventHubProducerClient(connectionString);
var result = (await client.GetPartitionIdsAsync()).First();
await client.DisposeAsync();
return result;
}

private static async Task CreateSenderAndReceiver(string connectionString)
{
Console.Write("Creating the Sender and Receivers... ");
var partition = (await client.GetPartitionIdsAsync()).First();
var producerOptions = new EventHubProducerOptions

var partitionId = await GetPartitionId(connectionString);

var producerOptions = new EventHubProducerClientOptions
{
PartitionId = partition
PartitionId = partitionId,
};
sender = client.CreateProducer(producerOptions);
receiver = client.CreateConsumer(EventHubConsumer.DefaultConsumerGroupName, partition, EventPosition.Latest);
sender = new EventHubProducerClient(connectionString, producerOptions);
receiver = new EventHubConsumerClient(EventHubConsumerClient.DefaultConsumerGroupName, partitionId, EventPosition.Latest, connectionString);
Console.WriteLine("\tdone");
}

Expand All @@ -73,7 +74,7 @@ private static async Task SendAndReceiveEvents()
Console.Write("Ready to send a batch of " + eventBatch.Count().ToString() + " events... ");
await sender.SendAsync(eventBatch);
Console.Write("Sent\n");

Console.Write("Receiving events... ");
while ((receivedEvents.Count < eventBatch.Length) && (++index < 3))
{
Expand Down
7 changes: 4 additions & 3 deletions common/SmokeTests/SmokeTest/KeyVaultTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public static async Task RunTests()
private static async Task SetNewSecret()
{
Console.Write("Setting a secret...");
var newSecret = new Secret(SecretName, SecretValue);
var newSecret = new KeyVaultSecret(SecretName, SecretValue);
await client.SetSecretAsync(newSecret);
Console.WriteLine("\tdone");
}

private static async Task GetSecret()
{
Console.Write("Getting that secret...");
Azure.Response<Secret> secret;
Azure.Response<KeyVaultSecret> secret;
secret = await client.GetSecretAsync(SecretName);
//Verify that the secret received is the one that was set previously
if (secret.Value.Value != SecretValue)
Expand All @@ -63,7 +63,8 @@ private static async Task GetSecret()
private static async Task CleanUp()
{
Console.Write("Cleaning up the resource...");
await client.DeleteSecretAsync(SecretName);
var secretDeletePoller = await client.StartDeleteSecretAsync(SecretName);
await secretDeletePoller.WaitForCompletionAsync();
Console.WriteLine("\tdone");
}
}
Expand Down
2 changes: 0 additions & 2 deletions common/SmokeTests/SmokeTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
// Licensed under the MIT License.
// ------------------------------------
// ------------------------------------
using Azure.Messaging.EventHubs;
using System;
using System.Reflection.Metadata;
using System.Threading.Tasks;

namespace SmokeTest
Expand Down
11 changes: 5 additions & 6 deletions common/SmokeTests/SmokeTest/SmokeTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.0.0-preview.5" />
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.0.0-preview.4" />
<PackageReference Include="Azure.Security.Keyvault.Secrets" Version="4.0.0-preview.5" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.0.0-preview.4" />
<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.8.1" />
<PackageReference Include="System.Reflection.Metadata" Version="1.6.0" />
<PackageReference Include="Azure.Identity" Version="1.0.0" />
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.0.0-preview.5" />
<PackageReference Include="Azure.Security.Keyvault.Secrets" Version="4.0.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.0.0" />
<PackageReference Include="Microsoft.Azure.DocumentDB.Core" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<PackageReference Update="NUnit3TestAdapter" Version="3.13.0" />
<PackageReference Update="Polly" Version="7.1.0" />
<PackageReference Update="Portable.BouncyCastle" Version="1.8.5" />
<PackageReference Update="PublicApiGenerator" Version="9.3.0" />
<PackageReference Update="PublicApiGenerator" Version="10.0.1" />
<PackageReference Update="System.Buffers" Version="4.5.0" />
<PackageReference Update="System.Collections.Concurrent" Version="4.3.0" />
<PackageReference Update="System.Collections" Version="4.3.0" />
Expand Down
72 changes: 72 additions & 0 deletions eng/docgeneration/docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"metadata": [
{
"src": [
{
"files": [
"src/**.csproj"
]
}
],
"dest": "api",
"disableGitFeatures": false,
"disableDefaultFilter": false
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/**.md",
"api/index.md"
]
},
{
"files": [
"toc.yml",
"*.md"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default",
"templates/matthews"
],
"postProcessors": [],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false,
"globalMetadata": {
"_appTitle": "Azure SDK for NET",
"_appFooter": "Azure SDK for Net",
"_enableSearch": false,
"_enableNewTab": true,
"_appFaviconPath": "https://c.s-microsoft.com/favicon.ico?v2",
"_disableContribution": true
}
}
}
125 changes: 125 additions & 0 deletions eng/docgeneration/docindex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
resources:
repositories:
- repository: azure-sdk-tools
type: github
name: azure/azure-sdk-tools
endpoint: azure

jobs:
- job: GenerateDocIndex
variables:
- template: ../pipelines/templates/variables/globals.yml
pool:
vmImage: windows-2019
steps:
- pwsh: |
Invoke-WebRequest -Uri "https://github.com/dotnet/docfx/releases/download/v2.43.2/docfx.zip" `
-OutFile "docfx.zip" | Wait-Process; Expand-Archive -Path "docfx.zip" -DestinationPath "./docfx/"
workingDirectory: $(Build.BinariesDirectory)
displayName: Download and Extract DocFX
- task: CmdLine@2
displayName: Provision DocFX Directory
inputs:
script: $(Build.BinariesDirectory)/docfx/docfx.exe init -q
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
- pwsh: New-Item -Path . -Name "templates" -ItemType "directory"
displayName: Create Template Directory
workingDirectory: $(Build.SourcesDirectory)/docfx_project/
- task: CopyFiles@2
displayName: Copy Template to templates folder
inputs:
sourceFolder: $(Build.SourcesDirectory)/eng/docgeneration/templates
content: '**\*'
targetFolder: $(Build.SourcesDirectory)/docfx_project/templates
overWrite: true
- pwsh: ls
workingDirectory: $(Build.SourcesDirectory)/docfx_project/
- pwsh: ls
workingDirectory: $(Build.SourcesDirectory)/docfx_project/templates
- pwsh: |
Copy-Item "$(Build.SourcesDirectory)/eng/docgeneration/docfx.json" -Destination "$(Build.SourcesDirectory)/docfx_project/" -Force
displayName: Copy over docfx.json
- pwsh: |
$ServiceList = Get-ChildItem "$(Build.SourcesDirectory)/sdk" -Directory -Exclude eng, mgmtcommon, template | Sort-Object
$YmlPath = "$(Build.SourcesDirectory)/docfx_project/api"
New-Item -Path $YmlPath -Name "toc.yml" -Force
foreach ($Dir in $ServiceList)
{
New-Item -Path $YmlPath -Name "$($Dir.Name).md" -Force
Write-Host "Write to Toc.yml"
Add-Content -Path "$($YmlPath)/toc.yml" -Value "- name: $($Dir.Name.ToUpper())`r`n href: $($Dir.Name).md"
Write-Host "Write Client Header"
$PkgList = Get-ChildItem $Dir.FullName -Directory -Exclude .vs, .vscode, Azure.Security.KeyVault.Shared | Where-Object -FilterScript {$_.Name -notmatch ".Management."}
if (($PkgList | Measure-Object).count -eq 0)
{
continue
}
Add-Content -Path "$($YmlPath)/$($Dir.Name).md" -Value "# CLIENT"
Add-Content -Path "$($YmlPath)/$($Dir.Name).md" -Value "---"
foreach ($Pkg in $PkgList)
{
if (Test-Path "$($pkg.FullName)\src")
{
$ProjectName = Get-ChildItem "$($pkg.FullName)\src\*" -Include *.csproj
Write-Host "Write $($ProjectName.Name)"
Add-Content -Path "$($YmlPath)/$($Dir.Name).md" -Value "#### $($ProjectName.BaseName)"
}
}
}
foreach ($Dir in $ServiceList)
{
Write-Host "Write Mgmt Header"
$PkgList = Get-ChildItem $Dir.FullName -Directory | Where-Object -FilterScript {$_.Name -match ".Management."}
if (($PkgList | Measure-Object).count -eq 0)
{
continue
}
Add-Content -Path "$($YmlPath)/$($Dir.Name).md" -Value "# MANAGEMENT"
Add-Content -Path "$($YmlPath)/$($Dir.Name).md" -Value "---"
foreach ($Pkg in $PkgList)
{
if (Test-Path "$($pkg.FullName)\src")
{
$ProjectName = Get-ChildItem "$($pkg.FullName)\src\*" -Include *.csproj
Write-Host "Write $($ProjectName.Name)"
Add-Content -Path "$($YmlPath)/$($Dir.Name).md" -Value "#### $($ProjectName.BaseName)"
}
}
}
New-Item -Path "$(Build.SourcesDirectory)/docfx_project" -Name "toc.yml" -Force
Add-Content -Path "$(Build.SourcesDirectory)/docfx_project/toc.yml" -Value "- name: Azure SDK for NET APIs`r`n href: api/`r`n homepage: api/index.md"
Copy-Item "$(Build.SourcesDirectory)/README.md" -Destination "$(Build.SourcesDirectory)/docfx_project/api/index.md" -Force
Copy-Item "$(Build.SourcesDirectory)/*.md" -Destination "$(Build.SourcesDirectory)/docfx_project/api" -Force
displayName: Create main index and navigation toc.yml, copy over readme.
- pwsh: ls
workingDirectory: $(Build.SourcesDirectory)/docfx_project/api
- task: CmdLine@2
displayName: Build Doc Content
inputs:
script: $(Build.BinariesDirectory)/docfx/docfx.exe build
workingDirectory: $(Build.SourcesDirectory)/docfx_project/
failOnStderr: true
- pwsh: |
Copy-Item "$(Build.SourcesDirectory)/eng/docgeneration/assets/logo.svg" -Destination "$(Build.SourcesDirectory)/docfx_project/_site/" -Force
Copy-Item "$(Build.SourcesDirectory)/eng/docgeneration/assets/toc.yml" -Destination "$(Build.SourcesDirectory)/docfx_project/_site/" -Force
displayName: Replace site assets
- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
inputs:
versionSpec: '3.6'
- template: eng/pipelines/templates/scripts/mashup-doc-index.yml@azure-sdk-tools
parameters:
SourceDirectory: $(Build.SourcesDirectory)
- task: CopyFiles@2
displayName: Copy HTML to Artifacts Directory
inputs:
sourceFolder: $(Build.SourcesDirectory)/docfx_project/
content: '**\*'
targetFolder: $(Build.ArtifactStagingDirectory)/docfx_project
overWrite: true
- task: PublishPipelineArtifact@0
condition: succeeded()
inputs:
artifactName: "Doc.Index"
targetPath: $(Build.ArtifactStagingDirectory)/docfx_project/_site
Loading