Category Archives: Azure

This category contains topics around Microsoft Azure

Using SendGrid and emails are not being delivered to Hotmail/Outlook/Live/MSN.com recipients?

Me too, or at least I was… While the problem I was having might not be related to SendGrid exclusively, I am going to talk about the solution.

The Problem

Before I go into the solution, let’s talk about the problem first. Many of you know that I run Desert Code Camp in Chandler, AZ. Originally, the site ran on the Microsoft stack, it used ASP.NET (Web Forms) and SQL Server. There is an API for mobile apps and future development but that’s another story. The site has 12,000 registered users. A few thousand are SPAM/Bots, a few thousand are “inactive” accounts (opted out or moved), and the other 6000 or so are active users that have an interest in Desert Code Camp or have attended at least one.

And here lies the first problem.

When an announcement email goes out to our attendees or users of the site, we need to send out about 6000 emails. I used to do this by sending the email from a web page through code using System.Net.SMTP via localhost. At first, it wasn’t an issue. After a while, as Desert Code Camp grew, this became more and more of a problem. Typically the page would time out or IIS would die or something. So I needed to find a solution. Sometime last year, probably around this time, I offloaded the processing of emails to Azure Queue Storage and used Azure WebJobs to handle the “logic”. But wait, Azure does not support sending stuff via localhost. And that is true! This is where SendGrid comes into play. Azure provides, as of the creation of this post, a free 25,000 email per month subscription to SendGrid. For more on that, check out this post.

Now that I implemented the new Azure/SendGrid combination everything was great.

Fast forward a year, to this past weekend, I announced that the next Desert Code Camp was happening on Twitter and some people started submitting sessions. This is great! But I noticed that I was wasn’t getting my emails about the submissions.  At first, I thought, “Oh Joe, you forgot something when you ‘created’ the new event”.  It happens every time :). However, this was not the case this time. Microsoft decided to embrace something called DMARC, Domain-based Message Authentication, Reporting & Conformance. In a nutshell, it checks to see if you are sending emails from the domain you claim you are sending them from, which for me was bad.  Not because I was trying to be deceitful, but because I was sending emails saying they were from ‘@hotmail.com‘ and sending them via ‘SendGrid‘ because I wanted people to reply to my Hotmail address. Well, when Microsoft implemented the DMARC…

What this means: As of June, 2016, you can no longer send with the From address being anything from a Microsoft address when sending to a domain that checks DMARC before accepting mail.

… it saw my email as not being ‘legitimate‘ and did not deliver it to my inbox and probably others.

The Solution

The answer is ‘Whitelist‘ your domains while using SendGrid. There are more detailed instructions on how to whitelist a domain using SendGrid here.

What is Whitelabeling?

Whitelabeling allows you to send through your own custom domain instead of SendGrid’s default settings. This will mask the header information of your emails with your data–not theirs–and will improve your email deliverability.

Non-Whitelabeled Example vs. Whitelabeled Example

Luckily, SendGrid makes it easy to whitelist your domain(s). Here is how you do it. Please note: You will need access to your domain records, you will be making changes to your TXT or CNAME entries to prove you have rights to the domain.

  • First, log-in to your SendGrid Account
  • Click ‘Settings’ (on the left)
  • Click ‘Whitelabels’
  • Click + Add Domain button.
  • SendGrid will walk you though everything else you need.

But what about the replies to @Hotmail.com

I’m glad you are still with me :). This part is the easy part. Essentially, I added ‘noreply@desertcodecamp.com‘ as the ToAddress and added ‘jguadagno@hotmail.com‘ as the ReplyTo. As shown in this gist.

I hope this saves you some time troubleshooting mail delivery to @hotmail.com, @outlook.com, @live.com, @msn.com, @yahoo.com, and @gmail.com.

Adding Visual Studio Online to an Windows Azure MSDN Benefit Subscription

In my previous post,  I talk about why you can not add Visual Studio Online to an Existing Windows Azure MSDN benefit subscription.  In this post, I will show you how to add and existing Visual Studio Online (formally know as TFS Online) to your existing Windows Azure account.

Create Your “Pay-As-You-Go” Account

If you already, have a “Pay-As-You-Go” account you can jump to the “Link Your Existing Visual Studio Online Account” section

First you have to sign in to your Windows Azure account. You should see something like this.

Add subscription

Click on the Add Subscription button. This will take you to the Add Subscription page. You should see a few choices, scroll down until you see the “Pay-As-You-Go” selection highlighted below.

