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 Apr 12, 2021
2 parents 2c5398a + ef2ce3d commit d35c8b8
Show file tree
Hide file tree
Showing 885 changed files with 69,807 additions and 13,304 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
#/<NotInRepo>/ @swmachan

# PRLabel: %Cognitive - Translator
/sdk/documenttranslation/ @maririos
/sdk/translation/ @maririos

# ServiceLabel: %Cognitive - Speech %Service Attention
#/<NotInRepo>/ @robch @oscholz
Expand Down
6 changes: 5 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ Note: Only applies to `Microsoft.Azure.Management.[RP]` or `Azure.ResourceManage
- Do not modify any code in generated folders.
- Do not selectively include/remove generated files in the PR.
- Do use `generate.ps1/cmd` to generate this PR instead of calling `autorest` directly.
Please pay attention to the @microsoft.csharp version output after running generate.ps1. If it is lower than current released version (2.3.82), please run it again as it should pull down the latest version,
Please pay attention to the @microsoft.csharp version output after running `generate.ps1`. If it is lower than current released version (2.3.82), please run it again as it should pull down the latest version.

**Note: We have recently updated the PSH module called by `generate.ps1` to emit additional data. This would help reduce/eliminate the Code Verification check error. Please run following command**:

`dotnet msbuild eng/mgmt.proj /t:Util /p:UtilityName=InstallPsModules`

### Old outstanding PR cleanup
Please note:
Expand Down
1 change: 0 additions & 1 deletion .github/pull_request_assignment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
reviewers:
- allenjzhang
- YalinLi0312
- bquantump
- m-nash
- markcowl
- nisha-bhatia
Expand Down
2 changes: 2 additions & 0 deletions build.proj
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="Microsoft.Build.Traversal">
<Import Project="eng\mgmt\Directory.Build.Mgmt.props" />

<ItemGroup>
<ProjectReference Include="eng\mgmt.proj">
<AdditionalProperties Condition="'$(Scope)' != ''">Scope=$(Scope)</AdditionalProperties>
Expand Down
1 change: 1 addition & 0 deletions eng/.docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ known_content_issues:
- ['sdk/core/Microsoft.Azure.Core.Spatial/README.md', '#15423']
- ['sdk/core/Microsoft.Azure.Core.Spatial.NewtonsoftJson/README.md', '#15423']
- ['sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/README.md', '#15423']
- ['sdk/monitor/Azure.Monitory.Query/README.md', '#15423']

# .net climbs upwards. placing these to prevent assigning readmes to the wrong project
package_indexing_exclusion_list:
Expand Down
19 changes: 10 additions & 9 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,29 @@
<ItemGroup Condition="'$(IsClientLibrary)' == 'true'">

<!-- BCL packages -->
<PackageReference Update="System.Buffers" Version="4.5.0" />
<PackageReference Update="System.Memory" Version="4.5.3" />
<PackageReference Update="System.Memory.Data" Version="1.0.1" />
<PackageReference Update="System.Buffers" Version="4.5.1" />
<PackageReference Update="System.Memory" Version="4.5.4" />
<PackageReference Update="System.Memory.Data" Version="1.0.2" />
<PackageReference Update="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Update="System.Diagnostics.DiagnosticSource" Version="4.6.0" />
<PackageReference Update="System.Reflection.TypeExtensions" Version="4.5.1" />
<PackageReference Update="System.Threading.Tasks.Extensions" Version="4.5.2" />
<PackageReference Update="System.Threading.Channels" Version="4.6.0" />
<PackageReference Update="System.Security.Cryptography.ProtectedData" Version="4.5.0" />
<PackageReference Update="System.Text.Json" Version="4.6.0" />
<PackageReference Update="System.Text.Encodings.Web" Version="4.7.2" />
<PackageReference Update="System.ValueTuple" Version="4.5.0" />
<PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0" />
<PackageReference Update="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Update="System.Collections.Immutable" Version="1.3.1" />

<!-- Azure SDK packages -->
<PackageReference Update="Azure.Core" Version="1.12.0" />
<PackageReference Update="Azure.Core.Amqp" Version="1.0.0" />
<PackageReference Update="Azure.Core" Version="1.13.0" />
<PackageReference Update="Azure.Core.Amqp" Version="1.1.0-beta.1" Condition="'$(HasReleaseVersion)' == 'false'"/>
<PackageReference Update="Azure.Core.Experimental" Version="0.1.0-preview.10" />
<PackageReference Update="Azure.Messaging.EventHubs" Version="5.3.1" />
<PackageReference Update="Azure.Messaging.EventHubs" Version="5.4.0" />
<PackageReference Update="Azure.Messaging.EventGrid" Version="4.0.0" />
<PackageReference Update="Azure.Messaging.ServiceBus" Version="7.2.0-beta.1" />
<PackageReference Update="Azure.Messaging.ServiceBus" Version="7.2.0-beta.2" Condition="'$(HasReleaseVersion)' == 'false'"/>
<PackageReference Update="Azure.Identity" Version="1.2.1" />
<PackageReference Update="Azure.Security.KeyVault.Secrets" Version="4.0.2" />
<PackageReference Update="Azure.Security.KeyVault.Keys" Version="4.0.2" />
Expand All @@ -103,7 +104,7 @@
-->
<ItemGroup Condition="'$(IsClientLibrary)' == 'true' and $(MSBuildProjectName.StartsWith('Microsoft.'))">
<PackageReference Update="CloudNative.CloudEvents" Version="2.0.0-beta.1" />
<PackageReference Update="Microsoft.Azure.WebJobs" Version="3.0.25" />
<PackageReference Update="Microsoft.Azure.WebJobs" Version="3.0.27" />
<PackageReference Update="Microsoft.Azure.WebJobs.Sources" Version="3.0.19" />
<PackageReference Update="Microsoft.Spatial" Version="7.5.3" />
<PackageReference Update="Newtonsoft.Json" Version="10.0.3" />
Expand All @@ -127,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.20210402.1" PrivateAssets="All" />
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20210405.2" 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 Down
6 changes: 3 additions & 3 deletions eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ try {
if ($currentSubcriptionId -ne $SubscriptionId) {
Log "Selecting subscription '$SubscriptionId'"
$null = Select-AzSubscription -Subscription $SubscriptionId

$exitActions += {
Log "Selecting previous subscription '$currentSubcriptionId'"
$null = Select-AzSubscription -Subscription $currentSubcriptionId
}

# Update the context.
$context = Get-AzContext
}
Expand Down Expand Up @@ -459,7 +459,7 @@ try {
if ($CI) {
$DebugPreference = 'Continue'
}
New-AzResourceGroupDeployment -Name $BaseName -ResourceGroupName $resourceGroup.ResourceGroupName -TemplateFile $templateFile -TemplateParameterObject $templateFileParameters -Mode Complete -Force:$Force
New-AzResourceGroupDeployment -Name $BaseName -ResourceGroupName $resourceGroup.ResourceGroupName -TemplateFile $templateFile -TemplateParameterObject $templateFileParameters -Force:$Force
} catch {
Write-Output @'
#####################################################
Expand Down
25 changes: 12 additions & 13 deletions eng/common/TestResources/Remove-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ param (
[Parameter(ParameterSetName = 'Default+Provisioner', Mandatory = $true)]
[Parameter(ParameterSetName = 'ResourceGroup+Provisioner', Mandatory = $true)]
[string] $ProvisionerApplicationSecret,
[Parameter(ParameterSetName = 'Default', Mandatory = $true, Position = 0)]

[Parameter(ParameterSetName = 'Default', Position = 0)]
[Parameter(ParameterSetName = 'Default+Provisioner')]
[Parameter(ParameterSetName = 'ResourceGroup')]
[Parameter(ParameterSetName = 'ResourceGroup+Provisioner')]
Expand Down Expand Up @@ -122,18 +122,17 @@ if ($ProvisionerApplicationId) {

$context = Get-AzContext

# Make sure $BaseName is set.
if (!$BaseName) {

$UserName = if ($env:USER) { $env:USER } else { "${env:USERNAME}" }
# Remove spaces, etc. that may be in $UserName
$UserName = $UserName -replace '\W'

$BaseName = "$UserName$ServiceDirectory"
Log "BaseName was not set. Using default base name '$BaseName'"
}

if (!$ResourceGroupName) {
# Make sure $BaseName is set.
if (!$BaseName) {
$UserName = if ($env:USER) { $env:USER } else { "${env:USERNAME}" }
# Remove spaces, etc. that may be in $UserName
$UserName = $UserName -replace '\W'

$BaseName = "$UserName$ServiceDirectory"
Log "BaseName was not set. Using default base name '$BaseName'"
}

# Format the resource group name like in New-TestResources.ps1.
$ResourceGroupName = "rg-$BaseName"
}
Expand Down
22 changes: 11 additions & 11 deletions eng/common/TestResources/Update-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

[CmdletBinding(DefaultParameterSetName = 'Default')]
param (
[Parameter(ParameterSetName = 'Default', Mandatory = $true, Position = 0)]
[Parameter(ParameterSetName = 'Default', Position = 0)]
[string] $ServiceDirectory,

[Parameter(ParameterSetName = 'Default')]
Expand Down Expand Up @@ -67,18 +67,18 @@ $exitActions = @({
}
})

# Make sure $BaseName is set.
if (!$BaseName) {
$UserName = if ($env:USER) { $env:USER } else { "${env:USERNAME}" }
# Remove spaces, etc. that may be in $UserName
$UserName = $UserName -replace '\W'

$BaseName = "$UserName$ServiceDirectory"
Log "BaseName was not set. Using default base name '$BaseName'"
}

# Make sure $ResourceGroupName is set.
if (!$ResourceGroupName) {
# Make sure $BaseName is set.
if (!$BaseName) {
$UserName = if ($env:USER) { $env:USER } else { "${env:USERNAME}" }
# Remove spaces, etc. that may be in $UserName
$UserName = $UserName -replace '\W'

$BaseName = "$UserName$ServiceDirectory"
Log "BaseName was not set. Using default base name '$BaseName'"
}

$ResourceGroupName = "rg-$BaseName"
}

Expand Down
21 changes: 21 additions & 0 deletions eng/common/pipelines/templates/steps/retain-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
parameters:
- name: DaysValid
default: 365
type: number

steps:
- task: PowerShell@2
displayName: Retain pipeline run
condition: ${{ parameters.Condition }}
inputs:
pwsh: true
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Add-RetentionLease.ps1
arguments: >
-Organization azure-sdk
-Project $(System.TeamProject)
-DefinitionId $(System.DefinitionId)
-RunId $(Build.BuildId)
-OwnerId Pipeline
-DaysValid ${{parameters.DaysValid}}
-Base64EncodedAuthToken $(System.AccessToken)
-Debug
42 changes: 42 additions & 0 deletions eng/common/scripts/Add-RetentionLease.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[CmdletBinding(SupportsShouldProcess = $true)]
param(
[Parameter(Mandatory = $true)]
[string]$Organization,

[Parameter(Mandatory = $true)]
[string]$Project,

[Parameter(Mandatory = $true)]
[int]$DefinitionId,

[Parameter(Mandatory = $true)]
[int]$RunId,

[Parameter(Mandatory = $true)]
[string]$OwnerId,

[Parameter(Mandatory = $true)]
[int]$DaysValid,

[Parameter(Mandatory = $true)]
[string]$Base64EncodedAuthToken
)

. (Join-Path $PSScriptRoot common.ps1)

LogDebug "Checking for existing leases on run: $RunId"
$existingLeases = Get-RetentionLeases -Organization $Organization -Project $Project -DefinitionId $DefinitionId -RunId $RunId -OwnerId $OwnerId -Base64EncodedAuthToken $Base64EncodedAuthToken

if ($existingLeases.count -ne 0) {
LogDebug "Found $($existingLeases.count) leases, will delete them first."

foreach ($lease in $existingLeases.value) {
LogDebug "Deleting lease: $($lease.leaseId)"
Delete-RetentionLease -Organization $Organization -Project $Project -LeaseId $lease.leaseId -Base64EncodedAuthToken $Base64EncodedAuthToken
}

}

LogDebug "Creating new lease on run: $RunId"
$lease = Add-RetentionLease -Organization $Organization -Project $Project -DefinitionId $DefinitionId -RunId $RunId -OwnerId $OwnerId -DaysValid $DaysValid -Base64EncodedAuthToken $Base64EncodedAuthToken
LogDebug "Lease ID is: $($lease.value.leaseId)"
68 changes: 68 additions & 0 deletions eng/common/scripts/Invoke-DevOpsAPI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,71 @@ function Get-DevOpsBuilds {
-Headers (Get-DevOpsApiHeaders -Base64EncodedToken $Base64EncodedAuthToken) `
-MaximumRetryCount 3
}

