Engineering: How to access uploaded certificates in Azure Web Sites

Posted by Nilay Parikh and last modified on Tue Jun 12, 2018.

Certificates in Azure Web Site works differently than on-premise or local IIS instance. The website would not have access to a certificate store, and mostly it uses in physical memory.

It is as easy and straightforward process,

  1. Upload certificate through Azure Portal.
  2. Add an AppSetting through Azure Portal (Key: WEBSITE_LOAD_CERTIFICATES) and set the value to the thumbprint of your uploaded certificate.

The above two step would be sufficient to get your certificates ready to be used in Application.

var myStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
myStore.Open(OpenFlags.ReadOnly);

var certificate = myStore.Certificates.Find(X509FindType.FindByThumbprint, YOUR_THUMBPRINT, false);


Engineering: Progress aware file upload to Azure Blob Storage

Posted by Nilay Parikh and last modified on Tue Jun 12, 2018.

Azure SDK do not support trackable upload progress, the process is considered as a single task. However, interestingly the internal process split the upload content into small chunks and upload them individually, but the code wait for the entire task to complete.

It is interesting to see that we can implement the same process by code. We would manually split the file into small chunks and upload these chunks asynchronously using PutBlockAsync. Once all parts are successfully uploaded to the container then will call PutBlockListAsync to commit the file.


Troubleshooting: Azure Storage Emulator failing to Install

Posted by Nilay Parikh and last modified on Tue Jun 12, 2018.

Windows Azure Storage Emulator failing with error – Sql instance not found.

Error Description

CAQuietExec:  Windows Azure Storage Emulator 3.0.0.0 command line tool
CAQuietExec:  Error: No available SQL Instance was found.
CAQuietExec:  Error 0xfffffff6: Command line returned an error.
CAQuietExec:  Error 0xfffffff6: CAQuietExec Failed
CustomAction RunInitialize returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)


Troubleshooting: Missing Microsoft.Data.Services.Client version 5.6 on Azure Websites

Posted by Nilay Parikh and last modified on Tue Jun 12, 2018.

Development recently comes across the error while deploying the website through CI pipeline. The project was failing to load dependency of the recent release of Azure Storage SDK.

Error Description

Could not load file or assembly 'Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.


Engineering: How to deploy solution to different instance size for Azure environments

Posted by Nilay Parikh and last modified on Tue Jun 12, 2018.

Let me continue from where we left the last blog post – Simplified Azure ServiceConfiguration Best Practices. The previous post in this series demonstrated how to create transformation file set for various build definition.

Let’s add another objective to the best practices, how to configure different instance size for various environment, and why would like to do that? – simple answer is “Computomatics”, an economics of computing.

  • Environment other than production are subject to internal development lifecycle and significantly smaller audience would access these environment, thus you may want to scale down the instance size of such environment (Testing, Staging, etc.)
  • If your project is not on continues development or your development teams are not dependent on Azure Instances, then you may choose to turn-off these instances.


Best Practice: Simplified Azure ServiceConfiguration

Posted by Nilay Parikh and last modified on Tue Jun 12, 2018.

Best practices are considered as the most secure and optimised, but they don’t come free. Sometimes the cost is additional development and support efforts, and I am happy to concede the opposite argument that it is not always true.

If ServiceConfiguration.cscfg is not storing any sensitive information, the following simplified best practice would be lightweight and easy to manage. It is just using Visual Studio built-in feature called “Config Transformation”. Follow the simple hack and voilà,