diff --git a/sdk/translation/azure-ai-translation-document/README.md b/sdk/translation/azure-ai-translation-document/README.md index b3ae6e023525..80dcc5ebec30 100644 --- a/sdk/translation/azure-ai-translation-document/README.md +++ b/sdk/translation/azure-ai-translation-document/README.md @@ -406,7 +406,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [custom_model]: https://docs.microsoft.com/azure/cognitive-services/translator/custom-translator/quickstart-build-deploy-custom-model [glossary]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/overview#supported-glossary-formats [sas_token]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/create-sas-tokens?tabs=Containers#create-your-sas-tokens-with-azure-storage-explorer -[sas_token_permissions]: https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/get-started-with-document-translation?tabs=csharp#create-sas-access-tokens-for-document-translation +[sas_token_permissions]: https://aka.ms/azsdk/documenttranslation/sas-permissions [azure_storage_blob]: https://pypi.org/project/azure-storage-blob/ [azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs diff --git a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_client.py b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_client.py index 03fe544e7147..cb706b0373cd 100644 --- a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_client.py +++ b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_client.py @@ -122,9 +122,11 @@ def begin_translation( https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/overview :param str source_url: The source SAS URL to the Azure Blob container containing the documents - to be translated. Requires read and list permissions at the minimum. + to be translated. See the service documentation for the supported SAS permissions for accessing + source storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions :param str target_url: The target SAS URL to the Azure Blob container where the translated documents - should be written. Requires write and list permissions at the minimum. + should be written. See the service documentation for the supported SAS permissions for accessing + target storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions :param str target_language_code: This is the language you want your documents to be translated to. See supported language codes here: https://docs.microsoft.com/azure/cognitive-services/translator/language-support#translate diff --git a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_models.py b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_models.py index e1bffea48143..d301c9e6a204 100644 --- a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_models.py +++ b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_models.py @@ -20,7 +20,8 @@ class TranslationGlossary(object): # pylint: disable=useless-object-inheritance :param str glossary_url: Required. Location of the glossary file. This should be a SAS URL to the glossary file in the storage blob container. If the translation language pair is - not present in the glossary, it will not be applied. + not present in the glossary, it will not be applied. See the service documentation for the + supported SAS permissions: https://aka.ms/azsdk/documenttranslation/sas-permissions :param str file_format: Required. Format of the glossary file. To see supported formats, call the :func:`~DocumentTranslationClient.get_supported_glossary_formats()` client method. :keyword str format_version: File format version. If not specified, the service will @@ -31,7 +32,8 @@ class TranslationGlossary(object): # pylint: disable=useless-object-inheritance :ivar str glossary_url: Required. Location of the glossary file. This should be a SAS URL to the glossary file in the storage blob container. If the translation language pair is - not present in the glossary, it will not be applied. + not present in the glossary, it will not be applied. See the service documentation for the + supported SAS permissions: https://aka.ms/azsdk/documenttranslation/sas-permissions :ivar str file_format: Required. Format of the glossary file. To see supported formats, call the :func:`~DocumentTranslationClient.get_supported_glossary_formats()` client method. :ivar str format_version: File format version. If not specified, the service will @@ -79,7 +81,9 @@ class TranslationTarget(object): # pylint: disable=useless-object-inheritance """Destination for the finished translated documents. :param str target_url: Required. The target location for your translated documents. - This should be a container SAS URL to your target container. + This should be a container SAS URL to your target container/blob. See the service + documentation for the supported SAS permissions for accessing + target storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions :param str language_code: Required. Target Language Code. This is the language you want your documents to be translated to. See supported languages here: https://docs.microsoft.com/azure/cognitive-services/translator/language-support#translate @@ -90,7 +94,9 @@ class TranslationTarget(object): # pylint: disable=useless-object-inheritance Currently only "AzureBlob" is supported. :ivar str target_url: Required. The target location for your translated documents. - This should be a container SAS URL to your target container. + This should be a container SAS URL to your target container/blob. See the service + documentation for the supported SAS permissions for accessing + target storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions :ivar str language_code: Required. Target Language Code. This is the language you want your documents to be translated to. See supported languages here: https://docs.microsoft.com/azure/cognitive-services/translator/language-support#translate @@ -150,7 +156,8 @@ class DocumentTranslationInput(object): # pylint: disable=useless-object-inheri translated and written to the location provided by the TranslationTargets. :param str source_url: Required. Location of the folder / container or single file with your - documents. + documents. See the service documentation for the supported SAS permissions for accessing + source storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions :param targets: Required. Location of the destination for the output. This is a list of TranslationTargets. Note that a TranslationTarget is required for each language code specified. :type targets: list[~azure.ai.translation.document.TranslationTarget] @@ -168,7 +175,8 @@ class DocumentTranslationInput(object): # pylint: disable=useless-object-inheri Currently only "AzureBlob" is supported. :ivar str source_url: Required. Location of the folder / container or single file with your - documents. + documents. See the service documentation for the supported SAS permissions for accessing + source storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions :ivar targets: Required. Location of the destination for the output. This is a list of TranslationTargets. Note that a TranslationTarget is required for each language code specified. :vartype targets: list[~azure.ai.translation.document.TranslationTarget] diff --git a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_client_async.py b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_client_async.py index d5eaa1991e34..591f0885e076 100644 --- a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_client_async.py +++ b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_client_async.py @@ -131,9 +131,11 @@ async def begin_translation( https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/overview :param str source_url: The source SAS URL to the Azure Blob container containing the documents - to be translated. Requires read and list permissions at the minimum. + to be translated. See the service documentation for the supported SAS permissions for accessing + source storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions :param str target_url: The target SAS URL to the Azure Blob container where the translated documents - should be written. Requires write and list permissions at the minimum. + should be written. See the service documentation for the supported SAS permissions for accessing + target storage containers/blobs: https://aka.ms/azsdk/documenttranslation/sas-permissions :param str target_language_code: This is the language you want your documents to be translated to. See supported language codes here: https://docs.microsoft.com/azure/cognitive-services/translator/language-support#translate diff --git a/sdk/translation/azure-ai-translation-document/tests/testcase.py b/sdk/translation/azure-ai-translation-document/tests/testcase.py index 743464162cc8..733618adbe57 100644 --- a/sdk/translation/azure-ai-translation-document/tests/testcase.py +++ b/sdk/translation/azure-ai-translation-document/tests/testcase.py @@ -127,7 +127,7 @@ def create_target_container(self, data=None): if data: self.upload_documents(data, container_client) - return self.generate_sas_url(self.target_container_name, "rw") + return self.generate_sas_url(self.target_container_name, "wl") def generate_sas_url(self, container_name, permission):