Writing to Event Log in Windows Azure

31 בינואר 2011

As you all  know windows event log is one of the most common infrastructure for writing logs in windows applications. When migrating an existing application that happen to use event log we run into the following problem: Application running on windows Azure does not have the permissions to create a new event log source. You can only use an existing event log source, any attempt to create a new one will cause a security exception. Even at full trust, some operations are not allowed. An alternative to using the default Azure logger is to...
tags: ,
one comment

How To Load Assemblies from Blob Storage

24 בינואר 2011

Dependency Injection and IOC are very common patterns in modern applications.Such patterns are based on dynamically loading an assembly on runtime usually form the file system. When running in the cloud instead of using the file system we will use blob storage. In this post I want to show how to load an assembly from blob storage. Let us say we have a calculator (MyCalc) in the assembly "calculator.dll" and a simple web role that wants to use it but has no direct reference to it. The web role will load the calculator dynamically from blob storage....
tags: ,
2 comments

How to Enable File Share with Azure VM

22 בינואר 2011

On my last post I wrote how to enable ping between the local machine and an Azure VM running your role. Now it is time to enable a full Folder Share the two machines. To enable file sharing on Azure VM, follow the steps below: First make sure the Windows Azure Connect connection is established. e.g. make sure you can ping your Azure VM from your home machine and vice versa. (see last post) 1. Remote Desktop to your Azure VM 2. Run "wf.msc" to open the Windows Firewall console 3. Create a...
tags: ,
no comments

How to Enable Ping Between Local Machine and Azure VM

19 בינואר 2011

One of the first things we do after establishing an Azure Connect connection between local machines and Azure VMs is ping. The problem is it will fail. The reason is that ICMP protocol is closed by the firewall. To open ICMP execute on both the local machine and the Azure VM the following script: netsh advfirewall firewall add rule name="ICMPv6" dir=in action=allow enable=yes protocol=icmpv6 To execute it on the Azure VM simply connect using Remote Desktop and execute in a command prompt. Enjoy Manu
tags: ,
3 comments

Asymmetric Encryption with no Certificates

18 בינואר 2011

To execute asymmetric cryptography it is required to have a public and a private key. The common way to pack such keys is using an X.509 certificate. System.Security.Cryptography.X509Certificates provides the API to open the certificate store and find a certificate. public static X509Certificate2 FindCertificate(string certificateName,                      StoreName storeName, StoreLocation storeLocation) {     X509Store store = new X509Store(storeName, storeLocation);     X509Certificate2 certificate = null;     try     { ...
no comments

Asymmetric Encryption of Long Data

16 בינואר 2011

Few weeks ago a post about asymmetric encryption using RSACryptoServiceProvider. Asymmetric encryption is an expensive operation so it is not meant for very long data encryption. If you have an article or a book you should not encrypt it asymmetrically but what about a 200 byte long information? If you will try to encrypt 200 byte using RSACryptoServiceProvider you will get an exception. It seems that the longest data that can be encrypted using is RSACryptoServiceProvider is 80 bytes. I thinks that there are many scenarios where it makes to encrypt few hundreds bytes long data asymmetrically and...
tags: ,
one comment

CloudTableClient in the Storage Emulator

13 בינואר 2011

When developing any azure application the development is done against the developer emulator. Yet in the storage emulator it looks likes there are very important differences between the emulator and the real cloud. Let us think of the classical scenario of inserting an entity to a table. Sometimes you might want to check before Inserting an entity maybe it already exist. if (!EntityExist(entityID))    InsertEntity(newEntity) Well in the development storage emulator if this is the first time such entity (schema) is being inserted the first lookup will fail with the error: "One of the...
tags: ,
one comment

Asymmetric Encryption with RSACryptoServiceProvider

9 בינואר 2011

Traditional symmetric cryptography is all about hiding a secret using an algorithm and a key. The same key is used for encryption and decryption. Asymmetric encryption does much more. In Asymmetric encryption there are two key: one is kept secret (private) and the other is distributed (public). Both keys are mathematically the same – What makes the public key public is the fact that it was distributed. To perform a full cycle both keys are required (i.e. encryption with one key and decryption with the other). There are two possible scenarios: ...
one comment