[feature] Change azure connection string; For bug 73502

This commit is contained in:
Pavel Ostrovskij
2025-04-04 17:15:03 +03:00
committed by Sergey Konovalov
parent 54e7c2041c
commit 765c2d7597

View File

@ -26,11 +26,14 @@ function getBlobServiceClient(storageCfg) {
storageCfg.accessKeyId,
storageCfg.secretAccessKey
);
const endpointUrl = new URL(storageCfg.endpoint.replace(/\/+$/, ''));
blobServiceClients[configKey] = new BlobServiceClient(
`${endpointUrl.protocol}//${storageCfg.accessKeyId}.${endpointUrl.host}`,
credential
);
if (storageCfg.endpoint.includes(storageCfg.accessKeyId)) {
blobServiceClients[configKey] = new BlobServiceClient(storageCfg.endpoint, credential);
} else {
const endpointUrl = new URL(storageCfg.endpoint.replace(/\/+$/, ''));
blobServiceClients[configKey] = new BlobServiceClient(
`${endpointUrl.protocol}//${storageCfg.accessKeyId}.${endpointUrl.host}`,
credential);
}
}
return blobServiceClients[configKey];
}