If you're using azure-mgmt-storage to create the storage account, then you can follow this article to fetch the connection string.
Here is the code snippet in the sample above to fetch connection string:
# Step 3: Retrieve the account's primary access key and generate a connection string.
keys = storage_client.storage_accounts.list_keys(RESOURCE_GROUP_NAME, STORAGE_ACCOUNT_NAME)
print(f"Primary key for storage account: {keys.keys[0].value}")
conn_string = f"DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName={STORAGE_ACCOUNT_NAME};AccountKey={keys.keys[0].value}"
print(f"Connection string: {conn_string}")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…