Azure WebJobs – Q&A’s

Here are some important Q&A’s around AzureWebjobs.

1. What is WebJobs in Azure?

The WebJobs in Azure enables us to run programs or scripts in Azure web sites in one of the following 3 ways :-

  • On Demand
  • Continuously
  • Scheduled

 

2. What are the acceptable file types for Scripts to create WebJobs?

It supports the set of file types creating using the following technologies:-

  • using windows cmd (.cmd, .bat and .exe)
  • using powershell (.ps1)
  • using bash (.sh)
  • using php (.php)
  • using python (.py)
  • using node (.js)

3. Where are WebJobs deployed?

WebJobs are deployed as a part of web site or ftp-ed into a specific directory. Once the WebJobs is deployed to the Azure web site, it gives an extra dashboard which details out the job execution history.

4. How to set up a WebJobs?

First you need to create an Azure web site for setting up the WebJobs. Click WebJobs (preview) at the top and click Add at the bottom. Then zip the contents of job folders and project and upload it.

5. What is the significance of Azure scheduler in the context of WebJobs?

To schedule a WebJobs, we need to have Azure scheduler enabled.

6. What is the cost for running WebJobs?

As of now, three is no additional cost for using Azure WebJobs unless AlwaysOn feature is turned on.

7. What is the maximum allowed file size for content (.zip files) submitted to WebJobs?

The maximum allowed file size for the content (.zip files) submitted to WebJobs is 100 MB. The .zip file should contain the executables (in any one of the formats like .exe, .cmd, .bat, .sh, .php, .py and .js).

 

 

 

 

Windows Azure Queue vs Service Bus Queuue

In Microsoft Azure, we have two implementations of Queues, Windows Azure Queues and Service Bus Queues. Both the Queues are the internally implemented using Message Queuing service offered on Windows Azure.

We should prefer Windows Azure Queues for the following scenarios:-

  • When the application needs to store over 5 GB worth of messages in a Queue and the life time of messages are shorter than 7 days
  • When server-side log is required for all transactions executed against Queues
  • When the application requires flexible leasing to process messages

We should prefer Azure Service Bus Queues for the following scenario :-

  • When the application requires full integration with .NET WCF
  • When message batches need to be published and consumed
  • When the message size handled by the application is between 64 KB and 256 KB
  • When the application requires “At most once” guaranteed delivery without the need to build additional infrastructure components
  • When the application requires First-In-First-Out (FIFO) delivery
  • When the Queue Size does not exceed 5 GB
  • When role-based access to Queue is required
  • When the application requires Automatic Duplicate detection
  • When the application Requires Atomicity and Transactional behavior when sending or receiving multiple messages from Queue
  • When the message retrieval does not require polling
  • When the Time-to-Live (TTL) characteristics of application-specific workload can exceed 7 day window

More detailed guidance, soft limits, Thresholds is given in http://msdn.microsoft.com/en-us/library/hh767287.aspx

Deploying SharePoint 2013 on Microsoft Azure using IAAS–Part 3

This post is continuation to my previous post Deploying SharePoint 2013 on Azure using IAAS – Part 2. In this article, we’ll see how to install SQL 2012 RTM.

Provisioning, Configuring and Setup of SQL Server 2012 VM

New à Virtual Machine à From Gallery à SQL Server 2012 Enterprise SP1.

clip_image002

clip_image004

clip_image006

The next step is to allocate the empty disk space of 50 GB space to the primary VM ‘SP2013-SQL1’ . Refer the part 1 of this article to know more about the empty disk allocation for various VMs.

Log-in to the SP2013-SQL1 VM and join the server to the Domain (techguru.com). Use the account ‘sp_install’ for joining the server to the domain.

clip_image008

On the F drive, create 3 folders namely Data, Backup and Log.

On Start menu àSQL Server 2012 Management Studio.

Right click on the default database instance à properties.

In the Server Properties click database settings. On the default database location settings, change the location of Data, Log and Backup to the corresponding folders on F drive.

clip_image010

The next step is to grant the service account sp_farm_db with Sys Admin rights.

Security à Logins à New login à sp_farm_db@techguru.com.

clip_image012

In the Server Roles à Select sysadmin

clip_image014

The next step is to grant NT AUTHORITYSYSTEM account with relevant permissions.

Security à Logins à New login à NT AUTHORITYSYSTEM.

