Syntax Highlighter

sábado, 27 de diciembre de 2014

Redis Caching Provider for DNN Platform

redis-300dpiTwo months ago I promised a gift for the friends at the DNNCon, a new open sourced DNN caching provider based on Redis. Today, I’m pleased to announce that I have implemented a first version of the provider and tested it on both on-premise and Azure environments.

This caching provider allows you to use a Redis cache server/cluster within DNN Platform, using a hybrid in-memory approach to increase cache performance (items are cached in the local memory and on Redis cache), and the publisher/subscriber feature to keep in sync all the in-memory caches from the webfarm. You must use Redis 2.8.17 or higher for an on-premises deployment. The caching provider is also Azure Redis cache compatible.

If you want to contribute to the caching provider, just go to https://github.com/davidjrh/dnn.rediscachingprovider and clone the repository.

 

Quick Start

  1. Provision a Redis cache to be used by your DNN instance. Perhaps one of the fastest ways to do it is to provision an Azure Redis cache by following the steps described at http://msdn.microsoft.com/en-us/library/dn690516.aspx, remember to provision the DNN instance on the same datacenter location to improve performance. You can also provision your Redis cache on your premises by following instructions provided at http://redis.io/download. The caching provider has been tested with the Win64 Redis port. Note that the DNN Redis Caching provider supports working with a shared Redis cache deployment, so you can reuse the same Redis cache deployment on several DNN websites.
  2. Download from the https://github.com/davidjrh/dnn.rediscachingprovider/tree/master/Release folder the latest version of the DNN Redis Caching provider
  3. Using the Extensions page of your DNN instance, upload and install the Redis caching provider. Once installed, will be the default caching provider.
  4. Open your web.config file and specify the RedisCachingProvider connection string in the ConnectionStrings section. If you are using Azure Redis cache, your connection string should look like this:

<connectionStrings>

<add name="RedisCachingProvider" connectionString="mycache.redis.cache.windows.net,password={base64password},ssl=True" providerName="DotNetNuke.Providers.RedisCachingProvider" />

</connectionStrings>

 

Advanced configuration

There are some attributes you can use to tweak or debug the caching provider. The initial set of configurable attributes are:

  • keyPrefix (default string.Empty): this attribute is used to add a prefix to each key stored on the Redis cache. This can be used to share the Redis cache between different DNN deployments. When no prefix is specified (default empty string), the current DNN Host Guid will be used so by default, the cached keys are partitioned by the Host identifier.
  • useCompression (boolean, default false): before inserting on the Redis cache, the value is compressed in order to save memory. The values are deflated when retrieved from the Redis cache. While using this parameter can save resources on the Redis server has a performance penalty because of the compression operations
  • silentMode (boolean, default true): when the silent mode is set to true and an exception occurs, is logged on the DNN instance log files under "/Portals/_default/Logs" and not raising an exception. Note that the in-memory cache is used before the Redis cache, so the site normally will continue working, but can end in out of sync caches. Keep an eye on the log files to verify that everything is working fine.

Hope this helps. Happy coding, and happy new year!!

martes, 9 de diciembre de 2014

La hora del código: ASP.net vNext

imageLlegó la hora de cerrar los eventos que tenemos programados desde TenerifeDev para este año, y hemos hecho unos cambios de última hora para el evento de este jueves aprovechando  el evento global “La Hora del Código”. Para los que no sepáis de que va, es “un movimiento mundial, llegando a decenas de millones de estudiantes en más de 180 países. Cualquier persona, en cualquier lugar puede organizar un evento Hora de Código. No se necesita experiencia y está destinado para edades entre 4 y 104 años”.

Por este motivo, hemos cambiado la sesión sobre SharePoint por una más general de mayor audiencia de Introducción a ASP.net vNext, en el mismo sitio y misma hora. Esta sesión iba a ser impartida por Tiberiu Covaci (MVP de ASP.net), pero por razones de última hora hemos cambiado su sesión para principios del año que viene. En esta ocasión, Santiago Porras (MVP Windows Platform) y David Rodriguez (MVP Azure) serán los encargados de conducir la sesión.

