20
GopherMap.com -Azure cloud computing social media mashup demo Roy Lachica, Bouvet ASA NNUG user group meeting, February 23. 2010

GopherMap Azure

Embed Size (px)

DESCRIPTION

Experiences with using the early Microsoft Azure CTP on a private Asp.Net MVC project

Citation preview

Page 1: GopherMap Azure

GopherMap.com -Azure cloud computing social media mashup demo

Roy Lachica, Bouvet ASA NNUG user group meeting, February 23. 2010

Page 2: GopherMap Azure

Agenda

• Background GopherMap– The process towards the sky

• Azure – Challenges– Experiences– Tips and tricks– Azure SQL – Asp.Net MVC, Twitter, Yammer, oAuth

• Demo Azure (14-16)• Demo GopherMap (16-20)

– Feedback

• Questions (20-25)

Page 3: GopherMap Azure

Included in the prototype

• Windows Azure• Azure SQL• .Net 3.5

– Extension methods– Linq to SQL

• Asp.Net MVC• jQuery• oAuth• Twitter API• Yammer API• Google maps API

• Considered:– Topic Maps/RDF/Microformats– Bing maps– Facebook connect– FireEagle API– LinkedIn– Skyhook Loki– Yahoo Upcomming, Event API

Page 4: GopherMap Azure

Background GopherMap

• Why GopherMap.com– Learn new stuff– Want to create

• Experiences from previous private projects– Operational problems: DNS, firewalls, disc full,

logins, service packs, db index needs tuning, file level permissions, loose access when my IP changes, down time.

– Do not have time for operation and administration.– Do not want to spend a lot of money on a private

project .

Page 5: GopherMap Azure

The process towards the sky

• Project idea/vision (2 years ago)

• Started with sample code (Not Azure related) (9 months ago)

• Signed up for Windows Azure account (6 months ago)

• Started development and prepared for forthcoming Azure SQL (5 months ago)

• GopherMap running in the cloud (3 months ago)

Page 6: GopherMap Azure

Challenges

• Yammer open source code used system.diagnostics namespace which failed on Azure.

• Forgot to use Copy local on system.web.mvc DLL

• Twitter oAuth callback could not be set to localhost

• Azure Sql Management studio port 1433 not open at home ISP. Had to use Cerebrata Browser based SQL Azure Database Explorer

• Time

Page 7: GopherMap Azure

Negative exeriencs with Windows Azure

• Lot of hassle with versions and service packs.• Had to reinstall: Windows Azure Tools for Microsoft Visual Studio July

2009 CTP after installing a couple of windows updates.• Product names and namespaces changed.• New CTP’s, new paths and changes to the Windows Azure admin UI. • Had to run on Vista or newer OS. • VS run as administrator.• Hard to read logs.• Difficult to create table storage locally.• Deployment hangs.• Missing versioning/retract/restore in the cloud.• Missing monitoring/profiling (Now part of Azure diagnostics).• Azure costs even if app has not traffic (about 150$/month with

minimal use?)• Missing possibility for automatic load balancing.• No SMTP support.

Page 8: GopherMap Azure

Positive experiences with Windows Azure

• Stabile deployment• Fast end simple deployment • Easy to scaling • Good administration UI• Do not have to administrate/manage/patch server (in

contrary to for example Amazon and Vmwares cloud offerings)

• Can choose between Azure SQL, blog/queue/table storage• Staging server with switch over to prodcution• Easy to log errors with

– RoleManager.WriteToLog(string eventLogName, string message)

Page 9: GopherMap Azure

Tips and tricks

Programming for Azure without Dev fabric

• Why would you do that:– Dev fabric takes time to boot and you and change the files on the fly. Dev fabric

will even sometimes hang. This makes markup and CSS development slow.– twitter oAuth and possibly other services is problematic because call-backs can’t

be set to localhost. Dev fabric usually runs on localhost:81– Requires Vista OS

• How to develop outside dev fabric– Use stand alone web app and 1) copy to dev fabric or have two VS solutions then

2) deploy to Azure staging server and then 3) switch over to production.– Write code that automatically detects environment and use the correct DB

Connection String.– Read configuration settings from web.config when running outside dev fabric.

When running in Dev fabric read settings from Azure ServiceConfiguration.cscfg– Write adapters that replace blobstorage when running outside dev fabric.

– http://screencasts.ehuna.org/2010/01/how_to_speed_up_windows_azure.html

Page 10: GopherMap Azure

How to check what environment you are runing inpublic enum EnvironmentType{ Azure = 1, DevFabric = 2, LocalNoDevFabric = 3}

