DEV Community

Cover image for Provide storage for a new company app
okunola babatunde
okunola babatunde

Posted on

Provide storage for a new company app

When building a new application in today’s cloud-driven world, storage is no longer just about saving data — it’s about protecting it.
The company which designs and develops a new app, its utmost goal is clear: create a storage environment that is secure, controlled, and built with best practices from day one. Developers want storage access to happen only through secure access keys and managed identities. This eliminates risky, anonymous access and ensures that every request to the storage layer is traceable and authenticated.

Beyond authentication, the team plans to implement Role-Based Access Control (RBAC). In simple terms, this means giving the right people and services the right level of access — nothing more, nothing less. Developers get what they need to build, operations teams get what they need to manage, and no one has unnecessary permissions. This “least privilege” approach reduces security risks while improving governance and accountability.

To support testing and validation, the company also requires protected immutable storage. This ensures that critical test data cannot be altered or deleted — even accidentally. Whether it’s for compliance validation, audit preparation, or resilience testing, immutability adds an extra layer of confidence that data integrity is preserved.

This isn’t just about infrastructure. It’s about building a secure-by-design application architecture — one that prioritizes identity, governance, and data protection from the very beginning.
Because in today’s cloud environment, security is not an add-on. It’s the foundation.

Here in this article, I have clearly highlighted and anotated this with the series of screenshots to facilitate the ease of understanding these step-by-step guides you need to follow to achieve this as a young cloud engineer who is trying to understand the basis of cloud infrastructure e.g. storage and many more.

Create the storage account and managed identity

  1. Provide a storage account for the web app.
  • In the portal, search for and select Storage accounts.

  • Select + Create.
    Image Select + Create.

  • For Resource group select Create new. Give your resource group a name and select OK to save your changes.
    Image For Resource group select Create new. Give your resource group a name and select OK to save your changes.

  • Provide a Storage account name.
    Image Provide a Storage account name.

  • Move to the Encryption tab.
    Image Move to the Encryption tab.

  • Check the box for Enable infrastructure encryption.
    Image heck the box for Enable infrastructure encryption.

  • Notice the warning, This option cannot be changed after this storage account is created.
    Image Notice the warning, This option cannot be changed after this storage account is created.

  • Select Review + Create.
    Image Select Review + Create.

  • Wait for the resource to deploy.

  1. Provide a managed identity for the web app to use.
  • Search for and select Managed identities

  • Select Create.
    Image Select Create.

  • Select your resource group.
    Image Select your resource group.

  • Give your managed identity a name.

  • Select Review and create, and then Create.

2. 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.

  • Select the Access Control (IAM) blade.

  • Select Add role assignment (center of the page).

  • In the Job functions roles page, search for and select the Storage Blob Data Reader role.
    Image in the Job functions roles page, search for and select the Storage Blob Data Reader role.

  • On the Members page, select Managed identity.
    Image On the Members page, select Managed identity.

  • Select Select members, in the Managed identity drop-down select User-assigned managed identity
    Image Select Select members, in the Managed identity drop-down select User-assigned managed identity

  • Select the managed identity you created in the previous step.
    Image Select the managed identity you created in the previous step.

  • Click Select and then Review + assign the role.
    Image Click Select

  • Select Review + assign a second time to add the role assignment.
    Image Select Review + assign a second time to add the role assignment.

  • Your storage account can now be accessed by a managed identity with the Storage Data Blob Reader permissions. With this type of permission, you can only access the contents of your storage but but you wont be able to change or edit the contents.
    Image Your storage account can now be accessed by a managed identity with the Storage Data Blob Reader permissions

Secure access to the storage account with a key vault and key

  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.
    Image In the portal, search for and select Resource groups.

  • Select your resource group, and then the Access Control (IAM) blade.
    Image Select your resource group, and then the Access Control (IAM) blade.

  • Select Add role assignment (center of the page).

  • On the Job functions roles page, search for and select the Key Vault Administrator role.
    Image On the Job functions roles page, search for and select the Key Vault Administrator role.

  • On the Members page, select User, group, or service principal.
    Image On the Members page, select User, group, or service principal.

  • Select Select members.
    Image Click Select and then Review + assign.

  • Search for and select your user account. Your user account is shown in the top right of the portal.
    Image Search for and select your user account. Your user account is shown in the top right of the portal.

  • Click Select and then Review + assign.

  • Select Review + assign a second time to add the role assignment.
    Image Select Review + assign

  • You are now ready to continue with the lab.
    Image Select Review + assign