Select an Offer

You should then be brought to the purchase section,

purchase

Note, you might have to validate your mobile number and/or put in a credit card number.  Click purchase, and after a minute or so, your “Pay-As-You-Go” account is established.  You can view it by clicking on the Portal button or visiting the Windows Azure Portal.

Linking Your Existing Visual Studio Online Account

Now that you have the “Pay-As-You-Go” account added to Windows Azure, we can click on the Visual Studio Online tab in the Windows Azure portal Visual Studio Online

 

or click the new button.

Link to Existing Account

If you click, the new button you will have to navigate to “App Services”, then “Visual Studio Online”, then “Link to Existing”. For me, since my Windows Azure credentials were the same as my Visual Studio Online credentials, it automatically populated the account name.  Click the button and the Link to Existing Account message will appear.

Link Being Created

 

Once the account has been linked you will see the account ready screen.

Account Ready

 

Now, from the Windows Azure dashboard, you will see your Visual Studio Online account.

With Visual Studio Online

Visual Studio Online with Windows Azure MSDN benefit

I don’t know about you but when I watched the Visual Studio launch earlier this week I was really excited about some of the cool new features added. The first thing I wanted to try out was Visual Studio Online. I figured I have a Windows Azure account setup through my MSDN subscription so I’d be set.  Unfortunately, like most people found out when they tried to add their Visual Studio Online account they could not.  We were all getting this message…

You have no eligible Windows Azure subscriptions. To buy monthly user licenses or shared resources for your Visual Studio Online account, you’ll need another Windows Azure subscription.

I went to the Windows Azure account portal to make sure that I did have an active subscription, in fact I have two, but I still could not add or link my existing Visual Studio Online account.  I posted a message on one of the Windows Azure list and after a few hours some one pointed me to this forum post. This forum post explains why you can not add an Visual Studio Online account to an existing Windows Azure MSDN account.  It essentially boils down to billing.  The Windows Azure MSDN benefit has the ability to “cap” the spending in Windows Azure.  This does not work for Visual Studio Online. If you think about it, it makes sense. Do you not want to lose access to your source code because you hit your spending limit? Probably not.  In order to add your Visual Studio Online account you have to get create a Windows Azure “Pay as you Go” subscription.  Don’t worry, you get a bunch of the benefits free.

Within a Visual Studio Online account, you simply pay for user plans for the users who join your account and for resources that are shared amongst all users on the account. The first five users with the Basic plan and all eligible MSDN subscribers (Visual Studio Professional with MSDN and above) can join your account at no charge. Learn more about Visual Studio with MSDN.

Hopefully this helps.  My next post will talk about Adding Visual Studio Online to an Windows Azure MSDN benefit.

Windows Azure Experience–Part 4: Customizing the Web Site

This Part 4 of a series of posts about my “upgrade” to Windows Azure.

Next up in the series is customizing the Windows Azure Web Site. Note: This blog post is based on the Preview version of Windows Azure Web Sites and might change in the future.

Note: There is an article on the Windows Azure site that will cover some of this content.

Getting Started

When you first come to you web site from the management portal you are presented with a screen similar to this.

image

The start page gives you three options:

Get the tools

WebMatrix is a free, lightweight web development tool that includes everything you need to create web sites and publish applications for Windows Azure. WebMatrix supports the latest web technologies, including ASP.NET, PHP, HTML5, CSS3, Node and more. The Windows Azure SDKs allow you to build applications that take advantage of Windows Azure’s scalable cloud computing resources.

Web Matrix

Clicking on this link will redirect you to the latest and greatest version of WebMatrix.

Install a Windows Azure SDK

Clicking on this link will redirect your to the downloads page for all of the Windows Azure SDKs. There are SDKs available for Mobile development, including Andriod, iOS, Windows Phone 8, and Windows Store. Here are some of the others

  • .NET: Visual Studio 2010, Visual Studio 2012
  • Node.js
  • PHP
  • ava
  • Python
  • Ruby
  • Media libraries and player frameworks.

Publish your app

After you set up a web site and dependent resources, such as a database, you can download the generated publish profile, import it into a development tool such as WebMatrix or Visual Web Developer, and deploy your web site to Windows Azure within seconds. You can also publish your web application from FTP directly by setting up deployment credentials in the portal and pushing the application to Windows Azure from your favorite FTP client.

There will be more on this in a future blog post.

Integrate source control

