Skip to content

Commit 20780cb

Browse files
committed
merge master
2 parents 71de398 + 3891c08 commit 20780cb

File tree

1,679 files changed

+67713
-25927
lines changed

Some content is hidden

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

1,679 files changed

+67713
-25927
lines changed

.github/CODEOWNERS

+7-4
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
/sdk/eventhub/ @annatisch @yunhaoling @YijunXieMS
2424

2525
# PRLabel: %Storage
26-
/sdk/storage/ @amishra-dev @zezha-msft @annatisch @rakshith91 @xiafu-msft @kasobol-msft
26+
/sdk/storage/ @amishra-dev @zezha-msft @annatisch @rakshith91 @xiafu-msft @tasherif-msft @kasobol-msft
2727

28-
/sdk/applicationinsights/ @alexeldeib
28+
/sdk/applicationinsights/ @alexeldeib
2929

3030
# PRLabel: %Batch
3131
/sdk/batch/ @bgklein @xingwu1
32-
/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/ @areddish
32+
/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/ @areddish
3333

3434
# PRLabel: %KeyVault
3535
/sdk/keyvault/ @schaabs @chlowell @iscai-msft
@@ -52,7 +52,7 @@
5252

5353
# PRLabel: %Data Factory
5454
/sdk/datafactory/ @hvermis
55-
/sdk/datalake/ @ro-joowan
55+
/sdk/datalake/ @ro-joowan
5656
/sdk/datadatamigration/ @vchske
5757

5858
# PRLabel: %Event Grid
@@ -88,6 +88,9 @@
8888
# PRLabel: %Cognitive - Form Recognizer
8989
/sdk/formrecognizer/ @kristapratico @iscai-msft @rakshith91
9090

91+
# PRLabel: %Tables
92+
/sdk/tables/ @seankane-msft
93+
9194
# Smoke Tests
9295
/common/smoketest/ @lmazuel @chlowell @annatisch @rakshith91 @shurd @southpolesteve
9396

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ src/build
8484

8585
# [begoldsm] ignore virtual env if it exists.
8686
adlEnv/
87-
87+
venv/
8888
code_reports
8989

9090
# Azure Storage test credentials

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Packages](https://img.shields.io/badge/packages-latest-blue.svg)](https://azure.github.io/azure-sdk/releases/latest/python.html) [![Dependencies](https://img.shields.io/badge/dependency-report-blue.svg)](https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-python/dependencies/dependencies.html) [![DepGraph](https://img.shields.io/badge/dependency-graph-blue.svg)](https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-python/dependencies/InterdependencyGraph.html) [![Python](https://img.shields.io/pypi/pyversions/azure-core.svg?maxAge=2592000)](https://pypi.python.org/pypi/azure/) [![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/python/python%20-%20core%20-%20ci?branchName=master)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=458&branchName=master)
44

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

77
## Getting started
88

SECURITY.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
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-
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.
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/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
88

99
## Reporting Security Issues
1010

1111
**Please do not report security vulnerabilities through public GitHub issues.**
1212

1313
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
1414

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).
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/msrc/pgp-key-msrc).
1616

1717
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).
1818

@@ -36,6 +36,6 @@ We prefer all communications to be in English.
3636

3737
## Policy
3838

39-
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
39+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/msrc/cvd).
4040

4141
<!-- END MICROSOFT SECURITY.MD BLOCK -->

common/smoketest/key_vault_base.py

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
15
import os
2-
from azure.identity import DefaultAzureCredential, KnownAuthorities
6+
from azure.identity import AzureAuthorityHosts, DefaultAzureCredential
7+
38

49
class KeyVaultBase:
510
credential_type = DefaultAzureCredential
611
host_alias_map = {
7-
'AzureChinaCloud': KnownAuthorities.AZURE_CHINA,
8-
'AzureGermanCloud': KnownAuthorities.AZURE_GERMANY,
9-
'AzureUSGovernment': KnownAuthorities.AZURE_GOVERNMENT,
10-
'AzureCloud': KnownAuthorities.AZURE_PUBLIC_CLOUD,
12+
"AzureChinaCloud": (AzureAuthorityHosts.AZURE_CHINA, "2016-10-01"),
13+
"AzureGermanCloud": (AzureAuthorityHosts.AZURE_GERMANY, "2016-10-01"),
14+
"AzureUSGovernment": (AzureAuthorityHosts.AZURE_GOVERNMENT, "2016-10-01"),
15+
"AzureCloud": (AzureAuthorityHosts.AZURE_PUBLIC_CLOUD, "7.1"),
1116
}
1217

