Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
Browse files Browse the repository at this point in the history
…nto feature/mgmt-track2
  • Loading branch information
m-nash committed May 7, 2021
2 parents e470fcc + ab7400c commit 9f4c8ce
Show file tree
Hide file tree
Showing 465 changed files with 36,777 additions and 20,361 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@
# ServiceLabel: %Compute - VMSS %Service Attention
#/<NotInRepo>/ @Drewm3 @avirishuv

# PRLabel: %Confidential Ledger
/sdk/confidentialledger/ @christothes

# ServiceLabel: %Consumption %Service Attention
/sdk/consumption/Microsoft.Azure.Management.Consumption/ @ms-premp

Expand Down
33 changes: 33 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": "0.1",
"language": "en_US",
"languageId": "csharp",
"dictionaries": ["powershell"],
"ignorePaths": [
"**/SessionRecords/**",
"**/packages/**",
"artifacts/**/*",
"*.exe",
"*.dll",
"*.nupkg",
"*.bmp",
"*.png",
"*.gif",
"*.jpg",
"*.tiff",
"*.wav",
"*.pdf",
"*.zip",
"*.sha512",
"*.ico",
"*.pri",
".vscode/cspell.json"
],
// cspell is not case sensitive
// Sort words alphabetically to make this list easier to use
"words": [],
"overrides": [
{ "filename": "**/sdk/formrecognizer/**/*.cs", "words": ["ZhHant"] }
],
"allowCompoundWords": true
}
29 changes: 29 additions & 0 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Support

## How to file issues and get help  

