Sliding cache with Redis in .Net Web

For sliding cache & timeout with Redis Cache, here is a verification in asp.net web application, see result from a web page: The web session was configured to use azure Redis Cache as session storage, its timeout was set to 1 minute. First a session data was added at 2016/3/30 15:30:13, it supposed to expire at 2016/3/30 … Continue reading Sliding cache with Redis in .Net Web

Classic dependency injection

With dependency injection, only interfaces are exposed to method callers, which means, details of the method is protected and invisible when being referened, in addition, the interface can be extended as customized and then let same method supports more similar cases. public class Employee { public Employee(ILogger logger) { logger.WriteToLog(“New employee created”); } } public … Continue reading Classic dependency injection

Glance of SQL Data Warehouse in China Azure

Key features:   Azure SQL Data Warehouse, storage and compute scale independently. You can dynamically deploy, grow, shrink, and even pause compute, taking advantage of best-in-class price/performance. SQL Data Warehouse uses the power and familiarity of T-SQL to let you easily integrate query results across relational data in your data warehouse and non-relational data in … Continue reading Glance of SQL Data Warehouse in China Azure

Getting AAD token with silent login

Sometimes devops need their apps to perform some operation as a human, such as stopping a virtual machine when monitoring system alarms, as traditional ways of azure authorization such as management certificates or profile file  grant too much permission and may cause security risks, ARM and RBAC is quite recommended to fully organize and control access to … Continue reading Getting AAD token with silent login

BCP to quick move data between SQL and Data Warehouse

A common need from real scenario is to sync data between SQL(either SQL Server in private environment or SQL Database on cloud) and SQL Data Warehouse, given SQL Data Warehouse decoupled computing(engine for running SQL queries and SQL  requests) and storage(data storage and indexing), using SQL Data Warehouse lets users have option to stop computing anytime for saving cost … Continue reading BCP to quick move data between SQL and Data Warehouse

Secure confidentials with Azure KeyVault

Step 1: register an app in your AAD and create a secret there, after that you will get ClientId and ClientSecret from Azure portal (AAD part) <add key=”ClientId” value=”caf5668f-f6fa-4634-8b10-7212020f99f9″ /> <add key=”ClientSecret” value=”ankMv1ze/n7F3GUzsF6xWjq4r9v99vpQW6YRlhCfpPU=” /> Step 2: create key vault in Azure and save a secret into it by following https://azure.microsoft.com/en-us/documentation/articles/key-vault-get-started/, after that you will get … Continue reading Secure confidentials with Azure KeyVault

Practice Reference with Redis Cache in China Azure

Some points of using Azure Redis Cache: By default, items in the cache do not expire, but an expiration can be configured on a per write basis using cache set overloads. For each cached item in Redis Cache, when storing that in Redis, there is option to set a sliding or explicit expiration time for … Continue reading Practice Reference with Redis Cache in China Azure

Invalid object name ‘dbo.vTargetMail’ in Adventure Works

when practicing Azure Machine Learning, Azure PowerBI or other DB based services, it is common to have a databased named Adventure Works as prerequisite in your SQL Server/Warehouse. However, even when following the tutorial https://azure.microsoft.com/en-us/documentation/articles/sql-data-warehouse-get-started-manually-load-samples/, you may still hit problem like “Invalid object name ‘dbo.vTargetMail’”, which indicates there was no such view(table) in the sample … Continue reading Invalid object name ‘dbo.vTargetMail’ in Adventure Works

Block or only allow certain client IPs in cloud service

Solution 1:  Netsh and startup task On ServiceDefinition.csdef file you need to add the tag <WebRole> <Startup> <Task commandLine=”Register.cmd” executionContext=”elevated” taskType=”simple” /> </Startup> </WebRole> Create a register.cmd file and place it on the root folder of the application Set the property ‘Copy to Output Directory’ to ‘Copy always’ On the register.cmd you need to add … Continue reading Block or only allow certain client IPs in cloud service

Cloud Service – HTTP Error 500.19

The error may happen in Azure cloud service and other IIS based hosts, here is a case: • Behavior Web server returns “HTTP Error 500.19 – Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.” • Analysis: Quick troubleshooting way is to remote access the server and try … Continue reading Cloud Service – HTTP Error 500.19