13-
# Instantiate a default credential based on the credential_type
14-
def get_default_credential(self, authority_host_alias=None):
15-
alias = authority_host_alias or os.environ.get("AZURE_CLOUD")
16-
authority_host = self.host_alias_map.get(alias, KnownAuthorities.AZURE_PUBLIC_CLOUD)
17-
return self.credential_type(authority=authority_host)
18+
def get_client_args(self, authority_host_alias=None):
19+
alias = authority_host_alias or os.environ.get("AZURE_CLOUD", "AzureCloud")
20+
authority_host, api_version = self.host_alias_map[alias]
21+
credential = self.credential_type(authority=authority_host)
22+
return {"api_version": api_version, "credential": credential, "vault_url": os.environ["AZURE_PROJECT_URL"]}
+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
15
from key_vault_base import KeyVaultBase
26
from azure.identity.aio import DefaultAzureCredential
37

8+
49
class KeyVaultBaseAsync(KeyVaultBase):
510
credential_type = DefaultAzureCredential

common/smoketest/key_vault_certificates.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@
22
# Copyright (c) Microsoft Corporation.
33
# Licensed under the MIT License.
44
# ------------------------------------
5-
import os
65
import uuid
76
from azure.keyvault.certificates import CertificateClient, CertificatePolicy
87
from key_vault_base import KeyVaultBase
98

9+
1010
class KeyVaultCertificates(KeyVaultBase):
1111
def __init__(self):
12-
13-
credential = self.get_default_credential()
14-
self.certificate_client = CertificateClient(
15-
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
16-
)
17-
12+
args = self.get_client_args()
13+
self.certificate_client = CertificateClient(**args)
1814
self.certificate_name = "cert-name-" + uuid.uuid1().hex
1915

2016
def create_certificate(self):

common/smoketest/key_vault_certificates_async.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,16 @@
22
# Copyright (c) Microsoft Corporation.
33
# Licensed under the MIT License.
44
# ------------------------------------
5-
import os
65
import uuid
76
from azure.keyvault.certificates import CertificatePolicy
87
from azure.keyvault.certificates.aio import CertificateClient
98
from key_vault_base_async import KeyVaultBaseAsync
109

10+
1111
class KeyVaultCertificates(KeyVaultBaseAsync):
1212
def __init__(self):
13-
credential = self.get_default_credential()
14-
self.certificate_client = CertificateClient(
15-
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
16-
)
17-
13+
args = self.get_client_args()
14+
self.certificate_client = CertificateClient(**args)
1815
self.certificate_name = "cert-name-" + uuid.uuid1().hex
1916

2017
async def create_certificate(self):

common/smoketest/key_vault_keys.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@
22
# Copyright (c) Microsoft Corporation.
33
# Licensed under the MIT License.
44
# ------------------------------------
5-
import os
65
import uuid
76
from azure.keyvault.keys import KeyClient
87
from key_vault_base import KeyVaultBase
98

109

1110
class KeyVaultKeys(KeyVaultBase):
1211
def __init__(self):
13-
credential = self.get_default_credential()
14-
self.key_client = KeyClient(
15-
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
16-
)
17-
12+
args = self.get_client_args()
13+
self.key_client = KeyClient(**args)
1814
self.key_name = "key-name-" + uuid.uuid1().hex
1915

2016
def create_rsa_key(self):

common/smoketest/key_vault_keys_async.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@
22
# Copyright (c) Microsoft Corporation.
33
# Licensed under the MIT License.
44
# ------------------------------------
5-
import os
65
import uuid
76
from azure.keyvault.keys.aio import KeyClient
87
from key_vault_base_async import KeyVaultBaseAsync
98

109

1110
class KeyVaultKeys(KeyVaultBaseAsync):
1211
def __init__(self):
13-
14-
credential = self.get_default_credential()
15-
self.key_client = KeyClient(
16-
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
17-
)
18-
12+
args = self.get_client_args()
13+
self.key_client = KeyClient(**args)
1914
self.key_name = "key-name-" + uuid.uuid1().hex
2015