clip_image016

Right click on NT AuthoritySystem à Properties à Securables.

Grant these 3 permissions ‘Alter any availability group’, ‘Connect SQL’ and ‘View server state’ to the account NT AuthoritySystem.

Now we need to unblock the ports 1433 (default SQL Server Ports) and 5022 (high availability port).

Start à Windows Firewall with advanced security.

Click à Inbound rules.

Action pane à New Rule.

On the Rule Type à Program à Next.

On the Program Page à Set Program Path as %ProgramFiles%Microsoft SQL ServerMSSQLBinnsqlservr.exe

clip_image018

On the Action Page à Allow Connection.

On the profile page à Keep defaults.

Name the rules ‘SQL Ports Rule’.

Setup of back-up SQL Server

clip_image020

clip_image022

Then allocate the empty disk space of 50 GB. This completes the part 3 of the series. In the next post, we’ll see how to configure SQL Server 2012 Always On.

 Subscribe to my blog

Good Resources for SharePoint 2013 on Azure

I came across the following resources that are found useful for planning SharePoint 2013 on Microsoft Azure. I thought of collating and making a post around this.

IOPS

Performance Considerations for SQL Server in Azure Virtual Machines

Performance Guidance for SQL Server in Windows Azure Virtual Machines

High Availability:

High Availability and Disaster Recovery for SQL Server in Windows Azure Virtual Machines

Approach with Custom Log shipping:

Deploying highly available SharePoint Internet Sites on Windows Azure Virtual Machines

Geo-DR for SQL Server on Windows Azure Infrastructure Services using Log Shipping

SharePoint 2013 on Windows Azure Infrastructure

SharePoint 2013 on Windows Azure Infrastructure Services

IOPS:

Performance Considerations for SQL Server in Azure Virtual Machines

Performance Guidance for SQL Server in Windows Azure Virtual Machines

High Availability

High Availability and Disaster Recovery for SQL Server in Windows Azure Virtual Machines

Approach with Custom Log shipping:

Deploying highly available SharePoint Internet Sites on Windows Azure Virtual Machines

Geo-DR for SQL Server on Windows Azure Infrastructure Services using Log Shipping

SharePoint 2013 on Windows Azure Infrastructure

SharePoint 2013 on Windows Azure Infrastructure Services

Authentication

Windows Azure Active Directory with SharePoint 2013

Internet Sites in Windows Azure using SharePoint Server 2013

Azure Compute and Storage Price Reductions

Windows Azure Active Directory with SharePoint 2013

Internet Sites in Windows Azure using SharePoint Server 2013

Azure Compute and Storage Price Reductions

 Subscribe to my blog

Deploying SharePoint 2013 on Microsoft Azure using IAAS–part 2

This post is the continuation to my previous post  – Deploying SharePoint 2013 on Microsoft Azure using IASS–part 1. The focus of the part2 of this series to cover the steps required to configure Domain Controllers (both Primary and Backup) in detail.

Configuration of Domain Controllers

Log on to the SP2013-DC1 VM (created in the Part1 of the article).

Server Manager àDashboard à Add Roles and Features.

Select Installation Type (set the default value of Role-based or feature-based installation).

Select Destination Server and Select a Server from the Server pool and click next.

clip_image002

Select Server Roles àActive Directory Domain Services and click Next

clip_image004

clip_image006

Now the Active Directory Domain Services are successfully installed in this Server SP 2013-DC1 and SP2013-DC2. We have already performed the step of initializing the Empty Disks. The next logical step is to perform activity of Promoting the SP2013-DC1 VM as the Domain Controller for the SharePoint 2013 farm that we are going to build.

Promotion of Virtual Machine to Domain Controller of the SP Farm

In this step, we would be performing the list of steps that are required to promote the Virtual Machine SP2013-DC1 as the Domain Controller of the SP Farm.

Server Manager à Manage link (on upper right hand corner) à Promote this server to a domain controller.

clip_image008

Deployment Configuration à Add a Forest

Set any arbitrary name for Root Domain name and Click next.

clip_image010

Set the Directory Services Restore Mode password as ‘Password123’.

clip_image012

We will get an error like ‘a delegation for the DNS cannot be found” and this can be ignored.

Additional Options à You will see the NetBios name reflected as the root domain name given in the previous step.

clip_image014

The next step is to set the path for Database folder, log files folder and SYSVOL folder.

clip_image016

Review all the selected options and Click next. We’ll see successful message for pre-requisites.

clip_image018

Click Install.

We’ll see a success message ‘The server was successfully configured as Domain Controller’. We need to create the set of Users (Service Accounts mentioned in the section 1b) in the Domain.

Server Manager à Tools à Active Directory Users and Computers.

Action à New à User.

clip_image020

Set the password as ‘password-1’ and make it as password never expire.

clip_image022

Repeat the above 2 steps for creating other service accounts like sp_farm_db, sp_install and sqlservice.

Provide domain admin rights for sp_install user.

clip_image023

Grant more rights to sp_install user.

On the domain name à Right click à Properties à Security à Advanced à

Advanced Security settings for domain à Select allow for Read all properties and Create computer objects.

This completes the setup of primary domain controller. We’ll set up the back-up domain controller in the next section.

Setup of back-up domain controller

In this section, we’ll see the necessary steps to configure back-up domain controller. The whole idea is that we’ll not be promoting the back-up DC (SP2013-DC2) as the domain controller for the farm, rather we will be adding the domain controller to the domain (techguru.com) running on primary domain controller VM (SP2013-DC1).

Click ‘Promote this server to Domain Controller’ and select ‘Add a domain controller to an existing domain’. Select credential techgurusp_install and the password for performing this operation.

clip_image025

clip_image027

clip_image029

clip_image031

clip_image033

Now we have successfully installed the domain controller. In the next post, we’ll cover the steps to configure SQL Server 2012 on Microsoft Azure for the SharePoint 2013.

 Subscribe to my blog

Deploying SharePoint 2013 on Microsoft Azure using IAAS–part 1

The objective of this article is to articulate the setup of SharePoint 2013 farm on Microsoft Azure platform using Infrastructure as a Service (IASS). Basically I  pretty much followed the steps mentioned in the MSDN article. I’m using Microsoft Azure trial subscription for the entire setup of SharePoint on Azure.

Configuration of Windows Azure Infrastructure components

The first step in setting up the SP 2013 Farm is to start provisioning the following three basic Network components and a Storage Account in the Azure Instance:

· One Virtual Network

· Four subnets

· Two DNS Servers

· One Windows Azure Storage account

On the lower-left corner, Click New à Virtual Network

Name for Virtual Network

Region: East Asia

Affinity Group: Create a new Affinity Group

clip_image002

On the DNS Servers type, type DNSServer1 and assign IP address as 10.0.0.4

On the DNS Servers type, type DNSServer2 and assign IP address as 10.0.0.5

clip_image004

On the Virtual Network Address Spaces, Click CIDR box to add subnet button. Add four subnets for each of the following

· DCSubnet (replaces Subnet-1), 10.0.0.0/11

· DataSubnet, 10.32.0.0/11

· AppSubnet, 10.64.0.0/11

· WebSubnet, 10.96.0.0/11

clip_image006

Now the virtual network is created.

clip_image008

Creation of Storage Account

The next step is to create Windows Azure Storage Account

Go to the Azure Management Portal.

New –> Data Services –> Storage and Quick Create

clip_image010

For the url enter name as “sundarsp”

Leave the default location/affinity group, which is selected as SundarAffinity.

Leave the default selection for Replication as ‘Geo-Redundant’ which will ensure the durability of the data.

Standards, Conventions and Limits

There are few conventions, standards and limits that I will be following throughout this article. It’s all again based on the msdn guidance.  http://msdn.microsoft.com/en-us/library/azure/dn275966.aspx.

When it comes to the allocating empty disk space, a size of 20 GB will be allocated to Primary Domain Controller & Back-Up Domain Controller VM. An empty disk size of 50 GB will be allocated to Database Server and SharePoint Server VMs.

Virtual Machine Type

Empty Disk Size

Primary Domain Controller

20 GB

Backup Domain Controller

20 GB

Database servers

50 GB

SharePoint Servers

50 GB

When it comes to Subnet creation, it is recommended to create four Subnets for different servers.

Sever

Subnet Name

Domain Controller

DC Subnet

SharePoint Server

WebSubnet

Sql Server

Data Subnet

App Server

AppSubnet

Availability Sets in Azure provides the capability to allocate Virtual Machines to different fault domains when a failure occurs. It increases availability and reliability. The recommendation is to create four Availability Sets as per the below conventions

