Learning Microsoft Azure Fundamentals for AZ 900 Exam Day 20

Learning Microsoft Azure Fundamentals for AZ 900 Exam Day 20

·

5 min read

Today Day 20 of #AzureFundamentals, I have completed Units 5,6 /9 of Modules 3/4 of LP 2 Describe Azure architecture and services, Azure Fundamentals for Exam AZ 900.

LP 2Describe Azure architecture and services
Module 3/4Describe Azure Storage Services
Unit 5,6/95. Exercise - create a storage blob,
6. Identify Azure data migration options.

I. Unit 5/9

Azure Portal

Page 1

Page 2

Azure Learn Sandbox CLI

Page 3

Task - 1

Create a storage account using az storage account create , the SKU of the storage account defaults to ' Standard _RAGRS'

Learn Microsoft Docs [Link]

  •   az storage account create \
          --name mytempstorageaccount \
          --resource-group learn.. \
          --access-tier hot \
          --kind blobstorage \
          --location westus \
          --sku standard_LRS
    

Microsoft learn Sandbox will create a storage account automatically,

list storage accounts,

  •   az storage account list
    

output

  •   output 
      [
        {
          "accessTier": null,
          "allowBlobPublicAccess": true,
          "allowCrossTenantReplication": null,
          "allowSharedKeyAccess": null,
          "allowedCopyScope": null,
          "azureFilesIdentityBasedAuthentication": null,
          "blobRestoreStatus": null,
          "creationTime": "2023-08-28T08:42:09.470039+00:00",
          "customDomain": null,
          "defaultToOAuthAuthentication": null,
          "dnsEndpointType": null,
          "enableHttpsTrafficOnly": false,
          "enableNfsV3": null,
          "encryption": {
            "encryptionIdentity": null,
            "keySource": "Microsoft.Storage",
            "keyVaultProperties": null,
            "requireInfrastructureEncryption": null,
            "services": {
              "blob": {
                "enabled": true,
                "keyType": "Account",
                "lastEnabledTime": "2023-08-28T08:42:09.876276+00:00"
              },
              "file": {
                "enabled": true,
                "keyType": "Account",
                "lastEnabledTime": "2023-08-28T08:42:09.876276+00:00"
              },
              "queue": null,
              "table": null
            }
          },
          "extendedLocation": null,
          "failoverInProgress": null,
          "geoReplicationStats": null,
          "id": "/subscriptions/01383f7e-b3be-4607-a9f3-b77a8c998aa5/resourceGroups/learn-f1359616-78eb-4e80-9a9a-dfc528bf09ad/providers/Microsoft.Storage/storageAccounts/cloudshell1340719050",
          "identity": null,
          "immutableStorageWithVersioning": null,
          "isHnsEnabled": null,
          "isLocalUserEnabled": null,
          "isSftpEnabled": null,
          "keyCreationTime": {
            "key1": "2023-08-28T08:42:09.595035+00:00",
            "key2": "2023-08-28T08:42:09.595035+00:00"
          },
          "keyPolicy": null,
          "kind": "Storage",
          "largeFileSharesState": null,
          "lastGeoFailoverTime": null,
          "location": "southeastasia",
          "minimumTlsVersion": "TLS1_0",
          "name": "cloudshell1340719050",
          "networkRuleSet": {
            "bypass": "AzureServices",
            "defaultAction": "Allow",
            "ipRules": [],
            "resourceAccessRules": null,
            "virtualNetworkRules": []
          },
          "primaryEndpoints": {
            "blob": "https://cloudshell1340719050.blob.core.windows.net/",
            "dfs": null,
            "file": "https://cloudshell1340719050.file.core.windows.net/",
            "internetEndpoints": null,
            "microsoftEndpoints": null,
            "queue": "https://cloudshell1340719050.queue.core.windows.net/",
            "table": "https://cloudshell1340719050.table.core.windows.net/",
            "web": null
          },
          "primaryLocation": "southeastasia",
          "privateEndpointConnections": [],
          "provisioningState": "Succeeded",
          "publicNetworkAccess": null,
          "resourceGroup": "learn-f1359616-78eb-4e80-9a9a-dfc528bf09ad",
          "routingPreference": null,
          "sasPolicy": null,
          "secondaryEndpoints": null,
          "secondaryLocation": "eastasia",
          "sku": {
            "name": "Standard_GRS",
            "tier": "Standard"
          },
          "statusOfPrimary": "available",
          "statusOfSecondary": "available",
          "storageAccountSkuConversionStatus": null,
          "tags": {
            "ms-resource-usage": "azure-cloud-shell",
            "x-created-by": "productsandboxes"
          },
          "type": "Microsoft.Storage/storageAccounts"
        }
      ]
    

Show storage account properties,

  •   az storage account show \
          -g learn.. \
          -n mytempstorageaccount
    

Update the properties of the storage account,

  •   az storage account update
    

storage account keys,

  •   az storage account keys list \
      --account-name cloudshell1340719050
    

Output

  •   Output:
    
      [
        {
          "creationTime": "2023-08-28T08:42:09.595035+00:00",
          "keyName": "key1",
          "permissions": "FULL",
          "value": "3oLB3qb9KD9DBwtc8YZ8PGkcsCl5NvuMxSY77OqhowyaV9qcI1FajgYxFpbNCLzitirH7NTGfNtP+ASt6p/2MQ=="
        },
        {
          "creationTime": "2023-08-28T08:42:09.595035+00:00",
          "keyName": "key2",
          "permissions": "FULL",
          "value": "yaSfn50548aWutm7YPSdeAD7t4BWX1rri0TnJVNiUDlS4aSb/X9sd4uEmrTp2LJcUTRKc/H1TlAE+AStCnCe6Q=="
        }
      ]
    