Ir a la página de registro gratuito

  • Evento: Introducción a ASP.net vNext
  • Descripción: Ven y conoce de primera mano cómo será la próxima versión de ASP.net, qué cosas cambian, dónde quedan los WebForms, cómo funcionan los controladores y qué le ha pasado al web.config. Santiago Porras, MVP de Windows Platform (@saintwukong) y David Rodriguez, MVP de Azure (@davidjrh) nos harán un recorrido por cada una de las novedades de la nueva plataforma para aplicaciones web y cloud. ASP.net vNext (aka ASP.NET 5), es completamente Open Source y está disponible en GitHub. ASP.NET 5 está actualmente en Preview.
  • Dónde: Salón de Grados de la ETSII
  • Cuándo: Jueves 11 de diciembre a las 18:00 GMT+0
  • Registro: registro gratuito en Eventbrite

Nos vemos el jueves!!

martes, 7 de octubre de 2014

TenerifeDev: eventos para cerrar el año

TenerifeDev250Hacía algo de tiempo, desde la LAN Party de verano, que desde TenerifeDev no hemos preparado ninguna sesión de esas que nos gustan, donde vamos a pasar una tarde compartiendo experiencias de desarrollo sobre tecnologías innovadoras.

Si aún no conoces nuestro grupo de usuarios, se trata de un grupo sin ánimo de lucro en el que  nos reunimos para compartir experiencias de desarrollo de software sobre tecnologías Microsoft, siendo nuestro punto de encuentro habitual la sala de Grados de la ETSII de San Cristóbal de La Laguna, Tenerife. Este año hemos estado algo liados y no nos hemos las veces que nos hubiera gustado, pero nos hemos puesto un  objetivo de reunirnos al menos una vez al mes con diversas temáticas de alto grado de interés tanto para los alumnos como para gente como nosotros, que seguimos en el ámbito del desarrollo de software de forma profesional, facilitando un punto de encuentro entre alumnos y empresas.

 

Próximos eventos

Después de hacer un hueco en la agenda, hemos conseguido cerrar las siguientes fechas y temáticas, para lo que resta de año:

  • 16 de Octubre de 18:00 a 19:30 - Introducción a Azure Websites y Responsive Design:
    no te pierdas de la mano de Santiago Porras (MVP en Windows Platform Development) y David Rodríguez (MVP en Microsoft Azure) una sesión de introducción al desarrollo sobre Azure Websites, viendo distintos aspectos como la creación del site, integración con GitHub y Visual Studio, copias de seguridad, así como la forma de implementar tus sitios web mediante un diseño responsivo que sea adapte a cualquier dispositivo. Como no, veremos algo de Windows 10 para abrir boca.
    Lugar: Aula de la FEULL, antigua torre de Químicas
  • 19 de Noviembre de 18:00 a 19:30 - Introducción a Azure Mobile Services y Aplicaciones Universales:
    no te pierdas de la mano de Santiago Porras (MVP en Windows Platform Development) y David Rodríguez (MVP en Microsoft Azure) una sesión de introducción al desarrollo de apps para dispositivos móviles, integrando notificaciones push, bases de datos en backend, uso de proveedores de identidad como Facebook o Twitter, y todo ello compartiendo código mediante la creación de aplicaciones universales, el nuevo modelo de desarrollo de apps multi-plataforma.
    Lugar: Salón de Grados de la ETSII
  • 11 de Diciembre de 18:00 a 19:30 - Desplegando SharePoint en la nube:
    no te pierdas de la mano de Alberto Díaz (MVP de SharePoint Server), una sesión sobre cómo desplegar una granja de servidores SharePoint sobre Microsoft Azure, con tips & tricks sobre rendimiento y manual de buenas prácticas, y todo en menos de 10 clicks.
    Lugar: Salón de Grados de la ETSII

TenerifeDev también eres tú

No olvides que tú también puedes dar una sesión y compartir tus inquietudes y tus experiencias. ¿Que te gustó lo que hiciste el fin de semana y quieres compartirlo? Adelante. ¿Que estás en un proyecto que crees que sería interesante para mostrarlo? ¡Todos queremos verlo!

Para ello es muy fácil, ponte en contacto con nosotros a través de cualquiera de los siguientes medios y lo organizamos sobre la marcha.

jueves, 2 de octubre de 2014

I got a new laptop: where is my Break key?

This post is in memoriam to those cool keyboard designers that happily remove keys from laptops, just because they run out of space or because they think that key is no longer being used, doing things more funny for IT guys that they don’t have anything to do but spend their time on looking how to change now from full screen mode while doing a Remote Desktop session.

