Skip to content

Commit 6308a6a

Browse files
committed
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python into regenerate_keys
* 'master' of https://github.com/Azure/azure-sdk-for-python: Set http_logging_policy in Configuration (Azure#12218) Sync eng/common directory with azure-sdk-tools repository (Azure#11990) AzureCliCredential instructs CLI not to color output (Azure#11362) Sdk automation/track2 azure mgmt storage (Azure#12238) Fix changelog of CustomVision (Azure#12225) Doc update for conf file name (Azure#12224) update doc for content_type (Azure#12220) update API version to use 2020-06-30 (Azure#12208) Use MSAL's custom transport API (Azure#11892) add breadcumbs for training filter (Azure#12196) [formrecognizer] arch board feedback renames (Azure#12207) Dataplane autogeneration (Azure#12210) update version number and API_version support (Azure#12154) Update SECURITY.md (Azure#12209) adding a pip freeze to ensure we fully understand what our environment has (Azure#12173) FaceAPI 0.4.1 (Azure#12199) [ServiceBus] Enable Async Unittest (Azure#12001) add search owver (Azure#12190) update training docstring (Azure#12168)
2 parents c3a2d16 + de7168a commit 6308a6a

File tree

399 files changed

+5299
-5160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

399 files changed

+5299
-5160
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
/sdk/hdinsight/ @idear1203
3434
/sdk/machinelearningcompute/ @shutchings
3535
/sdk/recoveryservices/ @DheerendraRathor
36+
/sdk/search/ @xiangyan99
3637
/sdk/servicefabric/ @QingChenmsft @samedder
3738
/sql/sql/ @jaredmoo
3839
/sdk/servicebus/ @annatisch @yunhaoling @YijunXieMS @KieranBrantnerMagee

SECURITY.md

+37-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,41 @@
1-
# Security Policy
1+
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
22

3-
## Reporting a Vulnerability
3+
## Security
44

