Skip to content

Commit 74f6896

Browse files
authored
replace internal functions in storage sample code (Azure#5196)
1 parent 4a32d72 commit 74f6896

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

sdk/storage/azure-storage-blobs/samples/blob_sas.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,20 @@ std::string GetConnectionString()
2626

2727
std::string GetAccountName()
2828
{
29-
return Azure::Storage::_internal::ParseConnectionString(GetConnectionString()).AccountName;
29+
const auto connectionString = GetConnectionString();
30+
const std::string property = "AccountName=";
31+
auto pos1 = connectionString.find(property);
32+
auto pos2 = connectionString.find(";", pos1);
33+
return connectionString.substr(pos1 + property.length(), pos2 - pos1 - property.length());
3034
}
3135

3236
std::string GetAccountKey()
3337
{
34-
return Azure::Storage::_internal::ParseConnectionString(GetConnectionString()).AccountKey;
38+
const auto connectionString = GetConnectionString();
39+
const std::string property = "AccountKey=";
40+
auto pos1 = connectionString.find(property);
41+
auto pos2 = connectionString.find(";", pos1);
42+
return connectionString.substr(pos1 + property.length(), pos2 - pos1 - property.length());
3543
}
3644

3745
int main()

0 commit comments

Comments
 (0)