2116
async def create_rsa_key(self):

common/smoketest/key_vault_secrets.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22
# Copyright (c) Microsoft Corporation.
33
# Licensed under the MIT License.
44
# ------------------------------------
5-
import os
65
import uuid
76
from azure.keyvault.secrets import SecretClient
87
from key_vault_base import KeyVaultBase
98

9+
1010
class KeyVaultSecrets(KeyVaultBase):
1111
def __init__(self):
12-
credential = self.get_default_credential()
13-
self.secret_client = SecretClient(
14-
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
15-
)
16-
12+
args = self.get_client_args()
13+
self.secret_client = SecretClient(**args)
1714
self.secret_name = "secret-name-" + uuid.uuid1().hex
1815
self.secret_Value = "secret-value"
1916

common/smoketest/key_vault_secrets_async.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
# Copyright (c) Microsoft Corporation.
33
# Licensed under the MIT License.
44
# ------------------------------------
5-
import os
65
import uuid
76
from azure.keyvault.secrets.aio import SecretClient
87
from key_vault_base_async import KeyVaultBaseAsync
98

9+
1010
class KeyVaultSecrets(KeyVaultBaseAsync):
1111
def __init__(self):
12-
credential = self.get_default_credential()
13-
self.secret_client = SecretClient(
14-
vault_url=os.environ["AZURE_PROJECT_URL"], credential=credential
15-
)
12+
args = self.get_client_args()
13+
self.secret_client = SecretClient(**args)
1614
self.secret_name = "secret-name-" + uuid.uuid1().hex
1715
self.secret_value = "secret-value"
1816

doc/dev/mgmt/generating-integration-test.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ now you can run live integration test:
123123

124124
pytest -s sdk/attestation/azure-mgmt-attestation
125125

126-
>NOTE: To create service principal, follow instructions here: https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal
126+
>NOTE: To create service principal, follow instructions here: https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
127127
128128
## Fixing Test
129129

doc/dev/mgmt/tests.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ you must use an OAuth authentication method which gives you a token:
6666

6767
Certificate authentication does not allow you to record HTTP queries for testing.
6868

69-
### Get a token with Azure Active Directory user/password. This is considered deprecated and should not be used anymore (https://docs.microsoft.com/en-us/python/azure/python-sdk-azure-authenticate?view=azure-python#mgmt-auth-legacy).
69+
### Get a token with Azure Active Directory user/password. This is considered deprecated and should not be used anymore (https://docs.microsoft.com/python/azure/python-sdk-azure-authenticate?view=azure-python#mgmt-auth-legacy).
7070

