Skip to content
← Back to activity

Immutable solution version

AttributeError: module 'azure.core.pipeline.policies' has no attribute 'SensitiveHeaderCleanupPolicy'

Version 1Sign in to save

Complete solution

Teaches how to attributeError: module 'azure.core.pipeline.policies' has no attribute 'SensitiveHeaderCleanupPolicy'. Based on a real issue report and its verified fix.

The problem

Issue Azure/azure-sdk-for-python#34091 (closed, 15 comments): from azure.core.credentials import AzureKeyCredential from azure.ai.documentintelligence import DocumentIntelligenceClient from azure.ai.documentintelligence.models import AnalyzeResult endpoint = xxxxxxxxxxxxxxxx key [your value] documentintelligenceclient = DocumentIntelligenceClient(endpoint=endpoint, credential=AzureKeyCredential(key)) with open(pathtosampledocuments, "rb") as f: poller = documentintelligenceclient.beginanalyzedocument( "prebuilt-layout", analyzerequest=f, content_type="application/octet-stream" ) I was earlier using FormRecogniser and just wanted to shif

What to do

AttributeError: module 'azure.core.pipeline.policies' has no attribute 'SensitiveHeaderCleanupPolicy' means your azure-core is too old. Fix: pip install --upgrade azure-core. This also bites Azure CLI upgrades, which do not upgrade azure-core themselves.

Evidence

In the GitHub issue gh:Azure/azure-sdk-for-python#34091 (https://github.com/Azure/azure-sdk-for-python/issues/34091), the problem reported was: Issue Azure/azure-sdk-for-python#34091 (closed, 15 comments): from azure.core.credentials import AzureKeyCredential from azure.ai.documentintelligence import DocumentIntelligenceClient from azure.ai.documentintelligence.models import AnalyzeResult endpoint = xxxxxxxxxxxxxxxx key [your value] documentintelligenceclient = DocumentIntelligenceClient(endpoint=endpoint, credential=AzureKeyCredential(key)) with open(pathtosampledocuments, "rb") as f: poller = documentintelligenceclient.beginanalyzedocument( "prebuilt-layout", analyzerequest=f, content_type="application/octet-stream" ) I was earlier using FormRecogniser and just wanted to shif The verified resolution was: AttributeError: module 'azure.core.pipeline.policies' has no attribute 'SensitiveHeaderCleanupPolicy' means your azure-core is too old. Fix: pip install --upgrade azure-core. This also bites Azure CLI upgrades, which do not upgrade azure-core themselves.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_6IMaEmqZqEBmlxb_RuEMIQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">AttributeError: module &#39;azure.core.pipeline.policies&#39; has no attribute &#39;SensitiveHeaderCleanupPolicy&#39; <span>— Vectle</span></a>