Storage account connection string,

  •   az storage account show-connection-string \
      --resource-group learn-f1359616-78eb-4e80-9a9a-dfc528bf09ad \
      --name cloudshell1340719050
    

Output

  •   {
        "connectionString": 
      "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;
      AccountName=cloudshell1340719050;
      AccountKey=3oLB3qb9KD9DBwtc8YZ8PGkcsCl5NvuMxSY77OqhowyaV
      9qcI1FajgYxFpbNCLzitirH7NTGfNtP+ASt6p/2MQ==;
      BlobEndpoint=https://cloudshell1340719050.blob.core.windows.net/;
      FileEndpoint=https://cloudshell1340719050.file.core.windows.net/;
      QueueEndpoint=https://cloudshell1340719050.queue.core.windows.net/;
      TableEndpoint=https://cloudshell1340719050.table.core.windows.net/"
      }
    

Task - 2 .1

create a container in a storage account,

By default, container data is private (off) to account owner.

Use blob to allow public read access for blobs.

Use container to allow public read access and list access to the entire container.

list container in a storage account,

  •   az storage container list \
      --account-name cloudshell1340719050 \
      --connection-string "DefaultEndpointsProtocol=https;
      EndpointSuffix=core.windows.net;AccountName=cloudshell1340719050;
      AccountKey=3oLB3qb9KD9DBwtc8YZ8PGkcsCl5NvuMxSY77Oqhowya
      V9qcI1FajgYxFpbNCLzitirH7NTGfNtP+ASt6p/2MQ==;
      BlobEndpoint=https://cloudshell1340719050.blob.core.windows.net/;
      FileEndpoint=https://cloudshell1340719050.file.core.windows.net/;
      QueueEndpoint=https://cloudshell1340719050.queue.core.windows.net/;
      TableEndpoint=https://cloudshell1340719050.table.core.windows.net/"
    

Output

  •   []
    

create a container in a storage account,

  •   az storage container create \
          --name mytempstoragecontainer \
          --account-name cloudshell1340719050 \
          --public-access off \
          --resource-group learn-f1359616-78eb-4e80-9a9a-dfc528bf09ad
    

Output,

Now, execute the list storage container,

Output

  •   [
        {
          "deleted": null,
          "encryptionScope": {
            "defaultEncryptionScope": "$account-encryption-key",
            "preventEncryptionScopeOverride": false
          },
          "immutableStorageWithVersioningEnabled": false,
          "metadata": null,
          "name": "mytempstoragecontainer",
          "properties": {
            "etag": "\"0x8DBA7A492550206\"",
            "hasImmutabilityPolicy": false,
            "hasLegalHold": false,
            "lastModified": "2023-08-28T08:55:47+00:00",
            "lease": {
              "duration": null,
              "state": "available",
              "status": "unlocked"
            },
            "publicAccess": null
          },
          "version": null
        }
      ]
    

Page 4

Task - 2.2

az blob storage

Manage object storage for unstructured data (blobs)

List blob,

  •   az storage blob list \
      --container-name mytempstoragecontainer \
      --account-name cloudshell1340719050
    

Output

  •   []
    

Upload a file to a storage blob,

create a new blog from a file path, or updates the content of an existing blob with automatic chunking and progress notifications,

  •   az storage blob upload \
          --file /path/to/file \
          --container-name mytempstoragecontainer \
          --name mytempblob
    

Uploading file inside Learn Sandbox Environment is not possible so I

uploaded data to blob,

  •   az storage blob upload --data "testing blob from azure learn sandbox cli" \
      --container-name mytempstoragecontainer \
      --name mytempblob \
      --account-name cloudshell1340719050 \
      --account-key "3oLB3qb9KD9DBwtc8YZ8PGkcsCl5NvuMxSY77Oqho
      wyaV9qcI1FajgYxFpbNCLzitirH7NTGfNtP+ASt6p/2MQ==" \
      --overwrite
    

create the URL to access a blob,

  •   az storage blob url \
      --container-name mytempstoragecontainer \
      --name mytempblob \
      --account-name cloudshell1340719050 \
      --account-key "3oLB3qb9KD9DBwtc8YZ8PGkcsCl
      5NvuMxSY77OqhowyaV9qcI1FajgYxFpbNCLzitirH7NTGfNtP+ASt6p/2MQ=="
    

Output

  •   https://cloudshell1340719050.blob.core.windows.net/mytempstoragecontainer/mytempblob
    

Copy the URL from the URL field and paste it into a new tab,

you will get error because the public access level is set to off,

Task - 3

Change the access level of your blob

  •   az storage container set-permission \
         --account-name  cloudshell1340719050  \
         --name  mytempstoragecontainer \
         --public-access blob
    

Refresh the tab where you attempted to access the file earlier.

Since I uploaded a data string, I received a txt file,

Output

II. Unit 6/9

Page 4

Page 5

Page 6

Page 7

Conclusion

Learning Objectives,

  1. Exercise - create a storage blob,

  2. Identify Azure data migration options.

Source: Microsoft Azure Fundamentals [Link]

Author: Dheeraj.y

Connect with me:

Did you find this article valuable?

Support dheerajy by becoming a sponsor. Any amount is appreciated!