Raiders of the lost key

I have to say that I am very happy with my DELL M3800 laptop, it’s a real black beast workstation (16GB RAM, two SSD disks, UHD touch screen with the weight, etc.) with a very low weight, only 1,88Kg, what it does ideal for having opened several Visual Studio sessions, some Hyper-V machines running and a lot of other tasks in background. Cool!

I normally have the laptop connected via USB 3.0 to the dock station so I normally use an external keyboard during working hours, and was yesterday while running my awesome Windows 10 Technical Preview using Hyper-V and went to full-screen mode and unpinned the top bar to hide the remote session options (wanted a more immersive experience). To go to full-screen mode I used the menu “Full-Screen” from the Hyper-V window, but when I tried to came back to my real desktop by using the “Ctrl+Alt+Break” key combination, where in the hell was my Break/Pause key?

Keyboard_Low_Res

DELL M3800 Keyboard Layout

And then, I discovered a world of frustrated DELL customers asking for the same thing. How this can happen? How can I solve this?

Solution

I’m going to post here the solution so you can use it as well, but I’m really writing this because I’m sure I will need to revisit this post in a near future after reinstalling my OS for whatever reason.

I first tried to use a simple PowerShell cmdlets by sending the keys combination, but this was not working because the keyboard hooks just sends the keys to the Guest OS, and not to the “hosting Hyper-V window”.

Then I tried to use AutoHotKey in my local session, and while it’s a highly recommended piece of software for other tasks, has the same problem than using PowerShell, the keys are not sent to the hosting Hyper-V process (there are some attempts of resolving it by looking for the process handle, but after spending some time on that path, anything worked).

I gave a try to On Screen Keyboard (run osk.exe in a command line), in both the host OS and the Guest OS, but had the same issue, didn’t work!

So the solution: remap a key in my keyboard. This comes from a DELL support forums thread but I’m going to complement the answer because the procedure explained there is not easy to follow and does not explain how to map whatever key you want. 

WARNING Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. Modify the registry at your own risk.

Remapping a key by using Scancodes: the hard way

I noticed that I was never using the key “Insert” (must be a key that keyboard designers use a lot), so I decided to convert that key as my new “Break” key. To do this remap, you must to do some modifications in your registry and then logoff/login again into your profile (restarting the laptop also works, but the first method is faster).

To change a key for another, you must open your registry editor by running regedit.exe and finding the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout. There you can manually change the keyboard mappings but this is not an easy task since you will need to start wasting your time looking for the scancodes documentation:

image

If you want to go that path, I recommend you to visit this link with a good keyboard scancodes reference: http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html

Remapping a key by using Scancodes: the easy way

I was getting a headache reading all these documentation and then found an awesome Open Source tool called Sharpkeys and available at CodePlex that allows you to do this task without diving into any keyboard code reference. So here the final steps I followed:

  1. Download and install SharpKeys from CodePlex
  2. Run the app and click on the “Add” button to add a new key mapping
  3. From the left list, select the key you want to map in your keyboard (I used “Insert”). You can easily find another one by clicking on the “Type Key” button
  4. From the right list, select the key you want to target. In our case, and for the purpose of this post in pro of a human race with happy IT guys, we are going to specify “Unknown: 0xE046”, that is the Scancode for the <Pause/Break> key
  5. Click on OK and that will save the entry in your registry
  6. Logoff and logon again, and you will see now that by using <Ctrl>+<Alt>+<Insert> is now working as <Ctrl>+<Alt>+<Break>

image

Remapping a key by using Scancodes: the faster way

I have exported the registry key so if you want to use just the same mapping, changing the “Insert” key for the “Break” key without doing anything else, just download this file and open it to import it into your registry.

Hope this helps!

viernes, 26 de septiembre de 2014

Solving OneDrive for Business 2013 synchronization issues

If you are reading this is probably because you have suffered synchronization issues while using OneDrive for Business 2013 to sync a SharePoint document library to your local file system, something really useful to work with offline files while disconnected from the network and allowing the utility to sync when coming online.

Which type of issues? Well, sounds bad, but one of the worst things I have experienced is that if a problem occurs when the sync starts, no sync is done at all, getting a popup window telling that somebody in your organization used, for example, a long file path. If OneDrive for Business founds something like this issue, it simply stops, does not continue with the other files. Bad.