5-
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) <[email protected]>. 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](https://www.microsoft.com/msrc/faqs-report-an-issue).
5+
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
66

7-
Please do not open issues for anything you think might have a security implication.
7+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
88

9+
## Reporting Security Issues
10+
11+
**Please do not report security vulnerabilities through public GitHub issues.**
12+
13+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14+
15+
If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
16+
17+
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. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18+
19+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20+
21+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22+
* Full paths of source file(s) related to the manifestation of the issue
23+
* The location of the affected source code (tag/branch/commit or direct URL)
24+
* Any special configuration required to reproduce the issue
25+
* Step-by-step instructions to reproduce the issue
26+
* Proof-of-concept or exploit code (if possible)
27+
* Impact of the issue, including how an attacker might exploit the issue
28+
29+
This information will help us triage your report more quickly.
30+
31+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32+
33+
## Preferred Languages
34+
35+
We prefer all communications to be in English.
36+
37+
## Policy
38+
39+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
40+
41+
<!-- END MICROSOFT SECURITY.MD BLOCK -->

doc/dev/mgmt/mgmt_release.md

+16
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ Once you have a PR that contains accurate with correct tests (or no tests at all
1818

1919
IMPORTANT NOTE: All the commands in this page assumes you have loaded the [dev_setup](../dev_setup.md) in your currently loaded virtual environment.
2020

21+
## Manual generation
22+
23+
If the automation is not doing its job to create an auto PR, Python has a SwaggerToSdk CLI that can be used to generate a specific Readme. You need
24+
a virtual environment loaded with at least `tools/azure-sdk-tools` installed.
25+
26+
```shell
27+
# Using default configuration (this can be a Github raw link)
28+
generate_sdk -v -m ..\azure-rest-api-specs\specification\compute\resource-manager\readme.md
29+
30+
# Forcing Track1 generation
31+
generate_sdk -v -c eng\swagger_to_sdk_config_v4.json -m ..\azure-rest-api-specs\specification\cognitiveservices\data-plane\Face\readme.md
32+
33+
# For more details about the available options
34+
generate_sdk --help
35+
```
36+
2137
## Building the packaging information
2238

2339
If the automation is doing its job correctly, there is a pipeline called "update PR" that is supposed to update the package on the branch.

eng/common/TestResources/New-TestResources.ps1.md

+17
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,23 @@ Accept pipeline input: False
412412
Accept wildcard characters: False
413413
```
414414
415+
### -OutFile
416+
save test environment settings into a test-resources.json.env file next to test-resources.json.
417+
The file is protected via DPAPI. The environment file would be scoped to the current repository directory.
418+
Note: Supported only on Windows.
419+
420+
```yaml
421+
Type: SwitchParameter
422+
Parameter Sets: (All)
423+
Aliases:
424+
425+
Required: False
426+
Position: Named
427+
Default value: None
428+
Accept pipeline input: False
429+
Accept wildcard characters: False
430+
```
431+
415432
### CommonParameters
416433
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
417434

eng/common/TestResources/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ eng\common\TestResources\New-TestResources.ps1 `
3535
-TestApplicationSecret (ConvertFrom-SecureString $sp.Secret -AsPlainText)
3636
```
3737

38+
If you are running this for a .NET project on Windows, the recommended method is to
39+
add the `-OutFile` switch to the above command. This will save test environment settings
40+
into a test-resources.json.env file next to test-resources.json. The file is protected via DPAPI.
41+
The environment file would be scoped to the current repository directory and avoids the need to
42+
set environment variables or restart your IDE to recognize them.
43+
3844
Along with some log messages, this will output environment variables based on
3945
your current shell like in the following example:
4046

eng/common/pipelines/templates/steps/create-pull-request.yml

+24-20
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,31 @@ steps:
3535
workingDirectory: ${{ parameters.WorkingDirectory }}
3636
ignoreLASTEXITCODE: true
3737

38-
- pwsh: |
39-
${{ parameters.ScriptDirectory }}/git-branch-push.ps1 `
40-
-PRBranchName "${{ parameters.PRBranchName }}" `
41-
-CommitMsg "${{ parameters.CommitMsg }}" `
42-
-GitUrl "https://$(azuresdk-github-pat)@github.com/${{ parameters.PROwner }}/${{ parameters.RepoName }}.git" `
43-
-PushArgs "${{ parameters.PushArgs }}"
44-
38+
- task: PowerShell@2
4539
displayName: Push changes
46-
workingDirectory: ${{ parameters.WorkingDirectory }}
4740
condition: and(succeeded(), eq(variables['HasChanges'], 'true'))
41+
inputs:
42+
pwsh: true
43+
workingDirectory: ${{ parameters.WorkingDirectory }}
44+
filePath: ${{ parameters.ScriptDirectory }}/git-branch-push.ps1
45+
arguments: >
46+
-PRBranchName "${{ parameters.PRBranchName }}"
47+
-CommitMsg "${{ parameters.CommitMsg }}"
48+
-GitUrl "https://$(azuresdk-github-pat)@github.com/${{ parameters.PROwner }}/${{ parameters.RepoName }}.git"
49+
-PushArgs "${{ parameters.PushArgs }}"
4850
49-
- pwsh: |
50-
${{ parameters.ScriptDirectory }}/Submit-PullRequest.ps1 `
51-
-RepoOwner "${{ parameters.RepoOwner }}" `
52-
-RepoName "${{ parameters.RepoName }}" `
53-
-BaseBranch "${{ parameters.BaseBranchName }}" `
54-
-PROwner "${{ parameters.PROwner }}" `
55-
-PRBranch "${{ parameters.PRBranchName }}" `
56-
-AuthToken "$(azuresdk-github-pat)" `
57-
-PRTitle "${{ parameters.PRTitle }}"
58-
51+
- task: PowerShell@2
5952
displayName: Create pull request
60-
workingDirectory: ${{ parameters.WorkingDirectory }}
61-
condition: and(succeeded(), eq(variables['HasChanges'], 'true'))
53+
condition: and(succeeded(), eq(variables['HasChanges'], 'true'))
54+
inputs:
55+
pwsh: true
56+
workingDirectory: ${{ parameters.WorkingDirectory }}
57+
filePath: ${{ parameters.ScriptDirectory }}/Submit-PullRequest.ps1
58+
arguments: >
59+
-RepoOwner "${{ parameters.RepoOwner }}"
60+
-RepoName "${{ parameters.RepoName }}"
61+
-BaseBranch "${{ parameters.BaseBranchName }}"
62+
-PROwner "${{ parameters.PROwner }}"
63+
-PRBranch "${{ parameters.PRBranchName }}"
64+
-AuthToken "$(azuresdk-github-pat)"
65+
-PRTitle "${{ parameters.PRTitle }}"

eng/common/pipelines/templates/steps/create-tags-and-git-release.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ steps:
1010
- task: PowerShell@2
1111
displayName: 'Verify Package Tags and Create Git Releases'
1212
inputs:
13-
targetType: filePath
1413
filePath: ${{ parameters.ScriptDirectory }}/create-tags-and-git-release.ps1
15-
arguments: -artifactLocation ${{parameters.ArtifactLocation}} -packageRepository ${{parameters.PackageRepository}} -releaseSha ${{parameters.ReleaseSha}} -repoId ${{parameters.RepoId}} -workingDirectory '${{parameters.WorkingDirectory}}'
14+
arguments: >
15+
-artifactLocation ${{ parameters.ArtifactLocation }}
16+
-packageRepository ${{ parameters.PackageRepository }}
17+
-releaseSha ${{ parameters.ReleaseSha }}
18+
-repoId ${{ parameters.RepoId }}
19+
-workingDirectory '${{ parameters.WorkingDirectory }}'
1620
pwsh: true
1721
timeoutInMinutes: 5
1822
env:

eng/common/pipelines/templates/steps/docs-metadata-release.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ parameters:
1616
steps:
1717
- pwsh: |
1818
git clone https://github.com/${{ parameters.TargetDocRepoOwner }}/${{ parameters.TargetDocRepoName }} ${{ parameters.WorkingDirectory }}/repo
19-
19+
2020
try {
2121
Push-Location ${{ parameters.WorkingDirectory }}/repo
22-
22+
2323
Write-Host "git checkout smoke-test"
2424
git checkout smoke-test
2525
} finally {
@@ -33,14 +33,14 @@ steps:
3333
inputs:
3434
targetType: filePath
3535
filePath: ${{ parameters.ScriptDirectory }}/update-docs-metadata.ps1
36-
arguments: >
37-
-ArtifactLocation ${{parameters.ArtifactLocation}}
38-
-Repository ${{parameters.PackageRepository}}
39-
-ReleaseSHA ${{parameters.ReleaseSha}}
40-
-RepoId ${{parameters.RepoId}}
41-
-WorkDirectory '${{parameters.WorkingDirectory}}'
42-
-DocRepoLocation "${{parameters.WorkingDirectory}}/repo"
43-
-Language "${{parameters.Language}}"
36+
arguments: >
37+
-ArtifactLocation ${{ parameters.ArtifactLocation }}
38+
-Repository ${{ parameters.PackageRepository }}
39+
-ReleaseSHA ${{ parameters.ReleaseSha }}
40+
-RepoId ${{ parameters.RepoId }}
41+
-WorkDirectory "${{ parameters.WorkingDirectory }}"
42+
-DocRepoLocation "${{ parameters.WorkingDirectory }}/repo"
43+
-Language "${{parameters.Language}}"
4444
-DocRepoContentLocation ${{ parameters.DocRepoDestinationPath }}
4545
pwsh: true
4646
env:
@@ -54,5 +54,5 @@ steps:
5454
CommitMsg: "Update readme content for ${{ parameters.ArtifactName }}"
5555
PRTitle: "Docs.MS Readme Update."
5656
BaseBranchName: smoke-test
57-
WorkingDirectory: ${{parameters.WorkingDirectory}}/repo
58-
ScriptDirectory: ${{parameters.WorkingDirectory}}/${{parameters.ScriptDirectory}}
57+
WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo
58+
ScriptDirectory: ${{ parameters.WorkingDirectory }}/${{ parameters.ScriptDirectory }}

eng/common/pipelines/templates/steps/publish-blobs.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ parameters:
77

88
steps:
99
- pwsh: |
10-
Invoke-WebRequest -MaximumRetryCount 10 -Uri "https://aka.ms/downloadazcopy-v10-windows" `
11-
-OutFile "azcopy.zip" | Wait-Process; Expand-Archive -Path "azcopy.zip" -DestinationPath "$(Build.BinariesDirectory)/azcopy/"
10+
Invoke-WebRequest -MaximumRetryCount 10 -Uri "https://aka.ms/downloadazcopy-v10-windows" -OutFile "azcopy.zip" | Wait-Process;
11+
Expand-Archive -Path "azcopy.zip" -DestinationPath "$(Build.BinariesDirectory)/azcopy/"
1212
workingDirectory: $(Build.BinariesDirectory)
1313
displayName: Download and Extract azcopy Zip
1414

1515
- task: Powershell@2
1616
inputs:
17-
targetType: 'filePath'
1817
filePath: ${{ parameters.ScriptPath }}
19-
arguments: -AzCopy $(Resolve-Path "$(Build.BinariesDirectory)/azcopy/azcopy_windows_amd64_*/azcopy.exe")[0] -DocLocation "${{ parameters.FolderForUpload }}" -SASKey "${{ parameters.BlobSASKey }}" -Language "${{ parameters.TargetLanguage }}" -BlobName "${{ parameters.BlobName }}"
18+
arguments: >
19+
-AzCopy $(Resolve-Path "$(Build.BinariesDirectory)/azcopy/azcopy_windows_amd64_*/azcopy.exe")[0]
20+
-DocLocation "${{ parameters.FolderForUpload }}"
21+
-SASKey "${{ parameters.BlobSASKey }}"
22+
-Language "${{ parameters.TargetLanguage }}"
23+
-BlobName "${{ parameters.BlobName }}"
2024
pwsh: true
2125
workingDirectory: $(Pipeline.Workspace)
2226
displayName: Copy Docs to Blob

eng/common/pipelines/templates/steps/verify-agent-os.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Template for all Python Scripts in this repository
21
parameters:
32
OSVmImage: $(OSVmImage)
43

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
parameters:
2+
- name: PackageName
3+
type: string
4+
default: 'not-specified'
5+
- name: ServiceName
6+
type: string
7+
default: 'not-specified'
8+
- name: ForRelease
9+
type: boolean
10+
default: false
11+
12+
steps:
13+
- task: Powershell@2
14+
inputs:
15+
filePath: /eng/common/scripts/Verify-ChangeLog.ps1
16+
arguments: >
17+
-PackageName ${{ parameters.PackageName }}
18+
-ServiceName ${{ parameters.ServiceName }}
19+
-RepoRoot $(Build.SourcesDirectory)
20+
-RepoName $(Build.Repository.Name)
21+
-ForRelease ${{ parameters.ForRelease }}
22+
pwsh: true
23+
workingDirectory: $(Pipeline.Workspace)
24+
displayName: Verify ChangeLog / Release Notes
25+
continueOnError: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
parameters:
2+
Directory: 'not-specified'
3+
4+
steps:
5+
- task: PowerShell@2
6+
displayName: Link verification check
7+
inputs:
8+
pwsh: true
9+
workingDirectory: $(Build.SourcesDirectory)/${{ parameters.Directory }}
10+
filePath: eng/common/scripts/Verify-Links.ps1
11+
arguments: >
12+
-urls $(dir -r -i *.md) -rootUrl "file://$(Build.SourcesDirectory)/${{ parameters.Directory }}"

eng/common/scripts/Submit-PullRequest.ps1

+20-9
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,25 @@ param(
4141
$PRBody = $PRTitle
4242
)
4343

44-
Write-Host "> $PSCommandPath $args"
44+
$headers = @{
45+
Authorization = "bearer $AuthToken"
46+
}
4547

4648
$query = "state=open&head=${PROwner}:${PRBranch}&base=${BaseBranch}"
4749

48-
$resp = Invoke-RestMethod "https://api.github.com/repos/$RepoOwner/$RepoName/pulls?$query"
50+
try {
51+
$resp = Invoke-RestMethod -Headers $headers "https://api.github.com/repos/$RepoOwner/$RepoName/pulls?$query"
52+
}
53+
catch {
54+
Write-Error "Invoke-RestMethod [https://api.github.com/repos/$RepoOwner/$RepoName/pulls?$query] failed with exception:`n$_"
55+
exit 1
56+
}
4957
$resp | Write-Verbose
5058

5159
if ($resp.Count -gt 0) {
5260
Write-Host -f green "Pull request already exists $($resp[0].html_url)"
5361
}
5462
else {
55-
$headers = @{
56-
Authorization = "bearer $AuthToken"
57-
}
58-
5963
$data = @{
6064
title = $PRTitle
6165
head = "${PROwner}:${PRBranch}"
@@ -64,9 +68,16 @@ else {
6468
maintainer_can_modify = $true
6569
}
6670

67-
$resp = Invoke-RestMethod -Method POST -Headers $headers `
68-
https://api.github.com/repos/$RepoOwner/$RepoName/pulls `
69-
-Body ($data | ConvertTo-Json)
71+
try {
72+
$resp = Invoke-RestMethod -Method POST -Headers $headers `
73+
"https://api.github.com/repos/$RepoOwner/$RepoName/pulls" `
74+
-Body ($data | ConvertTo-Json)
75+
}
76+
catch {
77+
Write-Error "Invoke-RestMethod [https://api.github.com/repos/$RepoOwner/$RepoName/pulls] failed with exception:`n$_"
78+
exit 1
79+
}
80+
7081
$resp | Write-Verbose
7182
Write-Host -f green "Pull request created https://github.com/$RepoOwner/$RepoName/pull/$($resp.number)"
7283
}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Wrapper Script for ChangeLog Verification
2+
param (
3+
[Parameter(Mandatory=$true)]
4+
[string]$PackageName,
5+
[Parameter(Mandatory=$true)]
6+
[string]$ServiceName,
7+
[string]$RepoRoot,
8+
[ValidateSet("net","java","js","python")]
9+
[string]$Language,
10+
[string]$RepoName,
11+
[boolean]$ForRelease=$False
12+
)
13+
14+
Import-Module "${PSScriptRoot}/modules/common-manifest.psd1"
15+
16+
if ([System.String]::IsNullOrEmpty($Language))
17+
{
18+
$Language = $RepoName.Substring($RepoName.LastIndexOf('-') + 1)
19+
}
20+
21+
$PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceName $ServiceName -Language $Language -RepoRoot $RepoRoot
22+
Confirm-ChangeLog -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgReadMePath -ForRelease $ForRelease

0 commit comments

Comments
 (0)