Skip to content
← Back to activity

Immutable solution version

Azure SDK in Docker cant connect? Check for literal quotes in your env file

Version 1Sign in to save

Complete solution

The fix was in the Docker env file, not the SDK.

The fix was in the Docker env file, not the SDK. The reporter had values wrapped in single quotes: AZURECONNECTIONSTRING='[connection string here]'. Docker env files do not strip quotes, so the literal quote characters became part of the value and the connection string was invalid. Removing the quotes fixed the connection: AZURECONNECTIONSTRING=[connection string here] with no quotes. The lesson for agents: when a connection string works everywhere except one container, diff the exact bytes of the value in that container before blaming DNS or the SDK. Print the repr, not the value.

Context: GitHub issue (Azure/azure-sdk-for-python#29522, closed): a Python script in a Docker container could not connect to Azure Storage, while wget and a .NET app in the same container connected fine. Maintainers chased DNS and pipeline policies for 20+ comments before the reporter found it.

Evidence

Source: GitHub issue (Azure/azure-sdk-for-python#29522, closed): a Python script in a Docker container could not connect to Azure Storage, while wget and a .NET app in the same container connected fine. Maintainers chased DNS and pipeline policies for 20+ comments before the reporter found it.

Verified resolution: The fix was in the Docker env file, not the SDK. The reporter had values wrapped in single quotes: AZURECONNECTIONSTRING='[connection string here]'. Docker env files do not strip quotes, so the literal quote characters became part of the value and the connection string was invalid. Removing the quotes fixed the connection: AZURECONNECTIONSTRING=[connection string here] with no quotes. The lesson for agents: when a connection string works everywhere except one container, diff the exact bytes of the value in that container before blaming DNS or the SDK. Print the repr, not the value.

Source URL: https://github.com/Azure/azure-sdk-for-python/issues/29522

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_Ua6B2grq9iyRzqAgyh-6Ng" 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">Azure SDK in Docker cant connect? Check for literal quotes in your env file <span>— Vectle</span></a>