FileNameTooLong

So you go to the document library, and trying to figure out the full path that the bubble is omitting, you change the file name or folder to shorten it and solve the issue…and then another popup, and other, until you have solved all these issues. No way of knowing all the possible issues to fix them at the same time.

And solving all the issues can be a hard task, if you see the sync restrictions available at http://support.microsoft.com/kb/2933738, from long path names to illegal characters and well… files of 2GB in size (who is storing 2GB files on SharePoint Online? BTW, who is storing 1,9GB files on SharePoint Online?)

Anyway, I was tired of following this procedure to solve the items one by one and decided to build a PowerShell script to analyse the document library structure returning all the conflictive files in a single operation.

PowerShell to the rescue

I have built a PowerShell script available at https://github.com/davidjrh/o365tools/ that uses the SharePoint Server 2013 Client SDK assemblies to connect to a SharePoint Online site and start doing the analysis. You can specify a document library or let the cmdlet to look all the document libraries in the site. You can pass the credentials as a PSCredential parameter or introduce them in a secure popup window when requested. Also enabling the Verbose switch will show the full progress of the analyzed files.

.\Get-SPOInvalidFilesForSync.ps1 -SiteName "https://mytenant.sharepoint.com" 
-DocumentLibraryName "My Documents"
-Credential $credentials
-Verbose

-SiteName The SharePoint Online site's URL. Ensure to specify https

-DocumentLibraryName Optional. The name of the library to process

-Credential Optional. The credentials to be used to connect to SharePoint Online. If omitted, the script will pop up for input

-Verbose Optional. If specified, all verbose messages will be shown

PowerShellIseResult


Now you can go and customize this script and, for example, send an e-mail to the owner of that file asking for renaming it to fix the issue. Running this in an scheduled task is what I’ve finally do it.


Conclusion


SharePoint is good and OneDrive for Business is not bad. But PowerShell rulez.

jueves, 10 de julio de 2014

TenerifeDev en la TLP-Innova con Azure y aplicaciones universales

EntradaTLPComo much@s sabrán, la Tenerife LAN Party está a la vuelta de la esquina celebrándose del 15 al 20 de Julio, un evento que no hace más que crecer y crecer edición tras edición, y esta no ha sido menos. Las 2.000 entradas para el acceso al recinto ferial se agotaron en…2 minutos!!

 

Quizás una de las secciones que más atraen al mundo profesional es la TLP-Innova, un encuentro de comunicadores, programadores y profesionales que viven y trabajan en el entorno tecnológico. En esta edición hay dos novedades a destacar en cuanto la organización:

  • El evento tendrá lugar en el Auditorio de Tenerife Adán Martín del 16 al 19 de julio (cerca del recinto ferial donde se desarrolla la TLP, pero en un ambiente más profesional)
  • La entrada a todas las jornadas es totalmente GRATUITA

Las charlas y sesiones que se están cociendo están, creedme, para no perderse ni una. Podéis acceder al listado completo a través de este enlace: http://tlp-innova.com/actividades/

TenerifeDev quería poner su granito de arena y os hemos preparado un monográfico de tres sesiones sobre Azure donde podrás aprender las características más importantes de la plataforma, además de una sesión adicional sobre el desarrollo de aplicaciones universales. Os dejamos el detalles de las mismas:

MicrosoftAzure

Microsoft Azure

Fecha: Jueves 17, de 10:00am a 12:55pm
Ubicación: Sala de Cámara del Auditorio de Tenerife
Ponentes:

10:00 – 10:55 - Microsoft Azure (I): todo lo que un desarrollador debería saber

Conoce las características que pueden hacer que el desarrollo de tus aplicaciones sea un juego de niños gracias a los Azure WebSites y Mobile Services y domina el los despliegues y el código con Visual Studio Online.

11:00 – 11:55 - Microsoft Azure (II): el cielo para IT Pros

A la hora de llevar tu solución a la nube es necesario pensar anteriormente las diferencias existentes entre esta y el escenario al que estamos acostumbrado dentro de nuestro datacenter. En esta sesión presentaremos las respuestas a las preguntas más comunes que recibimos: ¿en qué datacenter podemos colocar nuestras máquinas virtuales?, ¿cómo garantizamos la alta disponibilidad de nuestros servicios frente a posible fallos del hardware o actualizaciones del host?, ¿cómo gestionamos altas cargas de tráfico mediante el balanceador? ¿cómo podemos controlar el acceso a nuestras aplicaciones mediante el filtrado y ACLs? Y lo más importante, ¿cómo podemos prever el coste mensual de la infraestructura desplegada en la nube?

