VKinfotek Inc.
  • Us
    About Us
    Contact Us
  • FAQs
  • Ready Software
    Ready ERP ASP Core Software for Azure Cloud
    Ready Web ERP Software
    Ready ASP.Net Azure Software
    Ready C# SQL Server Accounting Software
    Ready ASP.Net MVC and EF Software
First slide
Earn $100/hour in USA! Click Here

Q89. Configure the .Net application for using storage emulator?

We can set the CloudStorageAccount with the default development storage account in the code using the CloudStorageAccount object’s property DevelopmentStorageAccount as shown below.

StorageAccount = CloudStorageAccount.DevelopmentStorageAccount;

Though, setting the storage account details in the application code is easy, it is not recommended because we have to modify and recompile the code each time we deploy the application to the cloud. The recommended practice is to store this information in the service configuration file. We can upload only the service configuration file whenever it is changed.

The StorageClient library provides methods using which we can extract configuration settings as shown below.

CloudStorageAccount storageaccount  = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting(“StorageConnectionString”));


In the above code, account details are extracted from the configuration setting named StorageConnectionString. After that, we create a CloudStorageAccount object by parsing a connection string. Note that we need to firstly define all configuration settings in the service definition file, and only then we can configure the settings.

The following code defines the storage account in your service definition file.


	



After defining the configuration settings, we can set the values in the service configuration file. The following configuration settings are set for this example.


	



When we set the value of StoargeConnectionString to UseDevelopmentStorage=true, we are configuring the application to use the development storage.
  • Prev Question
  • Next Question

See More Questions and Answers on - Azure Blobs and Queues

  • Partitions and Queries?
  • How to insert multiple records in a transaction using TableBatchOperation?
  • Partition size in Azure table storage?
  • What are the typical query types for table storage?
  • Explain blobs data model?
  • How to address resources in the storage emulator?
  • How to create a container and upload a blob using the server explorer?
  • How to use the windows azure blob storage service in .net?
  • Key benefits of SQL database service?

Back to Master List of 100+ Questions and Answers

People also viewed: cover image of book develop erp software using asp core and deploy to Azure Create your own ERP Software using ASP Core>>
cover image of azure cloud book Create your own Azure SOM Software>>
cover image of asp.net book Create your own ERP Software using ASP .Net and SQL>>
cover image of foundation database programming book Create your own Accounting Software using C# >>
cover image of entity framework book Create your own SOM using Entity Framework MVC >>

  • SITEMAP
  • Terms of use
  • Testimonials

Back to top

Copyright © 2018 - All Rights Reserved - VKInfotek.com