Customers with a [support plan](https://azure.microsoft.com/en-us/support/options/) can open an Azure Support ticket [here](https://azure.microsoft.com/support/create-ticket/).
**We recommend this option if your problem requires immediate attention.**

### Community resources
- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/azure-sdk-.net) and tag it with azure-sdk-.net
- Share or upvote feature requests on [Feedback Page](https://feedback.azure.com/forums/34192--general-feedback).
- Take a look at the [Azure SDK blog](https://devblogs.microsoft.com/azure-sdk/).
- Chat with other community members on [gitter](https://gitter.im/Azure/azure-sdk-for-net?source=orgpage)
- Ask a question on [Twitter](https://twitter.com/AzureSDK)
- Ask a question at [Microsoft Q&A](https://docs.microsoft.com/answers/products/azure?WT.mc_id=Portal-Microsoft_Azure_Support&product=all)
- Ask a question at [Microsoft Tech Community](https://techcommunity.microsoft.com/t5/azure/ct-p/Azure)
- Search for similar issues in [our GitHub repository](https://github.com/Azure/azure-sdk-for-net/issues)

### Security bugs
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center(secure@microsoft.com).
You should receive a response within 24 hours.
Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://www.microsoft.com/msrc/faqs-report-an-issue?rtc=1)

### Github issues
We use [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues/new/choose) to track bugs, questions, and feature requests.
GitHub issues are free, but **response time is not guaranteed.** See [GitHub issues support process](https://devblogs.microsoft.com/azure-sdk/github-issue-support-process/) for more details.

## Microsoft Support Policy

Please refer to [Azure SDK Support and Lifecycle information](https://azure.github.io/azure-sdk/policies_support.html)
1 change: 1 addition & 0 deletions eng/.docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ known_presence_issues:
- ['sdk/cognitiveservices/Vision.Face','#5499']
- ['sdk/cognitiveservices/Vision.FormRecognizer','#5499']
- ['sdk/containerregistry/Microsoft.Azure.ContainerRegistry','#5499']
- ['sdk/eventgrid/Azure.Messaging.EventGrid/EventGridSourceGenerator','#5499']
- ['sdk/eventgrid/Microsoft.Azure.EventGrid','#5499']
- ['sdk/eventhub/Microsoft.Azure.EventHubs.Processor','#5499']
- ['sdk/eventhub/Microsoft.Azure.EventHubs.ServiceFabricProcessor','#5499']
Expand Down
3 changes: 2 additions & 1 deletion eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
All should have PrivateAssets="All" set so they don't become pacakge dependencies
-->
<ItemGroup>
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20210504.2" PrivateAssets="All" />
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20210505.1" PrivateAssets="All" />
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20210322.2" PrivateAssets="All" />
<PackageReference Update="coverlet.collector" Version="1.3.0" PrivateAssets="All" />
<PackageReference Update="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1" PrivateAssets="All" />
Expand All @@ -138,6 +138,7 @@
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Update="SauceControl.InheritDoc" Version="1.2.0" PrivateAssets="All" />
<PackageReference Update="StyleCop.Analyzers" Version="1.2.0-beta.333" PrivateAssets="All" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version ="3.9.0" PrivateAssets="all" />
</ItemGroup>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ steps:
condition: succeeded()
- pwsh: |
$setDailyDevBuild = "false"
if (('$(Build.Reason)' -in 'Schedule', 'IndividualCI') -and ('$(System.TeamProject)' -eq 'internal')) {
if (('$(Build.Reason)' -eq 'Schedule') -and ('$(System.TeamProject)' -eq 'internal')) {
$setDailyDevBuild = "true"
}
echo "##vso[task.setvariable variable=SetDevVersion]$setDailyDevBuild"
displayName: "Setup Versioning Properties"
condition: eq(variables['SetDevVersion'], '')
- pwsh: |
echo "##vso[task.setvariable variable=SetDevVersion;isOutput=true]$(SetDevVersion)"
name: VersioningProperties
displayName: "Export Versioning Properties"
4 changes: 2 additions & 2 deletions eng/mgmt/mgmtmetadata/extendedlocation_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/extendedlocation/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\Users\amalladi\test-apps\azure-sdk-for-net\sdk
2021-03-19 05:26:08 UTC
2021-05-03 15:47:00 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 86aebe0f4e974b72dffe19a293465a76d664f8e0
Commit: dceaa75fe47854ad7b0fcc0c7cf38677b4bb181f
AutoRest information
Requested version: v2
Bootstrapper version: autorest@2.0.4413
4 changes: 2 additions & 2 deletions eng/mgmt/mgmtmetadata/iothub_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/iothub/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2020-03 --csharp-sdks-folder=C:\code\Azure\asfn1\sdk
2021-02-17 20:16:51 UTC
2021-05-05 18:24:00 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 55131eaf8fb4722171769ba175791ad45ae3d969
Commit: a394eccc2ce26369cacbc113cf0c3a9c9501e689
AutoRest information
Requested version: v2
Bootstrapper version: autorest@2.0.4413
13 changes: 13 additions & 0 deletions eng/pipelines/aggregate-reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ jobs:
artifact: packages
patterns: '*'

- pwsh: |
npx cspell lint `
--config ./.vscode/cspell.json `
./sdk/**/api/*.cs
displayName: Check spelling of public API surface
# Spelling errors in public api surface are not blockers yet but will
# become blockers when this is rolled out to all services. For now, turn
# the pipeline yellow if spelling errors are detected but do not block.
# Individual services can be blocked on spelling errors using:
# `SpellCheckPublicApiSurface: true`
# in the archetype-sdk-client.yml template invocation
continueOnError: true
- template: /eng/common/pipelines/templates/steps/verify-links.yml
parameters:
Directory: ""
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/templates/jobs/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ parameters:
- name: MatrixReplace
type: object
default: []
- name: SpellCheckPublicApiSurface
type: boolean
default: false

jobs:
- job: Build
Expand Down Expand Up @@ -135,6 +138,7 @@ jobs:
arguments: >
-ServiceDirectory ${{ parameters.ServiceToTest }}
-SDKType ${{ parameters.SDKType }}
-SpellCheckPublicApiSurface:$${{ parameters.SpellCheckPublicApiSurface }}
pwsh: true
failOnStderr: false
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
Expand Down
6 changes: 1 addition & 5 deletions eng/pipelines/templates/stages/archetype-net-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ stages:
- stage: Release_${{artifact.safeName}}
displayName: 'Release: ${{artifact.name}}'
dependsOn: Signing
variables:
SetDevVersion: $[stageDependencies.Build.Build.outputs['VersioningProperties.SetDevVersion']]
condition: and(succeeded(), ne(variables['SetDevVersion'], 'true'), ne(variables['Skip.Release'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-net-pr'))
jobs:
- deployment: TagRepository
Expand Down Expand Up @@ -241,11 +239,9 @@ stages:

- stage: Integration
dependsOn: Signing
variables:
SetDevVersion: $[stageDependencies.Build.Build.outputs['VersioningProperties.SetDevVersion']]
jobs:
- job: PublishPackages
condition: and(eq(variables['SetDevVersion'], 'true'), eq(variables['System.TeamProject'], 'internal'))
condition: or(eq(variables['SetDevVersion'], 'true'), and(eq(variables['Build.Reason'],'Schedule'), eq(variables['System.TeamProject'], 'internal')))
displayName: Publish package to daily feed
variables:
BlobFeedUrl: 'https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-net/index.json'
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ parameters:
- name: MatrixReplace
type: object
default: []
- name: SpellCheckPublicApiSurface
type: boolean
default: false

variables:
- template: ../variables/globals.yml
Expand All @@ -71,6 +74,7 @@ stages:
ArtifactName: packages
TestSetupSteps: ${{ parameters.TestSetupSteps }}
TestTimeoutInMinutes: ${{ parameters.TestTimeoutInMinutes }}
SpellCheckPublicApiSurface: ${{ parameters.SpellCheckPublicApiSurface }}
MatrixConfigs:
- ${{ each config in parameters.MatrixConfigs }}:
- ${{ config }}
Expand Down
7 changes: 5 additions & 2 deletions eng/scripts/CodeChecks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ param (
[string] $ProjectDirectory,

[Parameter()]
[string] $SDKType = "all"
[string] $SDKType = "all",

[Parameter()]
[switch] $SpellCheckPublicApiSurface
)

$ErrorActionPreference = 'Stop'
Expand Down Expand Up @@ -87,7 +90,7 @@ try {

Write-Host "Re-generating listings"
Invoke-Block {
& $PSScriptRoot\Export-API.ps1 -ServiceDirectory $ServiceDirectory -SDKType $SDKType
& $PSScriptRoot\Export-API.ps1 -ServiceDirectory $ServiceDirectory -SDKType $SDKType -SpellCheckPublicApiSurface:$SpellCheckPublicApiSurface
}

if (-not $ProjectDirectory)
Expand Down
18 changes: 17 additions & 1 deletion eng/scripts/Export-API.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,25 @@ param (
[Parameter(Position=0)]
[ValidateNotNullOrEmpty()]
[string] $ServiceDirectory,
[string] $SDKType = "all"
[string] $SDKType = "all",
[switch] $SpellCheckPublicApiSurface
)

if ($SpellCheckPublicApiSurface -and -not (Get-Command 'npx')) {
Write-Error "Could not locate npx. Install NodeJS (includes npm and npx) https://nodejs.org/en/download/"
exit 1
}

$servicesProj = Resolve-Path "$PSScriptRoot/../service.proj"

dotnet build /t:ExportApi /p:RunApiCompat=false /p:InheritDocEnabled=false /p:GeneratePackageOnBuild=false /p:Configuration=Release /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:IncludeTests=false /p:Scope="$ServiceDirectory" /p:SDKType=$SDKType /restore $servicesProj

if ($SpellCheckPublicApiSurface) {
Write-Host "Spell check public API surface"
npx cspell lint `
--config "$PSScriptRoot/../../.vscode/cspell.json" `
"$PSScriptRoot/../../sdk/$ServiceDirectory/*/api/*.cs"
if ($LASTEXITCODE) {
Write-Host "##vso[task.LogIssue type=error;]Spelling errors detected. To correct false positives or learn about spell checking see: https://aka.ms/azsdk/engsys/spellcheck"
}
}
1 change: 1 addition & 0 deletions sdk/attestation/Azure.Security.Attestation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ to reduce the number of parameters passed into the API.
- The return value of `GetPolicyManagementCertificates` has been changed from `AttestationResult<PolicyCertificatesResult>` to `AttestationResult<IReadOnlyList<X509Certificate2>>` to simplify the experience of retrieving the certificate list. As a consequence of this change, the `PolicyCertificatesResult` type has been removed.
- The unused `TpmAttestationRequest` and `TpmAttestationResponse` types have been removed.
- The `AttestationTokenSigningKey` will now ensure that the public key in the provided certificate is the public key corresponding to the private key.
- `AttestTpm` and `AttestTpmAsync` are changed to accept a new `TpmAttestationRequest` and return a `TpmAttestationResponse` instead of accepting and returning a `BinaryData`. The semantics of the API do not change, just the encapsulation of the BinaryData.

## 1.0.0-beta.2 (2021-04-06)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public AttestationClient(System.Uri endpoint, Azure.Core.TokenCredential credent
public virtual System.Threading.Tasks.Task<Azure.Security.Attestation.AttestationResponse<Azure.Security.Attestation.AttestationResult>> AttestOpenEnclaveAsync(Azure.Security.Attestation.AttestationRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Security.Attestation.AttestationResponse<Azure.Security.Attestation.AttestationResult> AttestSgxEnclave(Azure.Security.Attestation.AttestationRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Security.Attestation.AttestationResponse<Azure.Security.Attestation.AttestationResult>> AttestSgxEnclaveAsync(Azure.Security.Attestation.AttestationRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<System.BinaryData> AttestTpm(System.BinaryData request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<System.BinaryData>> AttestTpmAsync(System.BinaryData request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Security.Attestation.TpmAttestationResponse> AttestTpm(Azure.Security.Attestation.TpmAttestationRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Security.Attestation.TpmAttestationResponse>> AttestTpmAsync(Azure.Security.Attestation.TpmAttestationRequest request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Security.Attestation.AttestationSigner>> GetSigningCertificates(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Security.Attestation.AttestationSigner>>> GetSigningCertificatesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
Expand Down Expand Up @@ -277,4 +277,14 @@ public partial class StoredAttestationPolicy
public StoredAttestationPolicy() { }
public string AttestationPolicy { get { throw null; } set { } }
}
public partial class TpmAttestationRequest
{
public TpmAttestationRequest() { }
public System.BinaryData Data { get { throw null; } set { } }
}
public partial class TpmAttestationResponse
{
internal TpmAttestationResponse() { }
public System.BinaryData Data { get { throw null; } }
}
}
28 changes: 10 additions & 18 deletions sdk/attestation/Azure.Security.Attestation/src/AttestationClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,23 +273,19 @@ private async Task<AttestationResponse<AttestationResult>> AttestOpenEnclaveInte

/// <summary>
/// Attest a TPM based enclave.
/// See https://docs.microsoft.com/en-us/azure/attestation/virtualization-based-security-protocol for more information.
/// See <seealso href="https://docs.microsoft.com/en-us/azure/attestation/virtualization-based-security-protocol"/> for more information.
/// </summary>
/// <param name="request"></param>
/// <param name="request">TPM Attestation request.</param>
/// <param name="cancellationToken">Cancellation token used to cancel this operation.</param>
/// <returns>A <see cref="TpmAttestationResponse"/>.</returns>
public virtual Response<BinaryData> AttestTpm(BinaryData request, CancellationToken cancellationToken = default)
/// <returns>A <see cref="TpmAttestationResponse"/> containing the TPM attestation response.</returns>
public virtual Response<TpmAttestationResponse> AttestTpm(TpmAttestationRequest request, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(request, nameof(request));
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(AttestationClient)}.{nameof(AttestTpm)}");
scope.Start();
try
{
var response = _restClient.AttestTpm(new TpmAttestationRequest { Data = request.ToArray() }, cancellationToken);

BinaryData responseData = new BinaryData(response.Value);

return Response.FromValue(responseData, response.GetRawResponse());
return _restClient.AttestTpm(request, cancellationToken);
}
catch (Exception ex)
{
Expand All @@ -300,23 +296,19 @@ public virtual Response<BinaryData> AttestTpm(BinaryData request, CancellationTo

/// <summary>
/// Attest a TPM based enclave.
/// See https://docs.microsoft.com/en-us/azure/attestation/virtualization-based-security-protocol for more information.
/// See <seealso href="https://docs.microsoft.com/en-us/azure/attestation/virtualization-based-security-protocol"/> for more information.
/// </summary>
/// <param name="request">Incoming request to send to the TPM attestation service.</param>
/// <param name="request">TPM Attestation request.</param>
/// <param name="cancellationToken">Cancellation token used to cancel this operation.</param>
/// <returns>A <see cref="BinaryData"/> structure containing the value of <see cref="TpmAttestationResponse.Data"/>.</returns>
public virtual async Task<Response<BinaryData>> AttestTpmAsync(BinaryData request, CancellationToken cancellationToken = default)
/// <returns>A <see cref="TpmAttestationResponse"/> containing the TPM attestation response.</returns>
public virtual async Task<Response<TpmAttestationResponse>> AttestTpmAsync(TpmAttestationRequest request, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(request, nameof(request));
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(AttestationClient)}.{nameof(AttestTpm)}");
scope.Start();
try
{
var response = await _restClient.AttestTpmAsync(new TpmAttestationRequest { Data = request.ToArray() }, cancellationToken).ConfigureAwait(false);

BinaryData responseData = new BinaryData(response.Value.Data);

return Response.FromValue(responseData, response.GetRawResponse());
return await _restClient.AttestTpmAsync(request, cancellationToken).ConfigureAwait(false);
}
catch (Exception ex)
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9f4c8ce

Please sign in to comment.