Set up continuous deployment from source control providers like TFS, CodePlex, GitHub, Dropbox, or Bitbucket. You can also deploy from a local Git repository on your machine.

There will be more on this in a future blog post.

Dashboard

Monitor

The dashboard allows you to see some performance metrics of your site. These are CPU Time, Data In, Data Out, HTTP Server Errors, and Requests.

image

 

Usage Overview

The usage overview shows you where you might be in trouble of hitting the limits of the the type of site you have (free, shared, reserved).

image

 

Quick Glance

This shows you every thing that you will need to connect to your Windows Azure services.

image

Monitor

The monitor displays the some of the web sites performance counters like CPU time, Data In, Data Out, etc.

image

Configure

General

Choose the version of .NET language runtime to use. The current supported version is v.3.5 and v4.5

Choose the version of PHP to use. The current supported versions are 5.3 and 5.4.

Domain Names

Lists the domain names that are associated with your account. If you have a Shared or Reserved instance, you can click on Manage domains to add or remove domains or subdomains.

App Diagnostics

You can turn on any of the application diagnostics like application logging to the file system and application logging to a Windows Azure Storage account.

Site Diagnostics

You can turn on any of the three site wide diagnostics settings like Web Server Logging, Detailed Error Messages, and Failed Request Tracing.

Monitoring

Endpoint monitoring lets you monitor the availability of HTTP or HTTPS endpoints from geo-distributed locations. You can test an endpoint from up to three geo-distributed locations. A monitoring test fails if the HTTP response code is greater than or equal to 400 or if the response takes more than 30 seconds. An endpoint is considered available if its monitoring tests succeed from all the specified locations.

App Settings

Specify name/value pairs that will be loaded by your web application when it starts.

Connection Strings

Show any connection strings associated with linked resources.

Default Documents

Use this setting to add, remove, or reorder your web site’s default documents.

Handler Mappings

Specify a custom script processor to handle requests for the file extension that you specified. To do this, provide a path for the custom script. The path must be relative to the FTP root directory of the web site. You can use optional arguments.

Scale

General

Windows Azure offers three modes for you to run your web sites: Free, Shared, and Reserved. In the Free and Shared modes, all web sites run in a multi-tenant environment and have quotas for usage of CPU, memory, and network resources. You can decide which sites you want to run in Free mode and which sites you want to run in Shared mode. Shared mode employs less stringent resource usage quotas than Free mode. The maximum number of sites you can run in Free mode may vary with your plan. When you choose Reserved mode, all your web sites run in Reserved mode on dedicated virtual machines that correspond to standard Windows Azure compute resources.

Note: This can affect the cost of running your web site on Windows Azure.

Capacity

This count denotes the number of processes dedicated to a web site. By increasing the value for this setting, you can scale your web site for additional throughput and availability.

Note: This can affect the cost of running your web site on Windows Azure.

Linked Resources

This will show you a list of other Windows Azure Services that you have linked or attached to the web site, like a database.

Windows Azure Experience–Part 3: Creating the Web Site

This Part 3 of a series of posts about my “upgrade” to Windows Azure.

Next up in the series is creating the Windows Azure Web Site. Note: This blog post is based on the Preview version of Windows Azure Web Sites and might change in the future.

To get create a new Web Site from the management portal you simply need to click on the + New button.

Creating the Web Site

image

From here a menu will appear. Hint: if you are in the Web Sites section of the Table of Contents, you will get three new web site selections available, otherwise you will have to navigate “Compute” then “Web Site”

image

You’ll see that I have 3 options

Quick Create

Quickly create your web site by specifying a URL. You can perform tasks like deployment and configuration later.

Custom Create

Create a web site with additional options, such as a new or existing database, or with continuous deployment from source control.

From Gallery

Choose a web application from the gallery. This lets you choose from one of the many preconfigured ASP.NET applications like WordPress.

Quick Create

Click on Quick Create and you will be asked to enter a URL and Region for your website like this.

image

Whether you are choosing a Free, Shared or Reserved web site you must select the subdomain to use with .azurewebsites.net.  The site will do a real time check to see if you have chosen a name that already exists like this.

 

image

If the subdomain you have chosen is valid and available the text box will look like this.

 

image

If you region is good, you can click on Create Web Site.

Unfortunately, I could not get a screen shot to show the status will it was creating but this is what the page looks like after

image

You’ll notice now that I have a second web site created, in like 10 seconds. with a notification telling me it was complete.

Custom Create

For custom complete you are asked for a little bit more information.

 

image

URL: Must be a subdomain that is valid an available

Region: Chose a region close to where your primary users will be.

Database: Select from the following choices

image

If you have existing databases, you can select one of them.  If you select Create a new SQL Server database or Create a new MySQL database, you will get prompted for more details around that database. Note: If the web site region and database region do not match, you will get an alert similar to this.

image

 

Publish from source control: If you select this option, you have the ability to chose from one of many options including:

  • Team Foundation Service
  • CodePlex
  • GitHub
  • DropBox
  • Bitbucket
  • External repository
  • Local Git Repository

Each one of these will take to a login page for that service where you can authorize access to the service.

From Gallery

For the Gallery, you get to choose from a wide selection of prebuilt sites and templates. These are broken up into categories to make the selection easier.  Here are some (not all) of the out of the cloud templates:

  • .DotNetNuke
  • Acquia Drupal
  • ASP.NET Empty Site
  • BlogEngine.NET (my favorite)
  • DasBlog
  • Joomla
  • Orchard
  • Umbraco
  • WordPress
  • and many more….

Once you choose one, there will be prompts for the specific site you choose to install.

Windows Azure Experience–Part 2: Management Portal

This Part 2 of a series of posts about my “upgrade” to Windows Azure.

Next up in this series is the Windows Azure Management Portal.  It can be accessed directly at https://manage.windowsazure.com/ or by visiting http://www.windowsazure.com/en-us/ and clicking on the portal link in the upper hand corner.

SNAGHTMLba8532e[5]

 

To access the portal you will need to sign in with the same Windows Live account that you used to create the account.

Note: There are two different sign is screens available, one for those the use a Microsoft Account for Office 365 and one that use a “regular” Windows Live account like hotmail.com or msn.com.

Navigation

The “home page” for the portal is broken up into 4 parts:

image

 

Part 1 – Navigation Bar

The navigation bar allows you to view documentation, pricing, downloads, community and support. You can also change the language and access your account.

Part 2 – “Table of Contents”

This lets you access off of the Windows Azure Services that you have.  There will be a number beneath each services which indicates what have many “items” you have activated with that service.  In my example, I have 1 Web Site and 2 SQL Databases.  You can click on any of these to access the service.

Part 3 – Main Body

This is where the settings or actions of the service items live.  In the example above, you see all items which lists all of the services I have and their current status.

For the “All Items” selection you get a list of all the services that you have a subscription and their statuses.  Windows Azure allows you to have multiple subscriptions linked to one account, that is why the subscription column is present.

image

Part 4 – App Bar

The app bar is synonymous with the  Windows 8 app bar, it provides actions that you can take based on what service you are in and what item is selected. In the example above I have a web site selected so I am presented with the ability to:

  • Create a new Web Site
  • Browse the Site
  • Stop the Site
  • Restart the Site
  • Manage Domains
  • Delete the Site
  • Install Web Matrix
  • View (context sensitive) Help

Windows Azure Experience–Part 1: Creating the Account

This Part 1 of a series of posts about my “upgrade” to Windows Azure.

After I decided to embark on this adventure, I activated my “Azure Benefit” which was part of my Microsoft MVP benefit. However, most users will want to navigate to the pricing overview page and see what services you require based on your needs. In order for me to determine what services I needed I went through the documentation on the Windows Azure portal. I decided that for my needs I needed a Web Site (shared) and one SQL Database. I went with the shared web site, instead of the using one of the 10 free because I wanted a custom domain.  If you are fine with yourdomain.azurewebsites.net, then the free web sites might be an option.

Getting Started

You have three choices when you want to use Windows Azure

No matter what option you chose, you will need a Windows Azure account (any Windows Live Id will do) and a valid credit card, even for the free stuff. The credit card will only be charged for what you use over your preset spending limit that you set in your management portal. If you are curious as to how much it will cost you, you can use the handy calculator.

The Windows Azure Experience

A few weeks ago, I embarked on a task to move one of my sites from a traditional hosting provider to Windows Azure Web Sites. I did this for a few reasons and it has nothing to do with the hosting provider.

  1. I was helping out at one of Global Windows Azure Boot Camps, so I felt I should see what it’s like first hand.
  2. The site I moved needed to be able to scale up on certain days / weeks.
  3. I’m a geek and wanted a new “toy” to play with.

This blog post is the first in a few that will talk about the different parts of the overall “Migration”

The “Parts” will be updated as the posts are published.

%d bloggers like this: