Skip to content

Commit

Permalink
Updated lab 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidney Andrews committed Aug 17, 2020
1 parent d03f0da commit e4cd471
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 46 deletions.
32 changes: 15 additions & 17 deletions Instructions/Labs/AZ-204_07_lab.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Find the taskbar on your Windows 10 desktop. The taskbar contains the icons for

- Pricing tier: **Standard**

- Soft delete: **Disable**
- Soft delete: **Disable recovery of this vault and its objects**

> **Note**: Wait for Azure to finish creating the key vault before you move forward with the lab. You'll receive a notification when the vault is created.
Expand Down Expand Up @@ -298,6 +298,16 @@ In this exercise, you used a service identity to read the value of a secret stor
- Deployment slot setting: **Not selected**
1. Create a new application setting by using the following details:
- Name: **DOTNET_SKIP_FIRST_TIME_EXPERIENCE**
- Value: **true**
- Deployment slot setting: **Not selected**
1. **Save** the updated list of application settings.
#### Task 3: Pull the storage account SDK from NuGet
1. Access the **securefunc*[yourname]*** function app that you created earlier in this lab.
Expand All @@ -316,12 +326,12 @@ In this exercise, you used a service identity to read the value of a secret stor
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Storage.Blobs" Version="12.4.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.5.0" />
</ItemGroup>
</Project>
```
> **Note**: The App Service Editor will save changes to the file automatically. This .proj file contains the NuGet package reference necessary to import the [Azure.Storage.Blobs](https://www.nuget.org/packages/Azure.Storage.Blobs/12.4.0) package.
> **Note**: The App Service Editor will save changes to the file automatically. This .proj file contains the NuGet package reference necessary to import the [Azure.Storage.Blobs](https://www.nuget.org/packages/Azure.Storage.Blobs/12.5.0) package.
1. Close the browser window with the **App Service Editor**.
Expand All @@ -343,22 +353,10 @@ In this exercise, you used a service identity to read the value of a secret stor
string connectionString = Environment.GetEnvironmentVariable("StorageConnectionString");
```
1. Create a new instance of the **BlobServiceClient** class by passing in your *connectionString* variable to the constructor:
```
BlobServiceClient serviceClient = new BlobServiceClient(connectionString);
```
1. Use the **BlobServiceClient.GetBlobContainerClient** method while passing in the **drop** container name to create a new instance of the **BlobContainerClient** class that references the container that you created earlier in this lab:
```
BlobContainerClient containerClient = serviceClient.GetBlobContainerClient("drop");
```
1. Use the **BlobContainerClient.GetBlobClient** method while passing in the **records.json** blob name to create a new instance of the **BlobClient** class that references the blob that you uploaded earlier in this lab:
1. Create a new instance of the **BlobClient** class by passing in your *connectionString* variable, a ``"drop"`` string value, and a ``"records.json"`` string value to the constructor:
```
BlobClient blobClient = containerClient.GetBlobClient("records.json");
BlobClient blob = new BlobClient(connectionString, "drop", "records.json");
```
#### Task 6: Download a blob
Expand Down
54 changes: 25 additions & 29 deletions Instructions/Labs/AZ-204_07_lab_ak.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Find the taskbar on your Windows 10 desktop. The taskbar contains the icons for

1. In the **Pricing tier** drop-down list, select **Standard**.

1. In the **Soft delete** section, select **Disable**.
1. In the **Soft delete** section, select **Disable recovery of this vault and its objects**.

1. Select **Review + Create**.

