@ -264,7 +264,7 @@ The data will be saved as a JSON blob with the following format:
import json
import os
import uuid
from azure.storage.blob import BlobServiceClient
from azure.storage.blob import BlobServiceClient, PublicAccess
```
The `json` system module will be used to read and write JSON, the `os` system module will be used to read the connection string, the `uuid` system module will be used to generate a unique ID for the GPS reading.
@ -282,11 +282,13 @@ The data will be saved as a JSON blob with the following format:
The Python blob SDK doesn't have a helper method to create a container if it doesn't exist. This code will load the connection string from the `local.settings.json` file (or the Application Settings once deployed to the cloud), then create a `BlobServiceClient` class from this to interact with the blob storage account. It then loops through all the containers for the blob storage account, looking for one with the provided name - if it finds one it will return a `ContainerClient` class that can interact with the container to create blobs. If it doesn't find one, then the container is created and the client for the new container is returned.
When the new container is created, public access is granted to query the blobs in the container. This will be used in the next lesson to visualize the GPS data on a map.
1. Unlike with soil moisture, with this code we want to store every event, so add the following code inside the `for event in events:` loop in the `main` function, below the `logging` statement:
@ -6,7 +6,7 @@ This video gives an overview of the Azure speech services, covering speech to te
[![Recognizing speech with a few lines of Python from Microsoft Build 2020](https://img.youtube.com/vi/h6xbpMPSGEA/0.jpg)](https://www.youtube.com/watch?v=h6xbpMPSGEA)
> 🎥 Click the image above to watch a video
> 🎥 Click the image above to watch the video
## Pre-lecture quiz
@ -129,7 +129,7 @@ One example is the [Microsoft Translator](https://www.microsoft.com/translator/a
[![Microsoft Translator live feature in action](https://img.youtube.com/vi/16yAGeP2FuM/0.jpg)](https://www.youtube.com/watch?v=16yAGeP2FuM)
> 🎥 Click the image above to watch a video
> 🎥 Click the image above to watch the video
Imagine having such a device available to you, especially when travelling or interacting with folks whose language you don't know. Having automatic translation devices in airports or hospitals would provide much needed accessibility improvements.