2. Create a key vault to store the access keys.

  • In the portal, search for and select Key vaults.
    Image In the portal, search for and select Key vaults.

  • Select Create.
    Image Select Create.

  • Select your resource group.
    Image Select your resource group

  • Provide the name for the key vault. The name must be unique.
    Image Provide the name for the key vault

  • Ensure on the Access configuration tab that Azure role-based access control (recommended) is selected.
    Image Ensure on the Access configuration tab that Azure role-based access control (recommended) is selected.

  • Select Review + create.

  • Wait for the validation checks to complete and then select Create.

  • After the deployment, select Go to resource.

  • On the Overview blade ensure both Soft-delete and Purge protection are enabled.

3. Create a customer-managed key in the key vault.

  • In your key vault, in the Objects section, select the Keys blade.

  • Select Generate/Import and Name the key.

  • Take the defaults for the rest of the parameters, and Create the key.
    Image Take the defaults for the rest of the parameters, and Create the key.

Configure the storage account to use the customer managed key in the key vault

  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.
    Image In the portal, search for and select Resource groups.

  • Select your resource group, and then the Access Control (IAM) blade.
    Image Select your resource group, and then the Access Control (IAM) blade.

  • Select Add role assignment (center of the page)

  • On the Job functions roles page, search for and select the Key Vault Crypto Service Encryption User role.
    Image On the Job functions roles page, search for and select the Key Vault Crypto Service Encryption User role.

  • On the Members page, select Managed identity.
    Image On the Members page, select Managed identity.

  • Select select members, in the Managed identity drop-down select User-assigned managed identity.
    Image Select Select members, in the Managed identity drop-down select User-assigned managed identity.

  • Select your managed identity.
    Image Select your managed identity.

  • Click Select and then Review + assign.
    Image Click Select and then Review + assign.

  • Click Select and then Review + assign.
    Image Click Select and then Review + assign

2. Configure the storage account to use the customer managed key in your key vault.

  • Return to your the storage account.
    Image Return to your the storage account

  • In the Security + networking section, select the Encryption blade.
    Image Return to your the storage account

  • Select Customer-managed keys.
    Image Select Customer-managed keys.

  • Select a key vault and key. Select your key vault and key.

  • Select to confirm your choices.

  • Ensure the Identity type is User-assigned.
    Image Ensure the Identity type is User-assigned.

  • Select an identity.

  • Select your managed identity then select Add.
    Image Select your managed identity then select Add.<br>

  • Save your changes.
    Image Save your changes.

  • If you receive an error that your identity does not have the correct permissions, wait a minute and try again.

Configure an time-based retention policy and an encryption scope.

  1. The developers require a storage container where files can’t be modified, even by the administrator.
  • Navigate to your storage account.
    Image Navigate to your storage account.

  • In the Data storage section, select the Containers blade.

  • Create a container called hold. Take the defaults. Be sure to Create the container.
    Image Create a container called hold. Take the defaults. Be sure to Create the container.

  • Upload a file to the container.
    Image Upload a file to the container

  • In the Settings section, select the Access policy blade.
    Image n the Settings section, select the Access policy blade.

  • In the Immutable blob storage section, select + Add policy.
    Image In the Immutable blob storage section, select + Add policy.

  • For the Policy type, select time-based retention.
    Image For the Policy type, select time-based retention.

  • Set the Retention period to 5 days.

  • Be sure to Save your changes.
    Image Be sure to Save your changes.

  • Try to delete the file in the container.
    Image Try to delete the file in the container.

  • Verify you are notified failed to delete blobs due to policy.

2. The developers require an encryption scope that enables infrastructure encryption.

  • Navigate back to your storage account.
    Image Navigate back to your storage account.

  • In the Security + networking blade, select Encryption.
    Image In the Security + networking blade, select Encryption.

  • In the Encryption scopes tab, select Add.
    Image In the Encryption scopes tab, select Add.

  • Give your encryption scope a name.
    Image Give your encryption scope a name.

  • The Encryption type is Microsoft-managed key.
    Image The Encryption type is Microsoft-managed key.

  • Set Infrastructure encryption to Enable.
    Image Set Infrastructure encryption to Enable.

  • Create the encryption scope.

  • Return to your storage account and create a new container.
    Image Notice on the New container page, there is the Name and Public access level.

  • Notice on the New container page, there is the Name and Public access level.
    Image Notice on the New container page, there is the Name and Public access level.

  • Notice in the Advanced section you can select the Encryption scope you created and apply it to all blobs in the container.

Top comments (0)