D306 MaterNotes
D306 MaterNotes
Azure Command-Line Interface (CLI): A set of commands used to create and manage Azure
resources. It is available across Azure services and emphasizes automation.
Azure Container Registry (ACR): A registry of Docker and Open Container Initiative (OCI)
images, supporting all OCI artifacts.
Azure Resource Manager (ARM): The native platform for infrastructure as code (IaC) in
Azure, centralizing the management, deployment, and security of Azure resources.
Network Interface Card (NIC): A hardware component that connects a computer to a network.
Secure Shell Protocol (SSH): A cryptographic network protocol for secure network services
over an unsecured network, notable for remote log-in and command-line execution.
Transmission Control Protocol (TCP): A main protocol of the Internet Protocol (IP) suite,
connection-oriented, establishing connections before data transfer.
Virtual Machine (VM): A software-based compute resource running programs and deploying
apps, operating independently on a physical host machine.
Application Programming Interface (API): Definitions and protocols for building and
integrating application software, enabling communication between applications.
Platform as a Service (PaaS): Cloud computing services allowing provisioning, running, and
managing computing platforms and applications without infrastructure complexity.
Software Development Kit (SDK): A collection of development tools in one package,
facilitating application creation with compilers, debuggers, and frameworks.
File Transfer Protocol (FTP): A standard protocol for transferring files from a server to a client
on a network.
JavaScript Object Notation (JSON): A human-readable file format for data interchange, used
for serializing structured data and exchanging it over a network.
Virtual Private Network (VPN): Extends a private network across a public network, enabling
secure data transmission as if devices were directly connected to the private network.
Request Unit (RU): The unit expressing the cost of database operations in Azure Cosmos DB.
Structured Query Language (SQL): The standard language for relational database
management systems, used for updating and retrieving database data.
Time To Live (TTL): The lifespan of a packet in a network before being discarded by a router.
Microsoft Developer Network (MSDN): Sites for the developer community providing
information, documentation, and discussion authored by Microsoft and the community.
JSON Web Token (JWT): An open standard for sharing security information between a client
and server.
Role-Based Access Controls (RBAC): Fine-grained access control method for Azure
subscription resources.
Shared Access Signatures (SAS): A URI for narrowing access to specific containers inside a
storage account.
Azure Active Directory (Azure AD): Microsoft's cloud-based identity and access management
service.
Azure Instance Metadata Service (IMDS): Service for requesting an OAuth access token from
applications within the VM using managed identities.
Perfect Forward Secrecy (PFS): Encryption system protecting connections with unique keys,
not a protocol.
Azure CDN Profile: Contains endpoints in an application included in the CDN, configuring
content delivery behavior.
Content Delivery Network (CDN): Geographically distributed servers providing fast internet
content delivery closer to users.
Dynamic Content: Content changing based on user interaction, such as dashboards with graphs.
Redis: Open-source cache system functioning as an in-memory data structure store, database
cache, or message broker.
Static Content: Unchanging content for all users, such as images and PDFs.
Transient Faults: Temporary network connectivity loss, service unavailability, or timeouts due
to busy services.
Workflow: Process defining steps or actions for delivering information from the source to the
destination.
Azure API Management (APIM): Service creating an enterprise-grade API for existing back-
end services.
Consumer Groups: View connecting event receiver applications to an event hub using AMQP
protocol.
Chapter Summary
Azure offers computing services to deploy virtualized infrastructure in the cloud and hybrid
architectures connecting on-premises infrastructure with IaaS resources. The Azure Resource
Manager (ARM) manages cloud resources using JSON-based ARM templates.
A container image packages software with code and dependencies for a highly portable
environment. Instances of container images are called containers, stored in registries like Azure
Container Registry.
Azure provides serverless solutions, focusing on code without managing infrastructure. Azure
App Services, the foundation of serverless offerings, include web apps, mobile back-end apps,
REST APIs, Azure Functions, and Azure Durable Functions. App Services are billed for
runtime, operating on App Service Plans with shared resources.
Diagnostics logging in App Services includes webserver logging, detailed error, failed requests,
application diagnostics, and deployment diagnostics, stored locally on the VM.
Scaling in App Services involves horizontal scaling (adding/removing instances) and vertical
scaling (adding/removing VM resources). Autoscale rules manage resource allocation, dependent
on Azure VM scale sets.
Azure Functions, an evolution of WebJobs, use triggers and bindings for function instances,
supporting .NET Framework and .NET Core. Durable Functions extend Azure Functions,
preserving instance states in workflows, with orchestration, activity, and client functions. Azure
Function Apps provide resources for running these functions.
Questions:
1. Approval Workflow: Which Azure service initiates an approval workflow for new
report files in Azure Storage?
2. Performance Issues: How to ensure the application doesn't suffer performance issues
during usage peaks?
Answers:
1. Approval Workflow: Use Azure Durable Functions with a Human Interaction pattern,
starting with Azure Blob Storage triggers.
2. Performance Issues: Deploy Azure Durable Functions to Azure App Service Plans with
autoscale rules based on CPU consumption or specific days, after studying usage
patterns.
Provisioning a VM:
powershell
Copy code
New-AzVM -ResourceGroupName "ResourceGroup" -Name "VMName" -Image
"ImageName" -Location "Location"
powershell
Copy code
New-AzWebApp -ResourceGroupName "ResourceGroup" -Name "AppName" -
Location "Location" -AppServicePlan "AppServicePlan"
powershell
Copy code
func init MyFunctionProj --worker-runtime dotnet
func new --name MyHttpTrigger --template "HTTP trigger"
This condensed summary and key points should aid in preparing for exams and understanding
core concepts.
Chapter 2
Section 2.1: Develop Solutions That Use Cosmos DB Storage
Cosmos DB: A globally distributed, multi-model database service that provides low-
latency access to data.
PartitionKey: Defines the logical partition where the entity is stored in Cosmos DB.
Choosing the correct PartitionKey is crucial for performance.
API for Cosmos DB: Cosmos DB supports various APIs, including SQL, Table, Gremlin
(Graph), MongoDB, and Cassandra.
Logical Partition: Each logical partition can store up to 20 GB of data.
Consistency Levels: There are five consistency levels in Cosmos DB:
o Strong: Offers the highest level of consistency with higher latency.
o Bounded Staleness: Guarantees consistency within a specified time window.
o Session: Consistency is guaranteed within a single session.
o Consistent Prefix: Ensures that reads never see out-of-order writes.
o Eventual: Offers the lowest consistency with the lowest latency.
Important Points
Study Notes
Avoiding "Hot Spots": Choose partition keys that distribute data evenly across
partitions to prevent overloading a single partition.
Consistency Levels: Understand the trade-offs between different consistency levels to
choose the best one for your application's needs.
Chapter Summary
Cosmos DB: Provides globally distributed, low-latency access to data with multiple APIs
and consistency levels.
PartitionKey: Critical for performance; must be chosen carefully.
Custom Indexes: Enhance query performance.
Consistency Levels: Five levels offering trade-offs between consistency and latency.
Lifecycle Management: Policies to manage data movement and storage cost efficiency.
powershell
Copy code
az cosmosdb update `
--name $cosmosDBAccount `
--resource-group $resourceGroupName `
--default-consistency-level "Session"
1. Partition Key Hot Spots: To resolve "hot spots," change the partition key to distribute
data more evenly across partitions. This requires creating a new container with the new
partition key and migrating the data using the AzCopy tool.
2. Long-term Storage: Upgrade to a Gen2 Storage Account and use lifecycle management
policies to automatically move data to the archive tier for cost-effective long-term
storage.
Blob Storage: Azure's service for storing large amounts of unstructured data such as text
or binary data.
Access Tiers: Different pricing tiers based on access frequency:
o Hot: For data that is accessed frequently.
o Cool: For data that is infrequently accessed.
o Archive: For data that is rarely accessed.
Lifecycle Management: Policies that automatically move data between access tiers
based on specified criteria.
Important Points
Blob Storage Movement: You can move blob items between containers within the same
Storage Account or between different Storage Accounts.
Access Tiers: Use cool and archive tiers for cost savings on infrequently accessed data.
SDK Interaction: Use appropriate SDKs (Software Development Kits) to interact with
and manage Blob Storage data.
Study Notes
Chapter Summary
Blob Storage: Provides scalable and cost-effective storage for large amounts of
unstructured data.
Access Tiers: Different pricing tiers help manage storage costs based on data access
frequency.
Lifecycle Management: Automates data movement between access tiers to optimize
storage costs.
powershell
Copy code
$resourceGroupName = "YourResourceGroupName"
$storageAccountName = "YourStorageAccountName"
$containerName = "YourContainerName"
json
Copy code
{
"rules": [
{
"name": "MoveToCool",
"enabled": true,
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToCool": {
"daysAfterModificationGreaterThan": 30
}
}
},
"filters": {
"blobTypes": ["blockBlob"]
}
}
},
{
"name": "MoveToArchive",
"enabled": true,
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToArchive": {
"daysAfterModificationGreaterThan": 180
}
}
},
"filters": {
"blobTypes": ["blockBlob"]
}
}
}
]
}
1. Handling "Hot Spots" in Blob Storage: Implement appropriate lifecycle policies and
use the correct access tiers to manage storage efficiently.
2. Cost-Effective Long-Term Storage: Use lifecycle management and access tiers to move
processed data to the archive tier, ensuring cost-effective long-term storage.
These summaries provide condensed insights and definitions from Chapter 2, covering sections
2.1 and 2.2 of the study material on Cosmos DB storage and Blob Storage, along with key terms,
study notes, chapter summaries, important code snippets, and thought experiment answers.
Study Notes:
2. Partitioning Schemes:
o Logical Partitions: Share the same partition key.
o Physical Partitions: Group of replicas managed by Azure.
o Choosing Partition Key: Avoid "hot spots" by distributing data
evenly.
csharp
Copy code
await this.container.UpsertItemAsync(person);
await this.container.DeleteItemAsync<Person>(person1.Id,
partitionKey);
4. Consistency Levels:
o Adjust based on application needs for performance vs. data
consistency.
o Use session consistency for a balanced approach.
6. Server-Side Programming:
o Write stored procedures, triggers, and user-defined functions in
JavaScript.
o Example Stored Procedure:
javascript
Copy code
function createNewDocument(docToCreate) {
var context = getContext();
var container = context.getCollection();
var response = context.getResponse();
var accepted =
container.createDocument(container.getSelfLink(), docToCreate,
function (err, docCreated) {
if (err) throw new Error('Error creating a new document: '
+ err.message);
response.setBody(docCreated);
});
if (!accepted) return;
}
Chapter Summary:
1. Blob Storage: Ideal for storing unstructured data like images, videos, and
documents.
2. Access Tiers:
o Hot: Frequently accessed data.
o Cool: Infrequently accessed data.
o Archive: Rarely accessed data.
3. Azure Storage Explorer: Graphical tool for managing Azure Storage
services.
4. AzCopy: Command-line tool for bulk copy operations.
5. Lifecycle Management Policies: Automate movement between access
tiers.
Study Notes:
bash
Copy code
azcopy copy <URL_Source_Item><Source_SASToken>
<URL_Target_Container><Target_SASToken>
csharp
Copy code
container.Metadata.Add("department", "Technical");
container.SetMetadata();
csharp
Copy code
BlobServiceClient sourceClient = new
BlobServiceClient(SourceSASConnectionString);
BlobServiceClient destinationClient = new
BlobServiceClient(DestinationSASConnectionString);
await
destinationBlobReference.StartCopyFromUriAsync(sourceBlobReference
.Uri);
await sourceBlobReference.DeleteAsync();
Chapter Summary: