I often come across questions related to generating PDF file from HTML or converting ASP.Net MVC page to PDF at runtime. These days I do see the frequency of these queries increased and decided to write a small solution to this problem. Most of the solutions around this topic involves lot of code using components like ITextSharp. Even if we invest such an effort and solve the problem, it will still be (sometimes) a non-generic solution and will land up refactoring the code for achieving reusability. In this tutorial, I am going to share a quick solution that is flexible (at least in my perspective) and mostly reusable.
In this short jumpstart, I am going to show how to prevent loading of an ASP.Net MVC page in a cross domain iframe using traditional HttpModules. We use HTTP header “X-Frame-Options” to prevent the loading of page in iframe, but instead of injecting this header on every code file, we use a HttpModule to configure this header as a site wide option. Here we use X-Frame-Options to “Same Origin” so that iframe requests from same domain will be served and rest all ignored.
AlwaysOn feature when enabled on a site, will automatically ping the site at regular intervals to ensure that the AzureWebsite is always up and running, so that app domain or worker process will not be killed due to idleness.
ScottGu recently (yesterday) announced the staged publishing support for Windows AzureWebsites. The concept of staging deployment is not new in Azure world, we have this support from long time for Cloud Services. In Cloud Services, we can simply make a staging deployment and then test it thoroughly to ensure the integrity and new features of new version, once we test the staging deployment we can simply make a swap between staging and production versions. Thus we get new features and changes included in new version into production with a single button click.
Get-AzureRemoteDesktopFile cmdlet can be used to either save the RDP file of an Azure Virtual Machine on to our local system or to launch an remote desktop connection. This cmdlet saves the RDP file for a particular VM role without any problem. But we get “Invalid Connection file specified” error when we use –Launch parameter with this cmdlet.
In my last tutorial we created a new nuget package from scratch using Nuget Package Manager. In this tutorial we are going to see how to include dependent libraries which are required for our nuget to be completely functional. Adding dependent libraries along with nuget makes them available to the target application at the time of installation of our nuget. Dependent libraries can be added through Nuget Package Manager at the time of creating package.
Nuget packages changed the way how we used to distribute our code to different audiences. I still remember those days when we zip up the code with a large document containing integration steps, and pass it to all audiences. Nightmares comes in the form of releasing patches and next versions. I am taking this opportunity to document necessary steps to create a nuget package from scratch.
In this article, we are going to see the implementation of Basic Update and Delete database operations using AngularJS, ASP.Net WebAPI and Entity Framework.
In this article, we are going to see the implementation of Basic Create and Read database operations using AngularJS, ASP.Net WebAPI and Entity Framework.
In this tutorial, I am going to show how Azure Table Storage entities are being protected for their data integrity during concurrent transactions. Table storage entities are using a property called ETag (included for every entity by default) to keep track of version of an entity. When a outdated Etag or an invalid ETag comes along with an update operation, table storage is going to throw an exception “412 – Pre-condition failed”. Table storage entities also provide an option to force update an entity if in case ETag is allotted a value of “*”.
In this tutorial, I am going to show how to quickly configure SQL Server hosted on Azure VM so that it can be accessible from external SQL Server Management Studio. First we add an end point for the VM in a Azure Management portal. As a second step we open that port (of added end point) to the inbound rules of VM firewall. As a next step we enable TCP connections of the SQL Server on VM and restart the SQL Server instance. Finally we enable SQL Authentication (along with Windows Authentication) for SQL Server and create a SQL Login. We then use the created login to access SQL Server from remote SSMS.
In this short gotcha, I am going to show how to use an Azure PowerShell Cmdlet. Save-AzureServiceProjectPackage to generate CSPKG format cloud deployment package. CSPKG is a cloud ready package and can be upload directly to a cloud service either through management portal or through PowerShell. Previously when there is no support (this cmdlet not used to work before Azure PowerShell 0.7.2) for Save-AzureServiceProjectPackage, we were forced to use CSPack to generate the package.
In this quick gotcha, I am going to show how double quotes can create issues which running Apache Hive query using Windows Azure PowerShell Cmdlets. We have Azure cmdlets like New-AzureHDInsightHiveJobDefinition, Start-AzureHDInsightJob etc., which support running hive queries as map reduce jobs in HDInsight. But there will be a format issue when double quotes are included in the query. To bypass the format issues, one cane use Invoke-Hive cmdlet to invoke the same query. This gotcha applies for cmdlets of version 0.7.2.
Of late I was working with my buddies on some open source projects hosted in GitHub. In my continuous journey I was learning some basic Shell commands through which Git management can be easily accomplished. In this short tutorial, I am going to narrate on how to do simple Git operations through Git Shell. As a prerequisite download and install GitHub tools for Windows – http://windows.github.com/.
JumpStart # 31– Create and deploy new Azure Cloud Service using Package (CSPKG) generated by Azure PowerShell
In this short tutorial, we are going to learn how to create new Azure Cloud Service deployments through Windows Azure PowerShell cmdlets. Deployment though PowerShell can be achieved by first creating a package (CSPKG) for the Visual studio project which is intended to be deployed. As a second step we upload the package to a Windows Azure Blob Storage. Finally we create a new Azure Cloud Service and deploy the uploaded package to it.
JumpStart # 30– Create Azure Cloud Service Package (CSPKG) of Visual Studio 2013 project solution using PowerShell
There can be scenarios where we need to have control on building the Azure Cloud Service Packages, say for example when we want to dynamically override some files in the project and build the package on the fly. In this short tutorial, we are going to see how to create a CSPKG file, which can be deployed to a Azure Cloud Service. Although Windows Azure PowerShell Cmdlets provide an option Save-AzureServiceProjectPackage to create a package file for a cloud project, this cmdlet is NOT (atleast with Windows Azure PowerShell 0.7.1 version) going to work for the project solutions which are created using Visual Studio IDE. Save-AzureServicePRojectPackage is only going to work for solutions which are created using cmdlets.
With the new release of Windows Azure SDK 2.2 for Visual Studio 2013, we can now remotely debug all the application in the cloud in a easier way. In this short tutorial I am going to show on how to remotely debug a website which is hosted in Windows Azure in simple steps. Prerequisite for this tutorial is Windows Azure SDK 2.2, anyone can download it from Microsoft Windows Azure Downloads.