Azure Labs
Access a Public Storage Container from an ASP.NET Web App
Scenario:
As a developer you are tasked with creating an Azure web app. You need to write to code to access an Azure
Storage account used by the web app.
Real-World Usecase:
Reasons why an application may need to access a public storage container from an ASP.NET web app...
1 Storing and Retrieving Files: Public storage containers can be used to store files such as
images, videos, and documents that are required by the application. The web app can access these files from the
storage container and use them in the application.
2 Backup and Archiving: Public storage containers can be used to backup and archive data
generated by the web app. This can be useful for compliance and disaster recovery.
3 Content Delivery: Public storage containers can also be used to store and distribute large
files such as software updates, media files, and other content to users of the web app.
4 Cost-effective: Public storage containers are cost-effective and scalable, making them a
great option for storing large amounts of data.
In summary, public storage containers provide a convenient and cost-effective way for an ASP.NET web app to
store and retrieve files, backup and archive data, and deliver content to users.
How it was accomplished:
First you write the code in Visual Studio to create a container that has public access, and then you will
upload test files to the container. Next you will code to retrieve the URLs of the uploaded files. Finally, you
will test the configuration by using a test page.
• Added Azure Storage capabilities to an ASP.NET MVC project.
• Accessed an Azure Storage account programmatically.
• Provisioned an Azure Storage blob container that has public access.
• Uploaded files to an Azure Storage blob container.
• Retrieved a list of files from an Azure Storage blob container.
Scenario:
An organization needs deploying a virtual machine for hosting a web application built on a LAMP stack, with
efficient and automated process of provisioning and managing resources, such as storage, networking, and security
resources.
Real-World Usecase:
Deploying a virtual machine with Azure CLI using Azure Cloud Shell could be for creating a development or testing
environment for a software application. This allows for the application to be tested in a simulated production
environment before it is deployed to a live production environment, ensuring that it is fully functional and
stable. Additionally, using Azure Cloud Shell and Azure CLI allows for the virtual machine and associated
resources to be easily provisioned and managed, making the process more efficient and streamlined.
Azure CLI and Azure PowerShell are command-line tools that enable you to create and manage Azure resources.
Command-line tool also makes it easier to share scripts to those who want to create similar resources. Rather
than sharing a long wiki page with time consuming screenshots.
How it was accomplished:
• Used Azure CLI to provision a virtual machine,
• The virtual machine uses UbuntuLTS operating system.
• Executed commands created the VM and various resources associated with it.