Coding, especially with C#, is not a big part of the DP‐203 exam, but knowing about the available SDKs might come up. Table 2.7 provides an overview of the most relevant SDKs in the scope of the DP‐203 exam. A complete list of all Azure SDKs for .NET can be found at https://docs.microsoft.com/dotnet/azure/sdk/packages.
TABLE 2.7 Azure SDKs packages
Category | Product | NuGet package |
Analytics | Azure Synapse Analytics | Azure.Analytics.Synapse.Artifacts |
Analytics | Azure Databricks | Microsoft.Azure.Databricks.Client |
Analytics | Azure HDInsight | Microsoft.Azure.HDInsight.Job |
Analytics | Azure Analysis Services | Microsoft.Azure.Management.Analysis |
Analytics | Azure Data Factory | Microsoft.Azure.Management.DataFactory |
Analytics | Azure Spark | Azure.Analytics.Synapse.Spark |
Database | Azure SQL | Microsoft.Azure.Management.Sql |
Database | Azure Cosmos DB | Azure.Cosmos |
Logging | Azure Core | Azure.Core |
Messaging | Azure Event Hubs | Azure.Messaging.EventHubs |
Monitoring | Azure Monitor | Azure.Monitor.Query |
Governance | Log Analytics | Microsoft.ApplicationInsights.TraceListner |
Security | Azure Active Directory | Microsoft.Azure.Services.AppAuthentication |
Security | Azure Identity | Azure.Identity |
Storage | Azure Data Lake Storage | Azure.Storage.Files.DataLake |
Storage | Azure Storage | Azure.Storage |
Streaming | Azure Stream Analytics | Microsoft.Azure.Management.StreamAnalytics |
All of the SDKs are open source and available on GitHub, which can help you figure out what capabilities exist in these assemblies (SDKs). It is often the case that new technologies, features, and capabilities have limited documentation. Therefore, you need to be creative and curious about finding out how to properly use and discover the capabilities. Here is an example of the way to find out what you can do with these assemblies using the Azure.Analytics.Synapse.Artifacts assembly. The first action is to install the assembly into a Visual Studio Console App project using the following command:
Install-Package Azure.Analytics.Synapse.Artifacts
That command is executed within the Package Manager Console in Visual Studio. Then choose the Class View menu option, which displays the classes and methods contained in the assembly. If there are no examples of what you need to code, you must proceed with trial and error until you get something that works. Figure 2.22 illustrates the previously described scenario.
FIGURE 2.22 Visual Studio C# code example
It might be a bit difficult to visualize where to use an SDK, or where to execute the code that runs the application that implemented the SDK logic. As seen in Figure 2.23, there are two places where applications that use SDKs can run: on a client device or on a server. In Visual Studio, if you created a Console app or a Windows Presentation Foundation (WPF) app, then once it’s compiled, you can run it on a workstation. In that scenario, the code needs to be deployed to numerous client machines, once for each person who uses it. Alternatively, you can create an ASP.NET web app that runs on a web server such as an Azure web app. When you run the SDK on an Azure web app, the code is deployed only to a single machine and typically accessed using a browser.
FIGURE 2.23 Where to implement and use an SDK
Recall Exercise 2.2 when you sent brainwaves in JSON format to an Azure Cosmos DB. You accomplished this using the Azure Cosmos DB SDK.
REST APIs
When you create a WPF app or an ASP.NET web app, there is usually some kind of interface. An interface (a GUI) consists of menus, buttons, and text boxes you click to perform a task. The SDKs you have implemented will ultimately call a REST API, which is exposed by the Azure resource provider. Alternatively, to use the SDKs, you can call the Azure REST APIs directly. You’ll find a list of all Azure REST APIs at https://docs.microsoft.com/rest/api/azure. For example, if you wanted to get a table that is running on an Azure Synapse SQL pool, here is an example. The following is broken out into numerous lines, but in reality all this must be on a single line with no breaks, like a link in a browser window:
GET https://management.azure.com/subscriptions/{subscriptionId}/
resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/
workspaces/{workspaceName}/sqlPools/{sqlPoolName}/
schemas/{schemaName}/tables/{tableName}?api-version=2021-06-01
The result provides a context to the requested table, which you could then use to perform further actions on. The benefit to using an SDK is that you have classes and methods that can guide you through the implementation of the Azure product features and capabilities. If you want the most flexibility or find some feature in a REST API that has not yet been implemented in the SDK, then you might get a bit ahead of the game.