public static EnvironmentType CurrentEnvironment{ Get {

if (Microsoft.ServiceHosting.ServiceRuntime.RoleManager.IsRoleManagerRunning) {

if (Microsoft.ServiceHosting.ServiceRuntime.RoleManager.GetConfigurationSetting("BlobStorageEndpoint").Contains("127.0.0.1")) return EnvironmentType.DevFabric; else return EnvironmentType.Azure; } else { return EnvironmentType.LocalNoDevFabric; } }}………………………..

public static string ImagesBlobStoragePath{ get { if (GopherMap.Helpers.GophyEnvironments.CurrentEnvironment == GophyEnvironments.EnvironmentType.LocalNoDevFabric) return "/blobstorage/”; else return Microsoft.ServiceHosting.ServiceRuntime.RoleManager.GetConfigurationSetting("BlobStorageEndpoint").Trim() +

"/imgs/"; }}

Page 11: GopherMap Azure

Azure SQL

• Pros– Do not have to deal with artificial data tables

(such as Azure Table storage, Google Bigtable, Amazon simpleDB)

– Just as working with any other database through MSSMS

• Cons– Restrictions on port 1433– Restrictins on Sql server statements that can be

used. • Have to convert and strip before you migrate data.

Page 12: GopherMap Azure

Experiences with using social API’s

• Twitter– Mye data caching for å slippe å gjøre kall mot

server hele tiden for alle klienter– gratis autentisering og brukerprofil informasjon– ulemper: ved caching så får man problemer med

at app blir declined på server men cookies henger igjen

• oAuth– med oAuth så går jeg som bruker til oAuth

provideren for å fjerne tilgang.–

Page 13: GopherMap Azure

GopherMap on Azure, pros and cons in comparison to traditional hosting

• Pros:– Less can go wrong during operational management– Better security– Staging environment– Don’t have to worry about server been taken down– Less downtime– Saves time– Simple scaling (Distributed caching with AppFabric former velocity)

– Green

• Cons:– Can not install things on server– Not free

Page 14: GopherMap Azure

Oppsummering

• Azure makes life easier for developers.– Deployment faster and more simple. No need

for Terminal services RDP: trenger ikke remote inn med remote desktop og styre med å laste opp riktige filer og legge de ut på riktige steder og oppdatere ulike konfig filer osv osv.

• Some childhood diseases.• Less hassle for those who start now.• Works well for Social apps and using

Asp.Net MVC• Here to stay.

Page 15: GopherMap Azure

Hvordan komme i gang

• En del eksempler tilgjengelig• Du kan kode i C#, VB.Net, PHP• Ta utgangspunkt i NerdDinner eller

myTODO

Page 16: GopherMap Azure

Azure demo

• https://windows.azure.com

Page 17: GopherMap Azure

GopherMap demo

• http://www.gophermap.com• Lar deg finne relevante personer

(relevant kompetanse)• Beregnet spesielt for – Konferanser og seminar– Store organisasjoner

Page 18: GopherMap Azure

Lenker (howtos)

• Deploying an app:– http://ecn.channel9.msdn.com/o9/ch9/4/4/6/6/

8/4/DeployingOnWindowsAzure_2MB_ch9.wmv

• NerdDinner Asp.Net MVC eksempel kode:– http://www.marcmywords.org/post/NerdDinne

r-hosted-on-Windows-Azure-and-SQL-Azure.aspx

• Asp.Net MVC, jQuery på Windows Azure med table storage eksempel:– http://code.msdn.microsoft.com/mytodo

Page 19: GopherMap Azure

Lenker (verktøy)

• Get started:– http://www.microsoft.com/windowsazure/

• My azure apps:– https://windows.azure.com

• Browse blob storage: – http://cloudberrylab.com/download.aspx?prod=cbazur

e

• Migrating database to Azure SQL:– http://sqlazuremw.codeplex.com/

• Free Azure SQL online client tool:– https://onlinedemo.cerebrata.com/SQLAzureClient/defau

lt.aspx

• Azure Log viewer:– http://blogs.itmentors.com/bill/2009/02/10/windows-az

ure-log-viewer/

Page 20: GopherMap Azure

Questions

Bouvet is hiring Open positions:

.Net, Architects, SharePoint, Frontend.

Contact

Roy LachicaE-mail: [email protected] [email protected]: http://roy.lachica.noLinkedIn: http://www.linkedin.com/in/roylachicaTwitter: http://twitter.com/roylacBlog: http://fuzzzyblog.blogspot.com

Also check out fuzzzy.comWeb Science community