/pluralsight-azure-cors-storage

Pluralsight course materials for Microsoft Azure Developer: Configuring CORS with Storage

Primary LanguageHTMLApache License 2.0Apache-2.0

Microsoft Azure Developer: Configuring CORS Access for Storage Pluralsight Course Materials

These materials are for the Pluralsight course Microsoft Azure Developer: Configuring CORS Access for Storage. The license is Apache 2.0. Static site image content is royalty free and available for any use through Pexels, see blob-container-files/credits.txt.

Course overview screenshot

Table of Contents

  1. Organization
  2. Azure Storage Postman Collection
  3. Errata
  4. Updates
  5. Troubleshooting
  6. Additional Resources

Organization

Course materials are organized by module number and clip descriptions. The blob-container-files are the files you can upload to your own Azure Storage account to demo with.

Azure Storage Postman Collection

I've built a Postman collection that contains some pre-request scripts that automatically generate the appropriate Authorization HTTP header with signature to sign requests.

To use the collection:

  1. Download the JSON file under Module 3\demo-azure-rest\Azure Storage REST API.postman_collection.json
  2. Open the Postman app
  3. Click the orange "Import" button
  4. Choose the file
  5. Import it
  6. Edit the new collection using the "..." menu
  7. Go to the Variables tab
  8. Fill in the variables for:
    • azure_storage_account - Your Azure Storage account name
    • azure_storage_key - Your secret Storage key

The rest of the variables will be filled in automatically.

You should now be able to take advantage of the Postman requests I've created for the REST API demo and to create other Azure Storage REST requests if you wish.

The Postman collection is open source and you can contribute to it: https://github.com/kamranayub/azure-storage-rest-postman

Errata

None yet

Please report course issues using the Issues page or the Pluralsight discussion page.

Updates

  • April 2020

    • Enhancement: Updated Azure ARM clip to cover deploying CORS through ARM templates
    • Enhancement: Updated clips with latest website updates throughout
    • Fix: Removed section on blank CORS values in Portal, as that is allowed now
  • Jun 2019

    • Enhancement: Update content to use Az PowerShell module
  • Oct 2018

    • Initial release 🎉

Common Issues

Creating the Demo Storage Account

The demo storage account used (psazurestoragecors) is a General Purpose v2 Storage Account, see Quickstart: Create a storage account.

You can then upload the contents of the blob-container-files folder to a blob container named cors. After that, you can follow along with the demos.

Ensure you are on the right subscription for automation

To manage the storage account and other resources we create in the demos, you will need to ensure you have the right Azure Subscription set by default when running commands. You only need to do this if you have multiple subscriptions.

In Azure PowerShell SDK:

Set-AzContext -SubscriptionId <Subscription ID>

In Azure CLI:

az account set -s <Subscription ID>

Ensure you have the correct Az and Azure.Storage PowerShell modules installed

If some commands are failing or you don't see what I'm showing during the course, you may have incorrect modules installed that are overwriting newer ones.

Execute the following commands:

Get-Module -ListAvailable -Name Az -Refresh
Get-Module -ListAvailable -Name Azure.Storage -Refresh

If you see more than one entry for each module, it means you may have an old SDK installed. Remove all but the latest versions you installed when walking through the course demos.

For Azure CLI, set your environment variables

For the Azure CLI demos, you will need to set the following storage account environment variables:

export AZURE_STORAGE_ACCOUNT=<storage account name>
export AZURE_STORAGE_KEY="<storage account key>"

Replace the values with actual values from your Azure account. Note the quotes (") are important around the key as it may contain special characters.

Additional Resources

Azure Storage

Tools and SDKs

CORS