Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into feature/conversations/initial

* 'main' of https://github.com/Azure/azure-sdk-for-python:
  Update Multi-Tenant support to incorporate Arch Board Feedback (#20940)
  [formrecognizer] Add migration guide (#20960)
  Rebase after merge. (#21014)
  [SchemaRegistry] rename namespace (#20965)
  [formrecognizer] Update changelog for release (#20963)
  [formrecognizer] updating docs with aka.ms links (#21012)
  [Search] Regenerate Search SDK (#20977)
  updating codeowners for azure communication services SMS & PhoneNumbers (#20942)
  add prebuilt document to readme examples + print styles (#20996)
  Update README.md (#20992)
  • Loading branch information
iscai-msft committed Oct 1, 2021
2 parents 9f7fb73 + 01d0b99 commit b58a044
Show file tree
Hide file tree
Showing 109 changed files with 10,346 additions and 4,680 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

# PRLabel: %Communication
/sdk/communication/ @acsdevx-msft
/sdk/communication/azure-communication-phonenumbers/ @RoyHerrod @danielav7 @whisper6284 @AlonsoMondal
/sdk/communication/azure-communication-sms/ @RoyHerrod @arifibrahim4

# PRLabel: %KeyVault
/sdk/keyvault/ @schaabs @chlowell @mccoyp @YalinLi0312
Expand Down
40 changes: 20 additions & 20 deletions sdk/cosmos/azure-cosmos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,33 @@ Currently the features below are **not supported**. For alternatives options, ch

### Data Plane Limitations:

* Group By queries (in roadmap for 2021).
* Language Native async i/o (in roadmap for 2021).
* Queries with COUNT from a DISTINCT subquery: SELECT COUNT (1) FROM (SELECT DISTINCT C.ID FROM C).
* Bulk/Transactional batch processing.
* Direct TCP Mode access.
* Continuation token for cross partitions queries.
* Change Feed: Processor.
* Change Feed: Read multiple partitions key values.
* Change Feed: Read specific time.
* Change Feed: Read from the beggining.
* Change Feed: Pull model.
* Cross-partition ORDER BY for mixed types.
* Group By queries
* Language Native async i/o
* Queries with COUNT from a DISTINCT subquery: SELECT COUNT (1) FROM (SELECT DISTINCT C.ID FROM C)
* Bulk/Transactional batch processing
* Direct TCP Mode access
* Continuation token for cross partitions queries
* Change Feed: Processor
* Change Feed: Read multiple partitions key values
* Change Feed: Read specific time
* Change Feed: Read from the beggining
* Change Feed: Pull model
* Cross-partition ORDER BY for mixed types
* Integrated Cache using the default consistency level, that is "Session". To take advantage of the new [Cosmos DB Integrated Cache](https://docs.microsoft.com/azure/cosmos-db/integrated-cache), it is required to explicitly set CosmosClient consistency level to "Eventual": `consistency_level= Eventual`.

### Control Plane Limitations:

* Get CollectionSizeUsage, DatabaseUsage, and DocumentUsage metrics.
* Create Geospatial Index.
* Provision Autoscale DBs or containers.
* Update Autoscale throughput.
* Update analytical store ttl (time to live).
* Get the connection string.
* Get the minimum RU/s of a container.
* Get CollectionSizeUsage, DatabaseUsage, and DocumentUsage metrics
* Create Geospatial Index
* Provision Autoscale DBs or containers
* Update Autoscale throughput
* Update analytical store ttl (time to live)
* Get the connection string
* Get the minimum RU/s of a container

### Security Limitations:

* AAD support.
* AAD support

## Workarounds

Expand Down
8 changes: 3 additions & 5 deletions sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Release History

## 3.2.0b1 (Unreleased)
## 3.2.0b1 (2021-10-05)

This version of the SDK defaults to the latest supported API version, which currently is v2021-09-30-preview.

> Note: Starting with version 2021-09-30-preview, a new set of clients were introduced to leverage the newest features of the Form Recognizer service. Please see the Migration Guide for detailed instructions on how to update application code from client library version 3.1.X or lower to the latest version. Also, please refer to the README for more information about the library.
### Features Added
- Added new `DocumentAnalysisClient` with `begin_analyze_document` and `begin_analyze_document_from_url` methods. Use these methods with the latest Form Recognizer
API version to analyze documents, with prebuilt and custom models.
Expand All @@ -13,10 +15,6 @@ API version to analyze documents, with prebuilt and custom models.
- Added samples using the `DocumentAnalysisClient` and `DocumentModelAdministrationClient` under `/samples/v3.2-beta`.
- Added `DocumentAnalysisApiVersion` to be used with `DocumentAnalysisClient` and `DocumentModelAdministrationClient`.

### Breaking Changes

### Bugs Fixed

### Other Changes
- Python 3.5 is no longer supported in this release.

Expand Down
651 changes: 651 additions & 0 deletions sdk/formrecognizer/azure-ai-formrecognizer/MIGRATION_GUIDE.md

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions sdk/formrecognizer/azure-ai-formrecognizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Use the `model` parameter to select the type of model for analysis.
|"{custom-model-id}"| Text extraction, selection marks, tables, labeled fields and values from your custom documents

Sample code snippets are provided to illustrate using a DocumentAnalysisClient [here](#examples "Examples").
More information about analyzing documents, including supported features and locales can be found in the [service documentation][fr-models].

### DocumentModelAdministrationClient
`DocumentModelAdministrationClient` provides operations for:
Expand Down Expand Up @@ -191,6 +192,7 @@ The following section provides several code snippets covering some of the most c

* [Extract layout](#extract-layout "Extract Layout")
* [Using Prebuilt Models](#using-prebuilt-models "Using Prebuilt Models")
* [Using Prebuilt Document](#using-prebuilt-document "Using Prebuilt Document")
* [Build a Model](#build-a-model "Build a model")
* [Analyze Documents Using a Custom Model](#analyze-documents-using-a-custom-model "Analyze Documents Using a Custom Model")
* [Manage Your Models](#manage-your-models "Manage Your Models")
Expand Down Expand Up @@ -310,6 +312,83 @@ You are not limited to receipts! There are a few prebuilt models to choose from,
- Analyze invoices using the `prebuilt-invoice` model (fields recognized by the service can be found [here][service_recognize_invoice]).
- Analyze identity documents using the `prebuilt-idDocuments` model (fields recognized by the service can be found [here][service_recognize_identity_documents]).

### Using Prebuilt Document
Analyze entities, key-value pairs, tables, styles, and selection marks from documents using the general prebuilt document model provided by the Form Recognizer service.
Select the Prebuilt Document model by passing `model="prebuilt-document"` into the `begin_analyze_documents` method:

```python
from azure.ai.formrecognizer import DocumentAnalysisClient
from azure.core.credentials import AzureKeyCredential

endpoint = "https://<my-custom-subdomain>.cognitiveservices.azure.com/"
credential = AzureKeyCredential("<api_key>")

document_analysis_client = DocumentAnalysisClient(endpoint, credential)

with open("<path to your document>", "rb") as fd:
document = fd.read()

poller = document_analysis_client.begin_analyze_document("prebuilt-document", document)
result = poller.result()

print("----Entities found in document----")
for entity in result.entities:
print("Entity '{}' has category '{}' with sub-category '{}'".format(
entity.content, entity.category, entity.sub_category
))
print("...with confidence {}\n".format(entity.confidence))

print("----Key-value pairs found in document----")
for kv_pair in result.key_value_pairs:
if kv_pair.key:
print(
"Key '{}' found within '{}' bounding regions".format(
kv_pair.key.content,
kv_pair.key.bounding_regions,
)
)
if kv_pair.value:
print(
"Value '{}' found within '{}' bounding regions\n".format(
kv_pair.value.content,
kv_pair.value.bounding_regions,
)
)

print("----Tables found in document----")
for table_idx, table in enumerate(result.tables):
print(
"Table # {} has {} rows and {} columns".format(
table_idx, table.row_count, table.column_count
)
)
for region in table.bounding_regions:
print(
"Table # {} location on page: {} is {}".format(
table_idx,
region.page_number,
region.bounding_box,
)
)

print("----Styles found in document----")
for style in result.styles:
if style.is_handwritten:
print("Document contains handwritten content: ")
print(",".join([result.content[span.offset:span.offset + span.length] for span in style.spans]))

print("----Selection marks found in document----")
for page in result.pages:
for selection_mark in page.selection_marks:
print(
"...Selection mark is '{}' within bounding box '{}' and has a confidence of {}".format(
selection_mark.state,
selection_mark.bounding_box,
selection_mark.confidence,
)
)
```

### Build a model
Build a custom model on your own document type. The resulting model can be used to analyze values from the types of documents it was trained on.
Provide a container SAS URL to your Azure Storage Blob container where you're storing the training documents.
Expand Down Expand Up @@ -454,6 +533,7 @@ except ResourceNotFoundError:

### General
Form Recognizer client library will raise exceptions defined in [Azure Core][azure_core_exceptions].
Error codes and messages raised by the Form Recognizer service can be found in the [service documentation][fr-errors].

### Logging
This library uses the standard
Expand Down Expand Up @@ -506,6 +586,8 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
[fr-labeling-tool]: https://aka.ms/azsdk/formrecognizer/labelingtool
[fr-build-model]: https://aka.ms/azsdk/formrecognizer/buildmodel
[fr-build-training-set]: https://aka.ms/azsdk/formrecognizer/buildtrainingset
[fr-models]: https://aka.ms/azsdk/formrecognizer/models
[fr-errors]: https://aka.ms/azsdk/formrecognizer/errors

[azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs
[azure_core_exceptions]: https://aka.ms/azsdk/python/core/docs#module-azure.core.exceptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ def begin_analyze_document(self, model, document, **kwargs):
"""Analyze field text and semantic values from a given document.
:param str model: A unique model identifier can be passed in as a string.
Use this to specify the custom model ID or prebuilt model ID. Prebuilt model IDs to use are:
"prebuilt-receipt", "prebuilt-invoice", "prebuilt-idDocument", "prebuilt-businessCard",
"prebuilt-document", "prebuilt-layout".
Use this to specify the custom model ID or prebuilt model ID. Prebuilt model IDs supported
can be found here: https://aka.ms/azsdk/formrecognizer/models
:param document: JPEG, PNG, PDF, TIFF, or BMP type file stream or bytes.
:type document: bytes or IO[bytes]
:keyword str pages: Custom page numbers for multi-page documents(PDF/TIFF). Input the page numbers
Expand Down Expand Up @@ -134,9 +133,8 @@ def begin_analyze_document_from_url(self, model, document_url, **kwargs):
The input must be the location (URL) of the document to be analyzed.
:param str model: A unique model identifier can be passed in as a string.
Use this to specify the custom model ID or prebuilt model ID. Prebuilt model IDs to use are:
"prebuilt-receipt", "prebuilt-invoice", "prebuilt-idDocument", "prebuilt-businessCard",
"prebuilt-document", "prebuilt-layout".
Use this to specify the custom model ID or prebuilt model ID. Prebuilt model IDs supported
can be found here: https://aka.ms/azsdk/formrecognizer/models
:param str document_url: The URL of the document to analyze. The input must be a valid, encoded, and
publicly accessible URL of one of the supported formats: JPEG, PNG, PDF, TIFF, or BMP.
:keyword str pages: Custom page numbers for multi-page documents(PDF/TIFF). Input the page numbers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ async def begin_analyze_document(
"""Analyze field text and semantic values from a given document.
:param str model: A unique model identifier can be passed in as a string.
Use this to specify the custom model ID or prebuilt model ID. Prebuilt model IDs to use are:
"prebuilt-receipt", "prebuilt-invoice", "prebuilt-idDocument", "prebuilt-businessCard",
"prebuilt-document", "prebuilt-layout".
Use this to specify the custom model ID or prebuilt model ID. Prebuilt model IDs supported
can be found here: https://aka.ms/azsdk/formrecognizer/models
:param document: JPEG, PNG, PDF, TIFF, or BMP type file stream or bytes.
:type document: bytes or IO[bytes]
:keyword str pages: Custom page numbers for multi-page documents(PDF/TIFF). Input the page numbers
Expand Down Expand Up @@ -141,9 +140,8 @@ async def begin_analyze_document_from_url(
The input must be the location (URL) of the document to be analyzed.
:param str model: A unique model identifier can be passed in as a string.
Use this to specify the custom model ID or prebuilt model ID. Prebuilt model IDs to use are:
"prebuilt-receipt", "prebuilt-invoice", "prebuilt-idDocument", "prebuilt-businessCard",
"prebuilt-document", "prebuilt-layout".
Use this to specify the custom model ID or prebuilt model ID. Prebuilt model IDs supported
can be found here: https://aka.ms/azsdk/formrecognizer/models
:param str document_url: The URL of the document to analyze. The input must be a valid, encoded, and
publicly accessible URL of one of the supported formats: JPEG, PNG, PDF, TIFF, or BMP.
:keyword str pages: Custom page numbers for multi-page documents(PDF/TIFF). Input the page numbers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,10 @@ async def analyze_document():
)
result = await poller.result()

for idx, style in enumerate(result.styles):
print(
"Document contains {} content".format(
"handwritten" if style.is_handwritten else "no handwritten"
)
)
for style in result.styles:
if style.is_handwritten:
print("Document contains handwritten content: ")
print(",".join([result.content[span.offset:span.offset + span.length] for span in style.spans]))

for idx, page in enumerate(result.pages):
print("----Analyzing document from page #{}----".format(idx + 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ def analyze_document():
)
result = poller.result()

for idx, style in enumerate(result.styles):
print(
"Document contains {} content".format(
"handwritten" if style.is_handwritten else "no handwritten"
)
)
for style in result.styles:
if style.is_handwritten:
print("Document contains handwritten content: ")
print(",".join([result.content[span.offset:span.offset + span.length] for span in style.spans]))

for page in result.pages:
print("----Analyzing document from page #{}----".format(page.page_number))
Expand Down
12 changes: 7 additions & 5 deletions sdk/identity/azure-identity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

## 1.7.0b5 (Unreleased)

### Features Added

### Breaking Changes
> These changes do not impact the API of stable versions such as 1.6.0.
> Only code written against a beta version such as 1.7.0b1 may be affected.
### Bugs Fixed

### Other Changes
- The `allow_multitenant_authentication` argument has been removed and the default behavior is now as if it were true.
The multitenant authentication feature can be totally disabled by setting the environment variable
`AZURE_IDENTITY_DISABLE_MULTITENANTAUTH` to `True`.
- `azure.identity.RegionalAuthority` is removed.
- `regional_authority` argument is removed for `CertificateCredential` and `ClientSecretCredential`

## 1.7.0b4 (2021-09-09)

Expand Down
2 changes: 0 additions & 2 deletions sdk/identity/azure-identity/azure/identity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""Credentials for Azure SDK clients."""

from ._auth_record import AuthenticationRecord
from ._enums import RegionalAuthority
from ._exceptions import AuthenticationRequiredError, CredentialUnavailableError
from ._constants import AzureAuthorityHosts, KnownAuthorities
from ._credentials import (
Expand Down Expand Up @@ -47,7 +46,6 @@
"InteractiveBrowserCredential",
"KnownAuthorities",
"OnBehalfOfCredential",
"RegionalAuthority",
"ManagedIdentityCredential",
"SharedTokenCacheCredential",
"TokenCachePersistenceOptions",
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/azure-identity/azure/identity/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class EnvironmentVariables:
MSI_SECRET = "MSI_SECRET"

AZURE_AUTHORITY_HOST = "AZURE_AUTHORITY_HOST"
AZURE_IDENTITY_ENABLE_LEGACY_TENANT_SELECTION = "AZURE_IDENTITY_ENABLE_LEGACY_TENANT_SELECTION"
AZURE_IDENTITY_DISABLE_MULTITENANTAUTH = "AZURE_IDENTITY_DISABLE_MULTITENANTAUTH"
AZURE_REGIONAL_AUTHORITY_NAME = "AZURE_REGIONAL_AUTHORITY_NAME"

AZURE_FEDERATED_TOKEN_FILE = "AZURE_FEDERATED_TOKEN_FILE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ class AzureApplicationCredential(ChainedTokenCredential):
<https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview>`_ for an overview of
managed identities.
:keyword bool allow_multitenant_authentication: when True, enables the credential to acquire tokens from any tenant
the application or user is registered in. When False, which is the default, the credential will acquire tokens
only from the tenant specified by **AZURE_TENANT_ID**. This argument doesn't apply to managed identity
authentication.
:keyword str authority: Authority of an Azure Active Directory endpoint, for example "login.microsoftonline.com",
the authority for Azure Public Cloud, which is the default when no value is given for this keyword argument or
environment variable AZURE_AUTHORITY_HOST. :class:`~azure.identity.AzureAuthorityHosts` defines authorities for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ class AuthorizationCodeCredential(GetTokenMixin):
the authority for Azure Public Cloud (which is the default). :class:`~azure.identity.AzureAuthorityHosts`
defines authorities for other clouds.
:keyword str client_secret: One of the application's client secrets. Required only for web apps and web APIs.
:keyword bool allow_multitenant_authentication: when True, enables the credential to acquire tokens from any tenant
the user is registered in. When False, which is the default, the credential will acquire tokens only from the
user's home tenant or the tenant specified by **tenant_id**.
"""

def __init__(self, tenant_id, client_id, authorization_code, redirect_uri, **kwargs):
Expand Down Expand Up @@ -67,8 +64,7 @@ def get_token(self, *scopes, **kwargs):
redeeming the authorization code.
:param str scopes: desired scopes for the access token. This method requires at least one scope.
:keyword str tenant_id: optional tenant to include in the token request. If **allow_multitenant_authentication**
is False, specifying a tenant with this argument may raise an exception.
:keyword str tenant_id: optional tenant to include in the token request.
:rtype: :class:`azure.core.credentials.AccessToken`
:raises ~azure.core.exceptions.ClientAuthenticationError: authentication failed. The error's ``message``
Expand Down
Loading

0 comments on commit b58a044

Please sign in to comment.