This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CecilAssembly : IILAssembly | |
{ | |
private readonly AssemblyDefinition _assemblyDefinition; | |
private readonly string _assemblyPath; | |
public CecilAssembly(string assemblyPath) | |
{ | |
_assemblyPath = assemblyPath; | |
_assemblyDefinition = AssemblyDefinition.ReadAssembly(assemblyPath); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<runtime> | |
<gcConcurrent enabled="false"/> | |
</runtime> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var workingSet = Environment.WorkingSet; | |
if (workingSet >= RecycleThresholdBytes) | |
{ | |
Logger.TraceWarning("Maximum working set exceeded (" + workingSet + "). Role shall now be recycled."); | |
RoleEnvironment.RequestRecycle(); | |
} | |
else if(workingSet >= WarningThresholdBytes) | |
{ | |
ErrorSink.Error("The worker role process has an elevated working set (" + workingSet + ")."); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ITableStorageService | |
{ | |
T Get<T>(TableUri tableUri, string partitionKey, string rowKey) where T : TableEntityBase; | |
void Put<T>(TableUri tableUri, T entity) where T : TableEntityBase; | |
void CreateTableIfNotExist(TableUri tableUri); | |
void Delete<T>(TableUri tableUri, string partitionKey, string rowKey) where T : TableEntityBase; | |
void BulkDelete<T>(TableUri tableUri, string partitionKey, Func<T, bool> entityPredicate) where T : TableEntityBase; | |
IEnumerable<T> GetAll<T>(TableUri tableUri, string partitionKey) where T : TableEntityBase; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IQueueService | |
{ | |
void Enqueue(QueueUri queueUri, string queueMessage); | |
QueueMessage Dequeue(QueueUri queueUri, TimeSpan visibilityTimeout); | |
QueueMessage Dequeue(QueueUri queueUri, TimeSpan visibilityTimeout, TimeSpan pollingWaitPeriod); | |
QueueMessage DequeueNoBlock(QueueUri queueUri, TimeSpan visibilityTimeout); | |
void DeleteQueueMessage(QueueUri queueUri, QueueMessage queueMessage); | |
void ClearQueue(QueueUri queueUri); | |
int GetMessageCount(QueueUri queueUri); | |
void CreateIfNotExists(QueueUri queueUri); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IBlobStorageService | |
{ | |
void Store(BlobUri blobUri, byte[] data); | |
void Delete(BlobUri uri); | |
bool Exists(BlobUri uri); | |
void BlockUpload(BlobUri uri, string fileToUpload); | |
void BlockDownload(BlobUri uri, string filePath); | |
void DownloadPageBlob(BlobUri blobUri, string filePath); | |
string Download(BlobUri blobUri); | |
void DeleteContainerIfExists(ContainerUri containerUri); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var blobUri = new BlobUri(storageAccountName, containerName, blobName); | |
var downloadPath = Path.Combine(workingDirectory, blobName); | |
blobStorageService.Download(blobUri, downloadPath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var storageAccountName = "myStorageAccountName"; | |
var queueName = new QueueName("my-queue-name"); | |
var queueMessage = "Hello"; | |
var queueUri = new QueueUri(storageAccountName, queueName); | |
queueStorageService.Enqueue(queueUri, queueMessage); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> $env:CloudExtensionsDir = PATH_TO_AZURE_MS_BUILD_TASKS | |
> $env:ServiceHostingSDKInstallDir = PATH_TO_AZURE_SDK_DIR | |
> $env:ServiceHostingSDKSupport = 7 | |
> $env:ServiceHostingSDKBinDir = PATH_TO_AZURE_SDK_DIR\bin | |
> $env:_CSPACK_FORCE_NOENCRYPT_=’true’ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> makecert -r -pe -a sha1 -n “CN=My Certificate Name” -ss My -len 2048 -sp “Microsoft Enhanced RSA and AES Cryptographic Provider” -sy 24 CertificateFilename.cer | |
> makecert -r -pe -n “CN=My Certificate Name” -sky exchange “CertificateFilename.cer” -sv “CertificateFilename.pvk” | |
> pvk2pfx -pvk “CertificateFilename.pvk” -spc “CertificateFilename.cer” -pfx “CertificateFilename.pfx” -pi CERTIFICATE_PASSWORD |