Table of contents

  1. Introduction
  2. Create the storage account and manage identity.
  3. Secure access to the storage account with a key vault and key.
  4. Configure the storage account to use the customer-managed key in the key vault
  5. Configure a time-based retention policy and an encryption scope.4.

First, click on the link and follow the instructions from the cloud projects.
(https://microsoftlearning.github.io/Secure-storage-for-Azure-Files-and-Azure-Blob-Storage/Instructions/Labs/LAB_04_storage_web_app.html)
Introduction

Introduction
Setting up storage on the Azure portal is a crucial step when launching a new company app. This guide provides a clear, step-by-step process to configure storage that ensures your app's data is secure, scalable, and easily accessible. Whether you're managing user data or application resources, this guide equips you with the tools to support your app's success in a reliable cloud environment.

2.0. Create the storage account and managed identity.
2.1. Provide a storage account for the web app.
In the portal, search for and select Storage accounts.
Select + Create.
cap
For the Resource group select Create New. Give your resource group a name and select OK to save your changes.
vad
Provide a Storage account name. Ensure the name is unique and meets the naming requirements.
pad
Move to the Encryption tab and check the box for Enable infrastructure encryption.
fad
Notice the warning, This option cannot be changed after this storage account is created.
don
Select Review + Create.
bob
dam
Wait for the resource to deploy and go to resource.
done
done
2.2. Provide a managed identity for the web app to use.
Search for and select Managed identities and Select Create.
dat
bag
Select your resource group.
done
Give your managed identity a name.
great
Select Review and Create.
bad
Go to the Resource.
gad
gad
2.3. Assign the correct permissions to the managed identity. The identity only needs to read and list containers and blobs.
Search for and select your storage account **and **select the Access Control (IAM) blade.
Deb
Select Add role assignment (center of the page).
done
On the Job functions roles page, search for and select the Storage Blob Data Reader role.
ged
On the Members page, select Managed identity.
hop
Select Select members, in the Managed identity drop-down select User-assigned managed identity, and select the managed identity you created in the previous step **.
dan.
**Click Select and then Review + assign the role
.
fad
Select Review + assign a second time to add the role assignment.
jag
Your storage account can now be accessed by a managed identity with the Storage Data Blob Reader permissions.
good.
3.0. Secure access to the storage account with a key vault and key.
3.1. To create the key vault and key needed for this part of the lab, your user account must have Key Vault Administrator permissions.
In the portal, search for and select Resource Groups.
doc
Select your resource group, and then the Access Control (IAM) blade.
fad
Select Add role assignment.
ten
On the Job functions roles page, search for and select the Key Vault Administrator role.
got
On the Members page, select User, group, or service principal.
Select Select members
.
bop
dat
Search for and select your user account. Your user account is shown in the top right of the portal.
bar
Click Select and then Review + Assign.
good
dat
Select Review + assign a second time to add the role assignment.
vop
You are now ready to continue with the lab.
3.2. Create a key vault to store the access keys.
In the portal, search for and select Key Vaults.
good
Select Create.
bon
Select your resource group.
done
Provide the name for the key vault. The name must be unique.
vok
Ensure on the Access configuration tab that Azure role-based access control (recommended) is selected.
nab
Select Review + Create.
bol
Wait for the validation checks to complete and then select Create.
lop
After the deployment, select Go to the resource.
tok
On the Overview blade ensure both Soft-delete and Purge protection are enabled.
hol
vat
3.3. Create a customer-managed key in the key vault.
Select the Keys blade in your key vault in the Objects section.
vat
Select Generate/Import and Name the key.
hop
nab
Take the defaults for the rest of the parameters, and Create the key.
bab
fad
4.0. Configure the storage account to use the customer-managed key in the key vault.
4.1. Before you can complete the next steps, you must assign the Key Vault Crypto Service Encryption User role to the managed identity.
In the portal, search for and select Resource Groups.
gem
Select your resource group, and then the Access Control (IAM) blade.
boj
Select Add role assignment.
ban
On the Job functions roles page, search for and select the Key Vault Crypto Service Encryption User role.
bed
On the Members page, select Managed identity.
ham
Select Select members, in the Managed identity drop-down select User-assigned managed identity.
gom
Select your managed identity.
bad
Click Select and then Review + assign.
do
Select Review + assign a second time to add the role assignment.
bon
fad
4.2. Configure the storage account to use the customer-managed key in your key vault.
Return to your storage account.
nab
In the Security + networking section, select the Encryption blade.
Select Customer-managed keys
.
ede
Select a key vault and key then Select your key vault and key.
sag
Select to confirm your choices.
poj
Ensure the Identity type is User-assigned.
nao
Select an identity.
ban
Select your managed identity then select Add.
bob
Save your changes.
baf
hod
If you receive an error that your identity does not have the correct permissions, wait a minute and try again.
5.0. Configure a time-based retention policy and an encryption scope.
5.1. Navigate to your storage account.
bat
In the Data storage section, select the Containers blade.
man
Create a container called hold. Take the defaults. Be sure to Create the container.
blob
Upload a file to the container.
pad
gau
In the Settings section, select the Access policy blade.
gok
In the Immutable Blob storage section, select + Add policy.
get
For the Policy type, select time-based retention, set the retention period to 5 days, and Save your changes.
get
Please try to delete the file in the container and verify that you are notified that you failed to delete blobs due to policy.
bag
5.2. The developers require an encryption scope that enables infrastructure encryption.
Navigate back to your storage account, in the Security + networking blade, select Encryption.
fad
In the Encryption scopes tab, select Add and give your encryption scope a name.
dem
The Encryption type is Microsoft-managed key and set Infrastructure encryption to Enable and then create the encryption scope.
bag
back
Return to your storage account and create a new container.
bed
gad
Notice on the New container page, there is the Name and Public access level.
gap
Notice in the Advanced section you can select the Encryption scope you created and apply it to all blobs in the container.
deb
gok
In conclusion, providing storage for your new company app on the Azure portal is a straightforward process when broken into manageable steps. By leveraging Azure's powerful features and intuitive interface, you can ensure secure and efficient storage tailored to your app's needs. This guide aims to empower you to make informed decisions and optimize your cloud storage setup, setting a strong foundation for your app's success. Happy building!