Availability Set

Servers

DCAvailSet

SP2013-DC1 and SP2013-DC2

WFEAvailSet

SP2013-Web1 and SP2013-Web2

AppAvailSet

SP2012-App1 and SP2013-App2

SQLAvailSet

SP2012-SQL1 and SP2012-SQL2

We’ll be creating an Active Directory Domain by name ‘techguru.com’ (any arbitrary name that you can create for your need. I’ll also be creating the following set of Service Accounts on the techguru.com domain with a password of ‘password-1’ and password set as never expires.

Service Account

Purpose

Sp_farm

Account to manage the SharePoint farm

Sp_farm_db

Account to Manage the SQL Server (with SysAdmin rights )

Sp_install

Account with Domain administration rights for installing Roles and Features on various servers

Sqlservice

Account that SQL Server Instances run as.

Creation of Virtual Machines from Gallery

The creation of Virtual Machines typically involves the following five steps:-

1) Provisioning of Virtual Machine Instance

2) Creation and Attachment of empty disks

3) Initializing Empty Disks (The specification for empty disks are mentioned in the previous section 1.b)

4) Creation of Availability Set and its Associations for various VMs (The list of Availability Set are mentioned in the previous Section 1.b)

5) Logging into VM and perform initial setup activities

The following set of Virtual Machines need to be created for setting up the SP 2013 Farm. Since I’m having only the Trial version of Azure, I’m selecting only A2 VM with 2 cores of CPU. If you are setting the real Dev-Test SP 2013 environment for your customer on Azure, you need much more than that.

VM Name

Purpose

VM Image

VM Type

Subnet

SP2013-DC1

Primary Domain Controller

Windows Server 2012 Data Center

A2 2 cores

DC Subnet

SP2013-DC2

Back-up Domain Controller

Windows Server 2012 Data Center

A2 2 cores

DC Subnet

SP2013-SQL1

Database Server

MS SQL 2012 SP1 Enterprise on Win 2008 R2 SP1

A2 2 cores

Data Subnet

SP2013-SQL2

Database Server

MS SQL 2012 SP1 Enterprise on Win 2008 R2 SP1

A2 2 cores

Data Subnet

SP2013-App1

SharePoint App Server

Microsoft SharePoint Server 2013 Trial

A2 2 cores

AppSubnet

SP2013-App2

SharePoint App Server

Microsoft SharePoint Server 2013 Trial

A2 2 cores

AppSubnet

SP2013-Web1

SharePoint WFE

Microsoft SharePoint Server 2013 Trial

A2 2 cores

WebSubnet

SP2013-Web2

SharePoint WFE

Microsoft SharePoint Server 2013 Trial

A2 2 cores

WebSubnet

Creation of domain controller VM

New –> Compute –>Virtual Machine à from Gallery.

Select Virtual Machine operating system.

First, we’ll create a VM for Domain Controller and we’ll select Windows Server 2012 Data Center for Domain Controllers.

clip_image012

Set the password as ‘Pass@word1’.

clip_image014

clip_image016

clip_image018

Attach an empty disk of 20 GB to the Domain Controller VM and set it as Read/Write

clip_image020

Now we have attached the empty disk of 20 GB to the primary domain controller (sp2013-dc1) VM. The next step is to create Availability Set for the domain controller VM.

Virtual Machines –> Configure –> Availability Set –> Create an Availability Set

clip_image021

Set the name for availability set as ‘DC Avail Set’ and Save. Now let’s try logging in to VM.

In the Remote Desktop Connection Dialog Box click Connect and provide your user account as <<Machinename>>.cloudapp.netUserName and provide the password. Once we log in to the VM, we need to perform the Task of Initializing the Empty disks (mentioned in previous section)

Creation of Backup Domain Controller VM

Compute –> Virtual Machine –> From Gallery

clip_image023

clip_image025

clip_image027

Attach an empty disk of 20 GB to the back-up Domain Controller VM

clip_image029

Now we have successfully attached the Empty Disk to the backup domain controller VM. The next step is to select the ‘Availability Set’. Select the existing Availability Set of ‘DCAvailSet’ for back-up domain controller and save.

clip_image030

Now we have successfully created Availability Set for Domain Controller VMs (Primary and back-up). Now we need to log in to the SP2013-DC2 VM and perform the Empty Disk Initialization steps mentioned in section 1f.

