Skip to content

Commit 7dc0dc4

Browse files
committed
add files for video
1 parent 912b22c commit 7dc0dc4

File tree

8 files changed

+198776
-382
lines changed

8 files changed

+198776
-382
lines changed

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ msrestazure==0.6.4
55
azure-core==1.7.0
66
azure-common==1.1.25
77
azure-cosmos==4.0.0b6
8+
azure-identity==1.4.0
89
azure-mgmt-sql==0.20.0
910
azure-mgmt-core==1.2.0
1011
azure-mgmt-compute==13.0.0

samples/data_dumps/articles.jsonc

+198,746-49
Large diffs are not rendered by default.

samples/data_dumps/blob_dump.jsonc

+1-332
Large diffs are not rendered by default.
1.27 MB
Binary file not shown.
63.6 KB
Binary file not shown.

samples/setenv.cmd

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
REM Sets the Environment Variables that persist over sessions.
2+
REM Make sure to run this as an administrator and then shut down VS Code
3+
REM and re-open it.
4+
5+
SETX AZURE_SUBSCRIPTION_ID
6+
SETX AZURE_TENANT_ID
7+
SETX AZURE_CLIENT_ID
8+
SETX AZURE_CLIENT_SECRET

samples/use_blob_storage.py

+18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import json
12
from pprint import pprint
3+
24
from azure.identity import DefaultAzureCredential
35

46
from azure.storage.blob import BlobClient
@@ -90,3 +92,19 @@
9092

9193
# Write to the file.
9294
my_blob.write(download_stream.readall())
95+
96+
content = json.loads(download_stream.readall())
97+
98+
# Load the Data.
99+
blob_client.upload_blob(
100+
data=json.dumps(content),
101+
blob_type="BlockBlob",
102+
overwrite=True
103+
)
104+
105+
# Create a new Blob.
106+
container_client.upload_blob(
107+
name="News Articles/blob_data_cleaned",
108+
data=json.dumps(content),
109+
blob_type="BlockBlob"
110+
)

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
'fin-news==0.1.1',
2222
'azure-core==1.7.0',
2323
'azure-common==1.1.25',
24-
'azure-cosmos==4.0.0b6'
24+
'azure-cosmos==4.0.0b6',
25+
'azure-identity==1.4.0',
2526
'azure-mgmt-sql==0.20.0',
2627
'azure-mgmt-core==1.2.0',
2728
'azure-mgmt-compute==13.0.0',

0 commit comments

Comments
 (0)