12:00 – 12:55 - Microsoft Azure (III): últimas novedades presentadas en el TechEd 2014

Desde su lanzamiento oficial en febrero de 2010, la plataforma Azure no ha parado de crecer tanto en el número de servicios para la construcción de soluciones basadas en la nube, como en la disponibilidad de la misma a lo largo de todo el globo. El pasado mes de mayo se presentaron en el TechEd de USA un gran número de nuevos servicios y actualizaciones que han dejado con la boca abierta a la comunidad técnica. ¿Te imaginas poder desplegar una aplicación que fue desarrollada en los años 90 en la nube y accesible desde un iPad o una tablet Android, todo sin tener que tocar una línea de código de la aplicación? Esta y muchas otras serán las cosas que veremos en esta sesión para concluir con las sesiones sobre Microsoft Azure.

UniversalApps

Universal Apps para dominarlos a todos

Fecha: Jueves 17, de 10:00am a 12:50pm
Ubicación: Sala Multiusos B del Auditorio de Tenerife
Ponentes:

13:00 – 13:50 - Universal Apps para dominarlos a todos

Las Universal Apps son el último paso que ha dado Microsoft para desarrollo de aplicaciones para Windows Phone 8.1 y Windows 8.1 incluyendo, como principal cambio, poder compartir casi la totalidad del código gracias al uso del núcleo Windows Runtime. En esta sesión veremos algunas de las principales características que harán que disfrutemos creando aplicaciones.

 

Como es habitual, tendremos sorpresas y algunos regalitos para los más “avispados”. ¡No faltéis!

Un saludo, y happy coding!

martes, 17 de junio de 2014

How to easily publish your own app through Azure RemoteApp Preview without uploading an image template