Expand Down Expand Up @@ -530,21 +530,33 @@ In this exercise, you used a service identity to read the value of a secret stor
1. From the **App Service** blade, select the **Configuration** option from the **Settings** section.
1. From the **Configuration** pane, perform the following actions:
1. From the **Configuration** pane, select the **Application settings** tab, and then select **New application setting**.
1. In the **Add/Edit application setting** pop-up window, perform the following actions:
1. In the **Name** text box, enter **DOTNET_ADD_GLOBAL_TOOLS_TO_PATH**.
1. Select the **Application settings** tab, and then select **New application setting**.
1. In the **Value** text box, enter **false**.
1. In the **Add/Edit application setting** pop-up window, in the **Name** text box, enter **DOTNET_ADD_GLOBAL_TOOLS_TO_PATH**.
1. Leave the **deployment slot setting** text box set to its default value.
1. Select **OK** to close the pop-up window and return to the **Configuration** section.
1. Back in the **Application settings** tab, select **New application setting** again.
1. In the **Add/Edit application setting** pop-up window, perform the following actions:
1. In the **Name** text box, enter **DOTNET_SKIP_FIRST_TIME_EXPERIENCE**.
1. In the **Value** text box, enter **false**.
1. In the **Value** text box, enter **true**.
1. Leave the **deployment slot setting** text box set to its default value.
1. Select **OK** to close the pop-up window and return to the **Configuration** section.
1. Select **Save** from the blade to persist your settings.
1. Back in the **Application settings** tab, select **Save** to persist your settings.
1. In the **Save Changes** confirmation popup dialog, select **Continue**.
1. In the **Save Changes** confirmation popup dialog, select **Continue**.
> **Note**: Wait for your application settings to persist before you move forward with the lab.
Expand Down Expand Up @@ -572,12 +584,12 @@ In this exercise, you used a service identity to read the value of a secret stor
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Storage.Blobs" Version="12.4.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.5.0" />
</ItemGroup>
</Project>
```
> **Note**: The App Service Editor will save changes to the file automatically. This .proj file contains the NuGet package reference necessary to import the [Azure.Storage.Blobs](https://www.nuget.org/packages/Azure.Storage.Blobs/12.4.0) package.
> **Note**: The App Service Editor will save changes to the file automatically. This .proj file contains the NuGet package reference necessary to import the [Azure.Storage.Blobs](https://www.nuget.org/packages/Azure.Storage.Blobs/12.5.0) package.
1. Close the browser window with the **App Service Editor**.
Expand Down Expand Up @@ -638,22 +650,10 @@ In this exercise, you used a service identity to read the value of a secret stor
string connectionString = Environment.GetEnvironmentVariable("StorageConnectionString");
```
1. Add the following line of code to create a new instance of the **BlobServiceClient** class by passing in your *connectionString* variable to the constructor:
```
BlobServiceClient serviceClient = new BlobServiceClient(connectionString);
```
1. Add the following line of code to use the **BlobServiceClient.GetBlobContainerClient** method, while passing in the **drop** container name to create a new instance of the **BlobContainerClient** class that references the container that you created earlier in this lab:
```
BlobContainerClient containerClient = serviceClient.GetBlobContainerClient("drop");
```
1. Add the following line of code to use the **BlobContainerClient.GetBlobClient** method, while passing in the **records.json** blob name to create a new instance of the **BlobClient** class that references the blob that you uploaded earlier in this lab:
1. Add the following line of code to create a new instance of the **BlobServiceClient** class by passing in your *connectionString* variable, a ``"drop"`` string value, and a ``"records.json"`` string value to the constructor:
```
BlobClient blobClient = containerClient.GetBlobClient("records.json");
BlobClient blob = new BlobClient(connectionString, "drop", "records.json");
```
1. Observe the **Run** method, which should now include:
Expand All @@ -668,9 +668,7 @@ In this exercise, you used a service identity to read the value of a secret stor
public static async Task<IActionResult> Run(HttpRequest req)
{
string connectionString = Environment.GetEnvironmentVariable("StorageConnectionString");
BlobServiceClient serviceClient = new BlobServiceClient(connectionString);
BlobContainerClient containerClient = serviceClient.GetBlobContainerClient("drop");
BlobClient blobClient = containerClient.GetBlobClient("records.json");
BlobClient blob = new BlobClient(connectionString, "drop", "records.json");
}
```
Expand Down Expand Up @@ -700,9 +698,7 @@ In this exercise, you used a service identity to read the value of a secret stor
public static async Task<IActionResult> Run(HttpRequest req)
{
string connectionString = Environment.GetEnvironmentVariable("StorageConnectionString");
BlobServiceClient serviceClient = new BlobServiceClient(connectionString);
BlobContainerClient containerClient = serviceClient.GetBlobContainerClient("drop");
BlobClient blobClient = containerClient.GetBlobClient("records.json");
BlobClient blob = new BlobClient(connectionString, "drop", "records.json");
var response = await blobClient.DownloadAsync();
return new FileStreamResult(response?.Value?.Content, response?.Value?.ContentType);
}
Expand Down

0 comments on commit e4cd471

Please sign in to comment.