代写 html scala SQL parallel database Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Azure Table Storage and Visual Studio Connected Services

Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Azure Table Storage and Visual Studio Connected Services
Lab 8: Get started with Azure Table storage and Visual Studio connected services (ASP.NET Core)
Azure Table storage enables you to store large amounts of structured data. The service is a NoSQL datastore that accepts authenticated calls from inside and outside the Azure cloud. Azure tables are ideal for storing structured, non-relational data.
This tutorial shows how to write ASP.NET code for some common scenarios using Azure table storage entities. These scenarios include creating a table, and adding, querying, and deleting table entities.
a.
1. 2.
Create an ASP.NET application project
 Estimation time for this section A: 5 Minutes
Open Visual Studio. From the main menu, select File > New > Project.
In the New Project dialog box, select Web > ASP.NET Core Web
Application > StorageAspNet. Then select OK.
3.
In the New ASP.NET Core Web Application dialog box, select .NET
Core > ASP.NET Core 2.0 > Web Application (Model-View-Controller). Then
select OK.
Level 3
Asia Pacific University of Technology & Innovation
Page 1 of 25

Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Azure Table Storage and Visual Studio Connected Services
b.
1. 2.
Use connected services to connect to an Azure storage account.
 Estimation time for this section B: 10 Minutes In Solution Explorer, right-click the project.
From the context menu, select Add > Connected Service.
In the Connected Services dialog box, select Cloud Storage with Azure Storage, and then select Configure.
3.
Level 3
Asia Pacific University of Technology & Innovation Page 2 of 25

Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Azure Table Storage and Visual Studio Connected Services
4.
In the Azure Storage dialog box, select the Azure storage account to be used for this tutorial. To create a new Azure storage account, select Create a New Storage Account, and complete the form.
After selecting either an existing storage account or creating a new one, select Add. Visual Studio installs the NuGet package for Azure Storage, and a storage connection string to appsettings.json.
Level 3
Asia Pacific University of Technology & Innovation Page 3 of 25
5.

Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Azure Table Storage and Visual Studio Connected Services
Level 3 Asia Pacific University of Technology & Innovation Page 4 of 25

Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Azure Table Storage and Visual Studio Connected Services
c.
Create a controller.
 Estimation time for this section C: 10 Minutes
1. In Solution Explorer, create a Controllers folder. Then, right-click Controllers.
2. From the context menu, select Add > Controller.
Level 3
Asia Pacific University of Technology & Innovation
Page 5 of 25
3. In the Add Scaffold dialog box, select MVC Controller – select Add.
Empty, and
4. In the Add Empty MVC Controller dialog box, name the controller TablesController, and select Add.
5. Add the following using directives to the TablesController.cs file:
using System.IO;
using Microsoft.Extensions.Configuration;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.WindowsAzure.Storage.Auth;

Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Azure Table Storage and Visual Studio Connected Services
d. Createamodelclass.
 Estimation time for this section D: 5 Minutes
Many of the examples in this article use aTableEntity-derived class called CustomerEntity. The following steps guide you through declaring this class as a model class.
1. In the Solution Explorer, right-click Models, and, from the context menu, select Add > Class.
2. On the Add New Item dialog, name the class, CustomerEntity.
3. Open the CustomerEntity.cs file, and add the following using directive: using Microsoft.WindowsAzure.Storage.Table;
4. Modify the class so that, when finished, the class is declared as in the following code. The class declares an entity class called CustomerEntity that uses the customer’s first name as the row key and last name as the partition key.
Level 3
Asia Pacific University of Technology & Innovation Page 6 of 25

Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Azure Table Storage and Visual Studio Connected Services
e. Create a table.
 Estimation time for this section E: 10 Minutes The following steps illustrate how to create a table.
1. Open the TablesController.cs file.
2. Add a method called CreateTable that an ActionResult.
3. In Solution Explorer, right-click the Views folder. From the context menu, select Add > New Folder. Name the new folder Tables.
4. In Solution Explorer, expand the Views folder, and right-click Tables. From the context menu, select Add > View.
Level 3
Asia Pacific University of Technology & Innovation Page 7 of 25

Design and Developing Application in Cloud (CT071-3-5-3-DDAC) Azure Table Storage and Visual Studio Connected Services
5. In the Add MVC View box, enter CreateTable for the view name, and select Add.
6. Open CreateTable.cshtml, and modify it so that it looks like the following code snippet:
7. In Solution Explorer, expand the Views > Shared folder, and
open _Layout.cshtml. Look for the unordered list that looks like this: