Skip to content

Commit 40ae41c

Browse files
committed
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python into add_back_pii
* 'master' of https://github.com/Azure/azure-sdk-for-python: (40 commits) [text analytics] generate multiapi client, made v3.1-preview.1 default version (Azure#12720) Prevent AttributeError during get_certificate_version (Azure#12747) re-apply updates after resetting master (Azure#12771) Sync eng/common directory with azure-sdk-tools repository (Azure#12745) Enable bandit for servicebus (Azure#12763) Skip pypy3 for service bus CI pipeline (Azure#12732) Update CODEOWNERS (Azure#12765) updated tox file (Azure#11087) Updating to match Microsoft recommended template (Azure#11045) [text analytics] update version in master (Azure#12749) Explicitly stringify message prints in samples per manual doc pass recommendation. (Azure#12709) Run only analyse dependency step for aggregate report (Azure#12728) VSCodeCredential supports Python 2.7 on Windows (Azure#12731) Enable bandit (Azure#12722) Move InteractiveCredential to a new module (Azure#12706) Add foundations for eng/common restructure (Azure#12725) Sync eng/common directory with azure-sdk-tools repository (Azure#12730) fix flaky test (Azure#12721) python link verification (Azure#12543) [ServiceBus] Remove legacy control client (Azure#12644) ...
2 parents fa34686 + 7823466 commit 40ae41c

File tree

829 files changed

+15074
-20955
lines changed

Some content is hidden

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

829 files changed

+15074
-20955
lines changed

.github/CODEOWNERS

+51-4
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,83 @@
99
/sdk/ @mayurid @lmazuel
1010

1111
# Core
12+
# PRLabel: %Azure.Core
1213
/sdk/core/ @lmazuel @xiangyan99 @johanste @rakshith91
1314
/sdk/core/azure-core/ @xiangyan99 @lmazuel
1415

16+
####
1517
# Service team
18+
####
19+
# PRLabel: %Azure.Identity
1620
/sdk/identity/ @chlowell @schaabs
21+
22+
# PRLabel: %Event Hubs
1723
/sdk/eventhub/ @annatisch @yunhaoling @YijunXieMS
18-
/sdk/storage/ @amishra-dev @zezha-msft @annatisch @rakshith91 @xiafu-msft
19-
/sdk/applicationinsights/ @alexeldeib
24+
25+
# PRLabel: %Storage
26+
/sdk/storage/ @amishra-dev @zezha-msft @annatisch @rakshith91 @xiafu-msft @kasobol-msft
27+
28+
/sdk/applicationinsights/ @alexeldeib
29+
30+
# PRLabel: %Batch
2031
/sdk/batch/ @bgklein @xingwu1
21-
/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/ @areddish
32+
/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/ @areddish
33+
34+
# PRLabel: %KeyVault
2235
/sdk/keyvault/ @schaabs @chlowell @iscai-msft
36+
37+
# PRLabel: %Monitor - LogAnalytics
2338
/sdk/loganalytics/ @alexeldeib
39+
40+
# PRLabel: %Consumption
2441
/sdk/consumption/ @sandeepnl
42+
43+
# PRLabel: %Container Instances
2544
/sdk/containerinstance/ @samkreter @xizhamsft
45+
46+
# PRLabel: %Container Registry
2647
/sdk/containerregistry/ @djyou
2748
/sdk/containerservice/ @samkreter @zqingqing1 @GaneshaThirumurthi
49+
50+
# PRLabel: %Cosmos
2851
/sdk/cosmos/ @southpolesteve @zfoster
52+
53+
# PRLabel: %Data Factory
2954
/sdk/datafactory/ @hvermis
30-
/sdk/datalake/ @ro-joowan
55+
/sdk/datalake/ @ro-joowan
3156
/sdk/datadatamigration/ @vchske
57+
58+
# PRLabel: %Event Grid
3259
/sdk/eventgrid/ @kalyanaj
60+
61+
# PRLabel: %HDInsight
3362
/sdk/hdinsight/ @idear1203
63+
64+
# PRLabel: %Machine Learning Compute
3465
/sdk/machinelearningcompute/ @shutchings
66+
67+
# PRLabel: %Recovery Services
3568
/sdk/recoveryservices/ @DheerendraRathor
69+
70+
# PRLabel: %Search
3671
/sdk/search/ @xiangyan99 @rakshith91
72+
73+
# PRLabel: %Service Fabric
3774
/sdk/servicefabric/ @QingChenmsft @samedder
75+
76+
# PRLabel: %SQL
3877
/sql/sql/ @jaredmoo
78+
79+
# PRLabel: %Service Bus
3980
/sdk/servicebus/ @annatisch @yunhaoling @YijunXieMS @KieranBrantnerMagee
81+
82+
# PRLabel: %Synapse
4083
/sdk/synapse/ @aim-for-better @idear1203
84+
85+
# PRLabel: %Cognitive - Text Analytics
4186
/sdk/textanalytics/ @kristapratico @iscai-msft
87+
88+
# PRLabel: %Cognitive - Form Recognizer
4289
/sdk/formrecognizer/ @kristapratico @iscai-msft @rakshith91
4390