7171
1. Connect to the [Azure Classic Portal](https://manage.windowsazure.com/) with your admin account.
72-
2. Create a user in your default AAD https://azure.microsoft.com/en-us/documentation/articles/active-directory-create-users/
72+
2. Create a user in your default AAD https://azure.microsoft.com/documentation/articles/active-directory-create-users/
7373
**You must NOT activate Multi-Factor Authentication!**
7474
3. Go to Settings - Administrators.
7575
4. Click on *Add* and enter the email of the new user.
@@ -89,13 +89,13 @@ credentials = UserPassCredentials(
8989
### Get a token with Active Directory application and service principal
9090

9191
Follow this detailed tutorial to set up an Active Directory application and service principal:
92-
https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/
92+
https://azure.microsoft.com/documentation/articles/resource-group-create-service-principal-portal/
9393

9494
To use the credentials from Python,
9595
you need the application ID (a.k.a. client ID),
9696
authentication key (a.k.a. client secret),
9797
tenant ID and subscription ID from the Azure portal for use in the next step.
98-
[This section of the above tutorial](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-application-id-and-authentication-key)
98+
[This section of the above tutorial](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-application-id-and-authentication-key)
9999
describes where to find them
100100
(besides the subscription ID,
101101
which is in the "Overview" section of the "Subscriptions" blade.)

doc/dev/release.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Python packages are uploaded to [PyPI](https://pypi.org/). Once you've uploaded
1616

1717
### Production - Deploy with Azure Dev Ops
1818

19-
To avoid "accidental" pushes to our target repositories, [approval](https://docs.microsoft.com/en-us/azure/devops/pipelines/release/approvals/approvals?view=azure-devops) will be requested directly prior to the final PyPI publish. Reference this [wiki page](https://aka.ms/python-approval-groups) and click on `Release to PyPI Approvers` to add yourself to the group for PyPI publishing.
19+
To avoid "accidental" pushes to our target repositories, [approval](https://docs.microsoft.com/azure/devops/pipelines/release/approvals/approvals?view=azure-devops) will be requested directly prior to the final PyPI publish. Reference this [wiki page](https://aka.ms/python-approval-groups) and click on `Release to PyPI Approvers` to add yourself to the group for PyPI publishing.
2020

2121
Instead of a single central pipeline, the python SDK has moved to `service directory` associated build pipelines. These are driven by yml templates at the root of each service folder. [Example for storage service folder.](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/ci.yml#L44)
2222

23-
As an aside, please note that the preview feature `multi-stage pipelines` must be enabled to properly interact with unified pipelines. If you aren't aware, find out how to enable by visiting [this link.](https://docs.microsoft.com/en-us/azure/devops/project/navigation/preview-features?view=azure-devops)
23+
As an aside, please note that the preview feature `multi-stage pipelines` must be enabled to properly interact with unified pipelines. If you aren't aware, find out how to enable by visiting [this link.](https://docs.microsoft.com/azure/devops/project/navigation/preview-features?view=azure-devops)
2424

2525
#### Releasing Through Unified Pipelines
2626

eng/.docsettings.yml

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ known_content_issues:
4848
- ['sdk/synapse/azure-synapse-spark/README.md', '#4554']
4949
- ['sdk/synapse/azure-synapse-artifacts/README.md', '#4554']
5050
- ['sdk/synapse/azure-synapse-nspkg/README.md', '#4554']
51+
- ['sdk/anomalydetector/azure-ai-anomalydetector/README.md', '#4554']
5152
- ['sdk/applicationinsights/azure-applicationinsights/README.md', '#4554']
5253
- ['sdk/batch/azure-batch/README.md', '#4554']
5354
- ['sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/README.md', '#4554']

eng/common/README.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,20 @@ The `eng/common` directory contains engineering files that are common across the
44
It should remain relatively small and only contain textual based files like scripts, configs, or templates. It
55
should not contain binary files as they don't play well with git.
66

7-
# Updating
7+
## Updating
88

99
Any updates to files in the `eng/common` directory should be made in the [azure-sdk-tools](https://github.com/azure/azure-sdk-tools) repo.
1010
All changes made will cause a PR to created in all subscribed azure-sdk language repos which will blindly replace all contents of
1111
the `eng/common` directory in that repo. For that reason do **NOT** make changes to files in this directory in the individual azure-sdk
12-
languages repos as they will be overwritten the next time an update is taken from the common azure-sdk-tools repo.
12+
languages repos as they will be overwritten the next time an update is taken from the common azure-sdk-tools repo.
13+
14+
### Workflow
15+
16+
The 'Sync eng/common directory' PRs will be created in the language repositories once a pull request that touches the eng/common directory is submitted against the master branch. This will make it easier for changes to be tested in each individual language repo before merging the changes in the azure-sdk-tools repo. The workflow is explained below:
17+
18+
1. Create a PR against Azure/azure-sdk-tools:master. This is the **Tools PR**.
19+
2. `azure-sdk-tools - sync - eng-common` is run automatically. It creates **Sync PRs** in each of the connected language repositories using the format `Sync eng/common directory with azure-sdk-tools for PR {Tools PR Number}`. Each **Sync PR** will contain a link back to the **Tools PR** that triggered it.
20+
3. More changes pushed to the **Tools PR**, will automatically triggered new pipeline runs in the respective **Sync PRs**. The **Sync PRs** are used to make sure the changes would not break any of the connected pipelines.
21+
4. Once satisfied with the changes;
22+
- First merge all the **Sync PRs**. The **Tools PR** contains links to all the **Sync PRs**
23+
- Finally merge the **Tools PR**. Each **Sync PR** contains the link to the corresponding **Tools PR**.

0 commit comments

Comments
 (0)