If you are playing with the Azure RemoteApp Preview (you can enable the features preview here: https://account.windowsazure.com/PreviewFeatures), you would like to publish your own WinForms applications without uploading a template image. If your application can run on the default Windows Server 2012 R2 that is available when creating a new RemoteApp service, you can follow these steps.

Copying files through the Open/Save as dialogs from any application like Word, Paint, etc. is available so... why not to copy and paste my App files through them? Sounds really silly, but it works! So... why not to enable the File Explorer to allow copying/pasting files from my file system to the remote VM and then publish the applications? Easy! Let’s see how to do it.

Publish File Explorer

Once you have created your RemoteApp service, let’s go and create a new shortcut for the File Explorer:

  1. Go to your RemoteApp service and then to the RemoteApp Programs tab
  2. Click on the “Publish > Publish programs using path”
  3. In the Name textbox type “File Explorer” and in the path type “%SystemRoot%\explorer.exe”image
  4. Click on OK

Now when opening the Microsoft RemoteApp client, the file explorer is available and after opening you will notice that you can copy files from your local system and then pasting them on this File System instance.

image

As example, you can copy a WinForms app to the remote file system as shown below. BTW, you can also copy an installer and run it by opening it later.

image

Now you can go to the “RemoteApp Programs” list and just create a new shortcut for your application.

image

Do you need to setup something else for your RemoteApp? You can easily publish cmd.exe and powershell.exe as well. No limits!

Remember that this is a service preview and lot of new features will be available soon. This is only to make things easier while testing your own RemoteApps in this phase.

Hope this help!

sábado, 10 de mayo de 2014

How to know which Azure VM image are you consuming?

MostMM02_iDiskIconA few days ago I was wondering if one of the SQL Servers I deployed some months before was provisioned using a SQL Server “pay-per-use” image or was done by using a clean Windows Server 2012 R2 image and then manually installed the SQL Server on it. At the beginning the question seemed  trivial, and that I could easily found that by simply logging into the VM and check the version number on SQL Server (i.e. by running SELECT @@version, or similar), but I was not really happy with what I found. Another way could be to check the billing details, the VM should be there in some way, but apart of the number of records that I had on those details plus the fact that those details were grouped by cloud service name, and that in some cases I would not have access to the billing information, this didn’t seem the correct path.

How to be immediately 100% sure that I was using one image instead of another? What if I have the same question about other “pay-per-use” VM image, and trying to found symptoms is not easy?

Looking at the Azure Portal

If you go to the Azure Portal and deploy a SQL Server VM via the VM Gallery, PowerShell or another way, you will currently find that in the VM dashboard there is a lot of information about the VM but no detail of what image are you paying for. The disk area shows you the current attached disks that in some way were used to initially provision the VM, but again, there is no information about which image was used:

AttachedDisks

PowerShell to the rescue

After the initial ideas, I found in the MSDN Virtual Machine REST API documentation that in the “GetRole” operation there is a way to obtain the source image name of the image used to create the OS disk:

SourceImageName

Ok, almost there. So if there is a REST API, almost sure that there is a Cmdlet that uses that API, so before starting to build a REST client app, just tried to find it and hurra!…was there!

# Setup the credentials using a management certificate
$subscriptionName = '<your subscription Name>'
$subscriptionId='<your subscription Id>'
$thumbprint = ‘<the thumbprint of your management certificate>’
$mgmtCert = Get-Item cert:\\CurrentUser\My\$thumbprint
Set-AzureSubscription -SubscriptionName $subscriptionName -SubscriptionId $subscriptionId -Certificate $mgmtCert

# Select the subscription
Select-AzureSubscription $subscriptionName

# Obtain the source image name
$(Get-AzureVM -ServiceName sqlcosttest).VM.OSVirtualHardDisk.SourceImageName

By running this, you get different results from a VM that was provisioned by using a SQL Server image rather than a Windows Server one. The Source Image name can give you an idea of what are you paying for (this case I was paying for a SQL Server 2014 Enterprise on Windows Server 2012 R2, the April’s release):

DifferentVMSourceImagenames

With the VM Source Image Name you can now use the cmdlet Get-AzureVMImage to obtain the full information of the source image:

GetAzureVMImageName

Running the cmdlet Get-AzureVMImage without parameters gives you the full list of current VM images ready to deploy.

Conclusion

After thinking twice, now seems obvious how to obtain the information I was looking for, and would be more obvious for those ones using Powershell day by day. It’s not my case, and day by day I learn a new highly useful cmdlet that will never forget. In fact, my RescueTime reports tell me that I’m increasing the time I daily spend on running Powershell cmdlets. Hopefully this helps you and encourages you to learn more about Azure cmdlets.

Un saludo and Happy Coding!

domingo, 23 de marzo de 2014

Cosas que debo llevar al Global Windows Azure Bootcamp

bootcampYa sólo quedan unos cuantos días para vernos en el evento Global Windows Azure Bootcamp y parece ser que estamos que lo petamos, hemos tenido que colgar el cartel de no quedan más entradas. Aún así, puedes registrarte a la lista de espera, ya que vamos a realizar un proceso de comprobación de asistencia para liberar las plazas que no vayan a utilizarse.

Recuerda que aparte de las estupendas sesiones que transcurrirán a lo largo del día, vamos a hacer historia con la mayor granja de servidores global colaborando en un proyecto de investigación científica para el diagnóstico temprano de la diabetes Tipo 2. Va a ser algo grande y que dará mucho que hablar sobre el potencial de la computación global, algo de lo que podrás sentirte orgulloso de haber puesto tu granito de arena y haber colaborado en ello.

HF-and-Diabetes-Glycosylation-150.small_

Pulsa aquí para conocer más acerca del Global Windows Azure Bootcamp GlyQ-IQ lab

Para poder participar y colaborar en esta investigación es necesario que te prepares para ello. ¿Ya lo tienes todo listo? ¿Te acuerdas de lo que tenías que llevar al evento?

Activar suscripción de Windows Azure

No te preocupes, que no tienes que saber nada de biología molecular ni ser ingeniero en computación distribuida. Tan sólo tienes que llevar una cosa: una suscripción activa de Windows Azure.

Hay diversas formas de conseguir una suscripción de Windows Azure te animamos a hacerlo desde ya para evitar retrasos en la activación de la misma el día del evento:

  • Activar suscripción gratuita de 30 días.- siguiendo este enlace podrás activar una suscripción gratuita de un mes con un crédito de 150€, más que suficiente para desplegar hasta 20 servidores durante el transcurso del evento sin tener que poner un céntimo de tu bolsillo;

Activar suscripción gratuita de Windows Azure

  • Activar los beneficios de tu suscripción a MSDN.- los suscriptores de MSDN tienen como beneficio una suscripción a Azure de 150$ mensuales, cuyos recursos pueden también utilizarse para este evento. Hot Tip: ¿la empresa donde trabajas es Partner de Microsoft? Comprueba los beneficios de las competencias adquiridas y activa las suscripciones MSDN asociadas a las mismas!

OPCIONAL: llevar un portátil es opcional, aunque recomendable. No necesitarás llevar nada preinstalado ni instalarás nada allí. Simplemente se tratará de desplegar un servicio en Azure a través del mismo navegador, algo de lo que daremos más detalles en el día del evento. El área de “Azk the Expert” estará disponible a lo largo del día para solucionar cualquier problema que tengas.

Vamos a hacer historia. ¡Nos vemos el sábado!

domingo, 9 de marzo de 2014

¡Ya se acerca el Global Windows Azure Bootcamp!

bootcamp-300x202El próximo 29 de Marzo se va a desarrollar a lo largo del día y en cerca de 140 localizaciones a nivel del globo el mayor evento global sobre Windows Azure. Se trata de pasar un día aprendiendo y compartiendo conocimientos sobre la plataforma en la nube de Microsoft, a la vez que de forma simultánea se realiza una investigación para el diagnóstico temprano de la diabetes tipo 2.

Desde la comunidades técnicas de España hemos querido hacer un evento muy especial y lo vamos a concentrar en Madrid en la sede de Microsoft, donde estaremos todos los especialistas y MVPs que actualmente estamos día a día trabajando con la plataforma Azure.

La realización de este evento con los líderes de la comunidad de Windows Azure en España manteniendo la asistencia gratuita no sería posible sin la dedicación y duro trabajo de los presentadores, organizadores y contribuciones económicas de otras organizaciones para ayudar a financiar la logística del mismo. Muchas gracias a todos ellos.

El registro a este evento es gratuito -¡Sí! ¡Gratis!- y se realiza a través de Microsoft World Wide Events. Regístrate en el enlace siguientepara estar en Madrid y atender en persona al Windows Azure Bootcamp 2014 en Madrid. ¡No tardes, las plazas son limitadas!

Registro al Global Windows Azure Bootcamp – Madrid

Para más información, visita los siguientes enlaces:

¡Allí nos vemos!

viernes, 31 de enero de 2014

Looking for a Surface 2 Pro 256GB using the Azure Cloud Power

SurfaceSince some weeks ago I have been trying to find a way of buying a Surface 2 Pro 256GB to definitively replace my development laptop. Some videos I have seen on YouTube like having 4 external displays brought my attention and after asking Joe Brinkman and Alberto Diaz about their experience working with the tablet as a dev machine both answered that definitively can replace my laptop (of course with the docking station). The final decision was taken after seeing another thread in the Surface Forums about the gaming experience like playing Call of Duty Ghosts on a Surface Pro 2.If that beast can move those types of games, for sure that can replace my current laptop.

And the problem started…

Looking for a Surface 2 on the stores

I have been trying to find a Surface 2 Pro 256GB in order to have the 8GB RAM in almost all the stores on Internet, and was really surprising that this model is Out of Stock in almost all of them. When finally found that the Microsoft Store at UK, I started to evaluate the problem of not getting the correct warranty if I’m in another country, different AC plugs than Spain, etc. The price it’s not low so the risk of having a problem without a store/warranty was not an option.

Tweet

So the final decision was to buy it on Spain but same problem. Out of stock. I call the Microsoft Store and they didn’t know about when they could arrive. Bad thing.

I’m a developer, I don’t like doing things twice

I have been checking the Microsoft Store website twice a day since two weeks ago, and I was starting to be tired of doing it. So I was wondering if I could automate the process and receive some type of alert when the devices were in stock again. And then I found the how to create my new minion.

Looking into how the Store page works, I noticed that a GET WebAPI call is done to show the availability of the product:

GET-WebAPI

More interesting was the result of that WebAPI call, since it’s an XML with the stock status for that product:

StockStatus

Idea! Idea! Idea!

If I didn’t want to check the website twice a day, what I would like was just to receive an alert of when the devices were in stock again. Would be nice to receive an e-mail on such event, and would love get an SMS on my mobile!

I always compare Azure and other cloud services like a Lego store. The pieces are there to build solutions, you only need to know about them. So let’s put some pieces in place:

  • Azure Mobile Services: in order to have a scheduled task looking for the device stock at the store. There are other options but the scheduler provided by Mobile Services is sufficient for this purpose and also free when using 1 scheduled task;
  • SendGrid: in order to receive an e-mail notification for stock changes. Again, there are other options but SendGrid offers a free tier for Azure subscribers that allows to accomplish this also for free;
  • Twilio: in order to receive SMS notifications for stock changes. Again, you can signup Twilio for free –no credit card needed- and send up to 1000 SMS (Azure subscribers get $10 when adding credit later to Twilio).

Cool, I love free stuff.

Adding some code to a scheduled task

So with the pieces in mind, the API keys from SendGrid and Twilio in my Notepad++, I started to create an empty Azure Mobile service through the management console.

MobileService

The only thing inside the mobile service is just an scheduled task configured to run once per hour (my minions must work harder than me!!).

ScheduledTask

Finally the script code for the scheduler task. Note that I have hidden the API keys, e-mails and phone numbers:

function CheckAvailability() {
try {
var url = "http://surface.microsoftstore.com/store/mseea/es_ES/DisplayPage/id.ProductInventoryStatusXmlPage/productID.287012200?_=13";

var request = require("request");

request(url, function(error, r, body) {
if (error) { return console.error(error); }
if (r.statusCode != 200) { return console.error(r); }
var xml2js = require('xml2js');
var parser = new xml2js.Parser();
parser.parseString(body, function (err, result) {
if (err) { return console.error(err); }
if (result.InventoryStatusResponse.availableQuantity != "0") {
sendNotifications(result.InventoryStatusResponse);
} else {
console.warn(result.InventoryStatusResponse.inventoryStatus);
}
});
});
}
catch(e) {
console.error(e);
}
}

var SendGrid = require('sendgrid').SendGrid;

function sendNotifications(inventoryStatusResponse) {
sendSMS(inventoryStatusResponse);
sendEMail(inventoryStatusResponse);
}

function sendSMS(inventoryStatusResponse) {
var httpRequest = require('request');
var account_sid = "Your_Twilio_Account_SID_here";
var auth_token = "Your_Twilio_Auth_Token_here";
var from = "+345550000";
var to="+3465550001";
var message = 'The new Surface 2 Pro 256GB is now available at Microsoft Store. Units available: '
+ inventoryStatusResponse.availableQuantity;

// Create the request body
var body = "From=" + from + "&To=" + to + "&Body=" + message;

// Make the HTTP request to Twilio
httpRequest.post({
url: "https://" + account_sid + ":" + auth_token +
"@api.twilio.com/2010-04-01/Accounts/" + account_sid + "/Messages.json",
headers: { 'content-type': 'application/x-www-form-urlencoded' },
body: body
}, function (err, resp, body) {
if (err) { return console.error(err); }
console.log(body);
});
}

function sendEMail(inventoryStatusResponse) {
console.log('Surface 2 Pro 256GB available at Microsoft Store. Units available: '
+ inventoryStatusResponse.availableQuantity + '. Sending notifications...');

var api_user = 'Your_SendGrid_ApiUser';
var api_key = 'Your_SendGrid_ApiKey';
var sendgrid = new SendGrid(api_user, api_key);
sendgrid.send({
to: 'foo@mydomain.com',
from: 'bar@mydomain.com',
subject: 'Surface 2 Pro 256GB available at Microsoft Store!',
text: 'The new Surface 2 Pro 26GB is now available at Microsoft Store. Units available: '
+ inventoryStatusResponse.availableQuantity
}, function(success, message) {
// If the email failed to send, log it as an error so we can investigate
if (!success) {
console.error(message);
}
else {
console.log('Email notification sent!');
}
});
}

Finally, by commenting the line checking for the availableQuantity != “0”, I got my initial notifications arriving to my devices:


EmailNofitication


Phone


Conclusion


The implementation shown above can be considered a proof of concept –BTW, probably I should not use the Store WebAPI without Microsoft confirmation- of things you can you can do by integrating different cloud services available today, and start using them for free.


The world has changed and is now cloud-connected.


Have you started to think cloud?


Saludos y Happy Coding!

Related Posts Plugin for WordPress, Blogger...