4491
# Smoke Tests

NOTICE.txt

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1-
This file list any third-party libraries or other resources that may be
2-
distributed under licenses different than the Azure SDK for Python software.
1+
NOTICES AND INFORMATION
2+
Do Not Translate or Localize
33

4-
In the event that we accidentally failed to list a required notice, please
5-
bring it to our attention by opening an issue.
4+
This software incorporates material from third parties. Microsoft makes certain
5+
open source code available at https://3rdpartysource.microsoft.com, or you may
6+
send a check or money order for US $5.00, including the product name, the open
7+
source component name, and version number, to:
68

7-
The attached notices are provided for information only.
9+
Source Code Compliance Team
10+
Microsoft Corporation
11+
One Microsoft Way
12+
Redmond, WA 98052
13+
USA
14+
15+
Notwithstanding any other terms, you may reverse engineer this software to the
16+
extent required to debug changes to any libraries licensed under the GNU Lesser
17+
General Public License.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Management libraries can be identified by namespaces that start with `azure-mgmt
4747
## Need help?
4848

4949
* For detailed documentation visit our [Azure SDK for Python documentation](https://aka.ms/python-docs)
50-
* File an issue via [Github Issues](../../issues)
50+
* File an issue via [Github Issues](https://github.com/Azure/azure-sdk-for-python/issues)
5151
* Check [previous questions](https://stackoverflow.com/questions/tagged/azure+python) or ask new ones on StackOverflow using `azure` and `python` tags.
5252

5353
### Community

doc/dev/mgmt/swagger/multi_api/readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This is the AutoRest configuration file for Network.
88

99
## Getting Started
1010

11-
To build the SDK for Network, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run:
11+
To build the SDK for Network, simply [Install AutoRest](https://github.com/Azure/autorest/blob/master/docs/installing-autorest.md) and in this folder, run:
1212

1313
> `autorest`
1414
@@ -66,4 +66,4 @@ swagger-to-sdk:
6666

6767
## Python
6868

69-
See configuration in [readme.python.md](./readme.python.md)
69+
See configuration in [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/master/doc/dev/mgmt/swagger/multi_api/readme.python.md)

doc/dev/mgmt/swagger/single_api/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This is the AutoRest configuration file for Cdn.
88

99
---
1010
## Getting Started
11-
To build the SDK for Cdn, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run:
11+
To build the SDK for Cdn, simply [Install AutoRest](https://github.com/Azure/autorest/blob/master/docs/installing-autorest.md) and in this folder, run:
1212

1313
> `autorest`
1414

doc/dev/mgmt/swagger_conf.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,38 @@ Writing the readme is the responsibility of the Python SDK team. There is curren
1818
- Readme that handles only one API version, and generates packages that handle one API version only
1919
- Readme that handles several API versions, and generates packages with multiples API and profile supports
2020

21-
These templates can be found in the [single_api](./single_api) and the [multi_api](./multi_api) folders.
21+
These templates can be found in the [single_api](https://github.com/Azure/azure-sdk-for-python/blob/master/doc/dev/mgmt/swagger/single_api) and the [multi_api](https://github.com/Azure/azure-sdk-for-python/blob/master/doc/dev/mgmt/swagger/multi_api) folders.
2222

2323

2424
### Single API readmes
2525

2626
This one is the most simple:
27-
- Copy the [readme.python.md](./single_api/readme.python.md) and replace `servicetoreplace` by your service name
28-
- Be sure the main [readme.md](./single_api/readme.md) contains a "swagger-to-sdk" section with Python
27+
- Copy the [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/master/doc/dev/mgmt/swagger/single_api/readme.python.md) and replace `servicetoreplace` by your service name
28+
- Be sure the main [readme.md](https://github.com/Azure/azure-sdk-for-python/blob/master/doc/dev/mgmt/swagger/single_api/readme.md) contains a "swagger-to-sdk" section with Python
2929

3030
### Multi API readmes
3131

32-
When doing multi-api packages, it means you have shipping several "tags" of the main readme as one package. Autorest is calling this process a "batch" call, and this is the purpose of the "batch" section in [readme.python.md](./multi_api/readme.python.md).
32+
When doing multi-api packages, it means you have shipping several "tags" of the main readme as one package. Autorest is calling this process a "batch" call, and this is the purpose of the "batch" section in [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/master/doc/dev/mgmt/swagger/multi_api/readme.python.md).
3333

3434
In order to be sure the correct tags exist, you can use the following script:
3535
```shell
3636
python ./scripts/multi_api_readme_help.py /azure-rest-api-specs/specification/service/resource-manager/
3737
```
3838

3939
This script will analyze the Swaggers available, and suggests on stdout:
40-
- A list of tags for the main [readme.md](./multi_api/readme.md)
41-
- A batch declaration for the [readme.python.md](./multi_api/readme.python.md)
40+
- A list of tags for the main [readme.md](https://github.com/Azure/azure-sdk-for-python/blob/master/doc/dev/mgmt/swagger/multi_api/readme.md)
41+
- A batch declaration for the [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/master/doc/dev/mgmt/swagger/multi_api/readme.python.md)
4242

4343
This script is not perfect that it *does* require manual review of the output and not a direct copy/paste.
4444

4545
It's important for Python that tags represents only *ONE* unique API version. It's why it's pretty common that Python uses a set of tags that other languages don't use.
4646

4747
Once you know the list of tags you need to generate:
4848

49-
- Copy the [readme.python.md](./multi_api/readme.python.md) and replace `servicetoreplace` by your service name
50-
- Update the batch list of [readme.python.md](./multi_api/readme.python.md)
51-
- Be sure you have one tag section for each batch entry in [readme.python.md](./multi_api/readme.python.md)
52-
- Be sure the main [readme.md](./multi_api/readme.md) contains a "swagger-to-sdk" section with Python with an `afterscripts` section like the one in the template.
49+
- Copy the [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/master/doc/dev/mgmt/swagger/multi_api/readme.python.md) and replace `servicetoreplace` by your service name
50+
- Update the batch list of [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/master/doc/dev/mgmt/swagger/multi_api/readme.python.md)
51+
- Be sure you have one tag section for each batch entry in [readme.python.md](https://github.com/Azure/azure-sdk-for-python/blob/master/doc/dev/mgmt/swagger/multi_api/readme.python.md)
52+
- Be sure the main [readme.md](https://github.com/Azure/azure-sdk-for-python/blob/master/doc/dev/mgmt/swagger/multi_api/readme.md) contains a "swagger-to-sdk" section with Python with an `afterscripts` section like the one in the template.
5353

5454
The `afterscripts` will execute a Jinja template to create a client to link together all the batch generated autorest ([example](https://github.com/Azure/azure-sdk-for-python/blob/4a7c67189591b052fe2b5769847ff68f7845386d/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py))
5555

eng/common/TestResources/New-TestResources.ps1

+20-4
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,21 @@ if ($ProvisionerApplicationId) {
154154
$subscriptionArgs = if ($SubscriptionId) {
155155
@{SubscriptionId = $SubscriptionId}
156156
}
157+
else {
158+
@{}
159+
}
157160

158161
$provisionerAccount = Retry {
159162
Connect-AzAccount -Force:$Force -Tenant $TenantId -Credential $provisionerCredential -ServicePrincipal -Environment $Environment @subscriptionArgs
160163
}
161164

162165
$exitActions += {
163166
Write-Verbose "Logging out of service principal '$($provisionerAccount.Context.Account)'"
164-
$null = Disconnect-AzAccount -AzureContext $provisionerAccount.Context
167+
168+
# Only attempt to disconnect if the -WhatIf flag was not set. Otherwise, this call is not necessary and will fail.
169+
if ($PSCmdlet.ShouldProcess($ProvisionerApplicationId)) {
170+
$null = Disconnect-AzAccount -AzureContext $provisionerAccount.Context
171+
}
165172
}
166173
}
167174

@@ -176,7 +183,6 @@ if ($TestApplicationId -and !$TestApplicationOid) {
176183
}
177184
}
178185

179-
180186
# If the ServiceDirectory is an absolute path use the last directory name
181187
# (e.g. D:\foo\bar\ -> bar)
182188
$serviceName = if (Split-Path -IsAbsolute $ServiceDirectory) {
@@ -229,6 +235,13 @@ if ($resourceGroup.ProvisioningState -eq 'Succeeded') {
229235
# New-AzResourceGroup would've written an error and stopped the pipeline by default anyway.
230236
Write-Verbose "Successfully created resource group '$($resourceGroup.ResourceGroupName)'"
231237
}
238+
elseif (($resourceGroup -eq $null) -and (-not $PSCmdlet.ShouldProcess($resourceGroupName))) {
239+
# If the -WhatIf flag was passed, there will be no resource group created. Fake it.
240+
$resourceGroup = [PSCustomObject]@{
241+
ResourceGroupName = $resourceGroupName
242+
Location = $Location
243+
}
244+
}
232245

233246
# Populate the template parameters and merge any additional specified.
234247
$templateParameters = @{
@@ -299,6 +312,9 @@ foreach ($templateFile in $templateFiles) {
299312
"$($serviceDirectoryPrefix)RESOURCE_GROUP" = $resourceGroup.ResourceGroupName;
300313
"$($serviceDirectoryPrefix)LOCATION" = $resourceGroup.Location;
301314
"$($serviceDirectoryPrefix)ENVIRONMENT" = $context.Environment.Name;
315+
"$($serviceDirectoryPrefix)AZURE_AUTHORITY_HOST" = $context.Environment.ActiveDirectoryAuthority;
316+
"$($serviceDirectoryPrefix)RESOURCE_MANAGER_URL" = $context.Environment.ResourceManagerUrl;
317+
"$($serviceDirectoryPrefix)SERVICE_MANAGEMENT_URL" = $context.Environment.ServiceManagementUrl;
302318
}
303319

304320
foreach ($key in $deployment.Outputs.Keys) {
@@ -331,7 +347,7 @@ foreach ($templateFile in $templateFiles) {
331347
}
332348
else
333349
{
334-
350+
335351
if (!$CI) {
336352
# Write an extra new line to isolate the environment variables for easy reading.
337353
Log "Persist the following environment variables based on your detected shell ($shell):`n"
@@ -340,7 +356,7 @@ foreach ($templateFile in $templateFiles) {
340356
foreach ($key in $deploymentOutputs.Keys)
341357
{
342358
$value = $deploymentOutputs[$key]
343-
359+
344360
if ($CI) {
345361
# Treat all ARM template output variables as secrets since "SecureString" variables do not set values.
346362
# In order to mask secrets but set environment variables for any given ARM template, we set variables twice as shown below.

eng/common/TestResources/deploy-test-resources.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ parameters:
1313
# "TestApplicationId": "<test app id>",
1414
# "TestApplicationSecret": "<test app secret>",
1515
# "ProvisionerApplicationId": "<provisoner app id>",
16-
# "ProvisoinerApplicationSecret": "<provisoner app secert>",
16+
# "ProvisionerApplicationSecret": "<provisoner app secert>",
1717
# "Environment": "AzureCloud | AzureGov | AzureChina | <other environment>"
1818
# }
1919

eng/common/TestResources/remove-test-resources.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ steps:
3232
-Force `
3333
-Verbose
3434
displayName: Remove test resources
35-
condition: and(ne(variables['AZURE_RESOURCEGROUP_NAME'], ''), succeededOrFailed())
35+
condition: ne(variables['AZURE_RESOURCEGROUP_NAME'], '')
3636
continueOnError: true

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

+17
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ parameters:
1212
WorkingDirectory: $(System.DefaultWorkingDirectory)
1313
PRTitle: not-specified
1414
ScriptDirectory: eng/common/scripts
15+
GHReviewersVariable: ''
16+
GHTeamReviewersVariable: ''
1517

1618
steps:
1719

@@ -63,3 +65,18 @@ steps:
6365
-PRBranch "${{ parameters.PRBranchName }}"
6466
-AuthToken "$(azuresdk-github-pat)"
6567
-PRTitle "${{ parameters.PRTitle }}"
68+
69+
- task: PowerShell@2
70+
displayName: Tag a Reviewer on PR
71+
condition: and(succeeded(), eq(variables['HasChanges'], 'true'))
72+
inputs:
73+
pwsh: true
74+
workingDirectory: ${{ parameters.WorkingDirectory }}
75+
filePath: ${{ parameters.ScriptDirectory }}/add-pullrequest-reviewers.ps1
76+
arguments: >
77+
-RepoOwner "${{ parameters.RepoOwner }}"
78+
-RepoName "${{ parameters.RepoName }}"
79+
-AuthToken "$(azuresdk-github-pat)"
80+
-GitHubUsers "$(${{ parameters.GHReviewersVariable }})"
81+
-GitHubTeams "$(${{ parameters.GHTeamReviewersVariable }})"
82+
-PRNumber "$(Submitted.PullRequest.Number)"

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

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ parameters:
1212
ArtifactName: ''
1313
Language: ''
1414
DocRepoDestinationPath: '' #usually docs-ref-services/
15+
GHReviewersVariable: ''
16+
GHTeamReviewersVariable: '' # externally set, as eng-common does not have the identity-resolver. Run as pre-step
1517

1618
steps:
1719
- pwsh: |
@@ -56,3 +58,5 @@ steps:
5658
BaseBranchName: smoke-test
5759
WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo
5860
ScriptDirectory: ${{ parameters.WorkingDirectory }}/${{ parameters.ScriptDirectory }}
61+
GHReviewersVariable: ${{ parameters.GHReviewersVariable }}
62+
GHTeamReviewersVariable: ${{ parameters.GHTeamReviewersVariable }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
parameters:
2+
TargetVariable: ''
3+
ServiceDirectory: ''
4+
5+
steps:
6+
- pwsh: |
7+
git clone https://github.com/Azure/azure-sdk-tools.git $(Build.SourcesDirectory)/tools_repo
8+
cd $(Build.SourcesDirectory)/tools_repo
9+
git checkout 564ad63ae72d18422533fa1da9d396e7703c1cb5
10+
displayName: Setup Identity Resolver
11+
12+
- pwsh: |
13+
$result = dotnet run -v q -- `
14+
--aad-app-id-var APP_ID `
15+
--aad-app-secret-var APP_SECRET `
16+
--aad-tenant-var AAD_TENANT `
17+
--kusto-url-var KUSTO_URL `
18+
--kusto-database-var KUSTO_DB `
19+
--kusto-table-var KUSTO_TABLE `
20+
--identity "$(Build.QueuedBy)"
21+
$resolvedIdentity = $result[-1] | ConvertFrom-Json
22+
23+
Write-Host $resolvedIdentity
24+
25+
Write-Output "##vso[task.setvariable variable=${{ parameters.TargetVariable }}]$($resolvedIdentity.GithubUserName)"
26+
displayName: 'Resolving Queuing User'
27+
workingDirectory: $(Build.SourcesDirectory)/tools_repo/tools/notification-configuration/identity-resolver
28+
env:
29+
APP_ID: $(notification-aad-app-id)
30+
APP_SECRET: $(notification-aad-secret)
31+
AAD_TENANT: $(notification-aad-tenant)
32+
KUSTO_URL: $(notification-kusto-url)
33+
KUSTO_DB: $(notification-kusto-db)
34+
KUSTO_TABLE: $(notification-kusto-table)
35+
36+
- pwsh: |
37+
Remove-Item -Force -Recurse $(Build.SourcesDirectory)/tools_repo
38+
displayName: Clean Up Cloned Tools Repo
39+
40+
- pwsh: |
41+
$originalValue = "$(${{ parameters.TargetVariable }})"
42+
$result = $(Build.SourcesDirectory)/eng/common/scripts/get-codeowners.ps1 -TargetDirectory /sdk/${{ parameters.ServiceDirectory }}/ -RootDirectory $(Build.SourcesDirectory)
43+
if ($result) {
44+
Write-Output "##vso[task.setvariable variable=${{ parameters.TargetVariable }}]$originalValue,$result"
45+
}
46+
displayName: Add CodeOwners if Present

0 commit comments

Comments
 (0)