function Delete-RetentionLease {
param (
$Organization,
$Project,
$LeaseId,
$Base64EncodedAuthToken
)

$uri = "https://dev.azure.com/$Organization/$Project/_apis/build/retention/leases?ids=$LeaseId&api-version=6.0-preview.1"

return Invoke-RestMethod `
-Method DELETE `
-Uri $uri `
-Headers (Get-DevOpsApiHeaders -Base64EncodedToken $Base64EncodedAuthToken) `
-MaximumRetryCount 3
}

function Get-RetentionLeases {
param (
$Organization,
$Project,
$DefinitionId,
$RunId,
$OwnerId,
$Base64EncodedAuthToken
)

$uri = "https://dev.azure.com/$Organization/$Project/_apis/build/retention/leases?ownerId=$OwnerId&definitionId=$DefinitionId&runId=$RunId&api-version=6.0-preview.1"

return Invoke-RestMethod `
-Method GET `
-Uri $uri `
-Headers (Get-DevOpsApiHeaders -Base64EncodedToken $Base64EncodedAuthToken) `
-MaximumRetryCount 3
}

function Add-RetentionLease {
param (
$Organization,
$Project,
$DefinitionId,
$RunId,
$OwnerId,
$DaysValid,
$Base64AuthToken
)

$parameter = @{}
$parameter["definitionId"] = $DefinitionId
$parameter["runId"] = $RunId
$parameter["ownerId"] = $OwnerId
$parameter["daysValid"] = $DaysValid


$body = $parameter | ConvertTo-Json

$uri = "https://dev.azure.com/$Organization/$Project/_apis/build/retention/leases?api-version=6.0-preview.1"

return Invoke-RestMethod `
-Method POST `
-Body "[$body]" `
-Uri $uri `
-Headers (Get-DevOpsApiHeaders -Base64EncodedToken $Base64EncodedAuthToken) `
-MaximumRetryCount 3 `
-ContentType "application/json"

}
4 changes: 2 additions & 2 deletions eng/mgmt/mgmtmetadata/datafactory_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/datafactory/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-2018-06 --csharp-sdks-folder=D:\Projects\azure-sdk-for-net\sdk
2021-03-31 09:24:13 UTC
2021-04-01 08:12:55 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 8e8cb6958f75504ec011a1e57f54b7e73d059531
Commit: 467bc839e205459f530f4b33e08e57882734a8f5
AutoRest information
Requested version: v2
Bootstrapper version: autorest@2.0.4413
14 changes: 14 additions & 0 deletions eng/mgmt/mgmtmetadata/elastic_resource-manager.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Installing AutoRest version: v2
AutoRest installed successfully.
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/elastic/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\Users\vakuncha\source\repos\azure-sdk-for-net\sdk
2021-04-07 06:32:51 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 9fbd9c69e95c30c0805b34d8b6e23a385dc0d6cc
AutoRest information
Requested version: v2
Bootstrapper version: autorest@2.0.4413
14 changes: 14 additions & 0 deletions eng/mgmt/mgmtmetadata/logz_resource-manager.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Installing AutoRest version: v2
AutoRest installed successfully.
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/logz/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\Users\vakuncha\source\repos\azure-sdk-for-net\sdk
2021-04-08 05:03:54 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 99651319107286b850b2b938dc47b2e30c76fca6
AutoRest information
Requested version: v2
Bootstrapper version: autorest@2.0.4413
4 changes: 2 additions & 2 deletions eng/mgmt/mgmtmetadata/synapse_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/synapse/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\code\AzureSDK\azure-sdk-for-net\sdk
2021-01-28 11:11:23 UTC
2021-03-30 07:43:41 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: b6e82da5d8db8b2fb86cc774763c3594cf342918
Commit: 169c6171bad2f782dc1cd5f23bcb803ce7649b0b
AutoRest information
Requested version: v2
Bootstrapper version: autorest@2.0.4413
Loading

0 comments on commit d35c8b8

Please sign in to comment.