Empty Disk Initialization

The empty disk initialization task need to be performed for all the types of the VMs that we would be creating as a part of SharePoint 2013 farm set up. Perform the following task on a VM running Windows Server 2012.

Server Manager à Click File and Storage Services à Disks

Select the Disk that is with the capacity of 20 GB and partition set to Unknown.

clip_image032

Create a new Volume, accept defaults and Set the Drive volume as ‘F’

clip_image034

clip_image036

The next step is to configure the Domain Controllers (both Primary and Back-up), it will be covered in detail in the part 2 of this article.

 Subscribe to my blog

SQL Azure Error: Tables without a clustered index are not supported in this version of SQL Server

I was trying to execute the following SQL Query in SQL Azure and got this error

Msg 40054, Level 16, State 1, Line 2

Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again”

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #a31515; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}

.csharpcode .lnum { color: #606060; }

/****** Object:  Table [dbo].[Department]    Script Date: 2/18/2013 9:42:19 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Department](
    [DepartmentID] [int] IDENTITY(1,1) NOT NULL,
    [DepartmentName] [varchar](50) NOT NULL,
    [DepartmentCode] [char](5) NOT NULL,

 CONSTRAINT [PK_Department] PRIMARY KEY 
(
    [DepartmentId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)

)


GO
/****** Object:  Table [dbo].[Employee]    Script Date: 2/18/2013 9:42:19 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Employee](
    [EmpID] [int] IDENTITY(1,1) NOT NULL,
    [EmpName] [varchar](50) NOT NULL,
    [EmpAge] [int] NOT NULL,
    [EmpExperience] [decimal](5, 2) NULL,
 CONSTRAINT [PK_Employee] PRIMARY KEY
(
    [EmpID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)

I’ve learn that the SQL Azure does not support tables that are without clustered Index. The fix for this is to tweak the above SQL Query to included clustered index.

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #a31515; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}

.csharpcode .lnum { color: #606060; }

/****** Object:  Table [dbo].[Department]    Script Date: 2/18/2013 9:42:19 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Department](
    [DepartmentID] [int] IDENTITY(1,1) NOT NULL,
    [DepartmentName] [varchar](50) NOT NULL,
    [DepartmentCode] [char](5) NOT NULL,

 CONSTRAINT [PK_Department] PRIMARY KEY CLUSTERED 
(
    [DepartmentId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)

)


GO
/****** Object:  Table [dbo].[Employee]    Script Date: 2/18/2013 9:42:19 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Employee](
    [EmpID] [int] IDENTITY(1,1) NOT NULL,
    [EmpName] [varchar](50) NOT NULL,
    [EmpAge] [int] NOT NULL,
    [EmpExperience] [decimal](5, 2) NULL,
 CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED 
(
    [EmpID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)

The above changes highlighted in yellow has  solved my issue of “

Msg 40054, Level 16, State 1, Line 2

Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again”"

 Subscribe to my blog

Moving a SQL Server 2008 Database from on-premise to SQL Azure

These days I’m doing lot of proof-of-concepts around the SharePoint 2013 App Model and how an ASP.NET MVC 3 application can be consumed/integrated in the SharePoint 2013 with the help of the App Model. As a first-step, I was trying to migrate a SQL 2008 database of an ASP.NET MVC3 application to Windows Azure. When it comes to migrating the database to Azure, there are multiple options available :-

a)Generate Insert SQL Scripts (compatible for SQL Azure) using ‘Tasks —> Generate Scripts’ in SQL Management Studio

b)Directly deploy the on-premise database to SQL Azure ‘Tasks’ —> Deploy Database to SQL Azure

c)Generate .dacpac export of SQL data + Schema and import it in SQL Azure

Since my database schema is not complex and data is also very less, I’m leveraging the 1’st approach.

Right-click on SQL database — > Tasks –> Generate Scripts

image

Select the list of tables to be migrated

image

Advanced Settings –>

Select ‘Sql Azure Database’ for Database Engine Type and ‘Schema and data’ for Types of data to script.

image

Select the location to save generated ‘.sql’file

image

You’ll see successful creation of .sql files

image

Log in to Windows Azure Management Portal and create new instance of SQL

image

Specify SQL Access Account

image

Select ‘Manage’ option for SQL Server and open a new Query window

image

Click ‘Run’. Now you are all set.