Visual Studio

Session: Azure Serverless App Services @ Singapore

July 5, 2016 Azure, Developer Hub, Sessions , ,

On 18th July, I and my friend Faizal (both Azure MVPs in Singapore) will be holding a session as part of Azure User Group in Singapore. In this meetup, we will talk about Serverless Architecture and how Logic Apps and Azure Functions add up to a Serverless App Service architecture for your Business and SaaS applications

The session will demonstrate how integration of existing SaaS applications can be achieved and how event driven serverless programming can be done on Azure. This will be Level 300 talk with more references to architecture than just demos.

The session is completely free, so you can RSVP at below link

RSVP: http://www.meetup.com/mssgug/events/232250594/

Date/Time: 18th July 19:00 SGT
Venue: Microsoft Singapore, Level 22, 22CF12

PS: As part of .NET User Group, we also have a guest MVP Eriawan join us to give an excellent introduction to F# and drive community engagement to the wonderful functional language. So please join his session at 7pm SGT

Session – Internet of Things – Devices and Azure Telemetry (Azure Florida Association)

March 24, 2016 Azure, IoT, Sessions , ,

I am really excited to share my upcoming session on Internet of Things – Devices and Azure Telemetry organized by Azure Florida Association.

The session will be online on GotoWebinar and in one hour I will cover range of topics on Internet of Things.

Date: 30 March 2016 9:00 PM SST (UTC+8)
Duration: 1 hour

What’s on the plate?

The topic of “Internet of Things” pops up in almost every geek world and yet it’s the term that has been misinterpreted the most. This session will cover what’s Internet of Things and the various IoT devices in the market, their inter-communication and how these devices can send telemetry to the Azure world to generate real time analytics and business insights

Register yourself for this free session at Register : Internet of Things – Devices and Azure Telemetry

Watch online at: https://attendee.gotowebinar.com/register/5288930578994944258

The event page is available on Azure Florida Association portal

Global Azure Bootcamp 2016 Website Template

January 27, 2016 ASP.NET vNext, Azure

Last year I had designed the website for Global Azure Bootcamp 2015, Singapore. The website contained information like Agenda, Speakers, Location, Contact, Sponsors, etc. With the help of Global Organizers around 10 countries were able to customize the template to host their own website for their local event.

This year again I’ve designed the template for Global Azure Bootcamp 2016, Singapore. However, unlike last year, the template needs absolutely NO development effort and NO knowledge of HTML5/CSS3/jQuery, etc.

You just need to provide your event information in a JSON file on GitHub repo and host your website as Azure WebApp (where else?). This process takes less than 10 minutes. You can host it on Linux / Windows as it is built using new ASP.NET Core 1.0

Here are some important links, to get you started

Wiki: https://github.com/punitganshani/azurebootcamp/wiki
Demo Site: http://demo-azurebootcamp.azurewebsites.net/
Singapore Site: http://singapore.azurebootcamp.net

One of my friends is also planning to use this information to create a Mobile Application so as far as you have the JSON file, your location will be automatically added to the Mobile App too. Stay Tuned for updates!

PowerShell Classes for Developers

December 22, 2015 PowerShell, Videos ,

Classes in PowerShell have been a feature since long and creating objects of these classes isn’t new. From the classic way of creating objects of .NET classes (like the MailMessage in Example 1 below) or to defining a custom .NET class (in the Example 2 below), we have seen PowerShell extend .NET classes and types in numerous ways.

Example 1: Creating object of a .NET class

$message = New-Object System.Net.Mail.MailMessage

Example 2: Defining .NET class in PowerShell

$source= "
    public class BasicTest 
    { 
        public static int Add(int a, int b) 
        { 
            return (a + b); 
        }
        
        public int Multiply(int a, int b) 
        { 
            return (a * b); 
        }
}" 
Add-Type -TypeDefinition $source

The New PowerShell Classes

Now with new version PowerShell, you can create classes in PowerShell instead of just using .NET classes. Object Orientation is now available in your scripting language so that you can shorten your scripts and make them more maintainable.

Two of my short videos (published on Channel9) will help you quickly rampup your PowerShell skills to create PowerShell classes, objects, methods, overloads, scope and a lot more.

Video 1: Getting Started with PowerShell Classes

Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-PowerShell-Classes-for-Developers-Part-1

 

Video 2: Constructor, Methods, Overloading and Scope

Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-PowerShell-Classes-for-Developers-Part-2

Hope this helps you in understanding PowerShell classes!

NodeJS, Java and .NET Build Automation with VSTS (VSO, TFS)

December 6, 2015 TFS, Videos , , , , ,

Have you tried Visual Studio Online (or Visual Studio Team Services, as it is now called) for build automation? VSTS (TFS 2015) has a new and much powerful build engine than TFS 2013 and you can now configure build automation for NodeJS, Java, Android, XCode and .NET.

The video recording below is a quick guide to configure Cross Platform Build Automation with VSTS or TFS 2015 (on-prem)

 

Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-DevOps-Build-Automation-with-VSTS–TFS-2015

Telemetry for Internet of Things – Pre and Post Azure IoT Suite (Channel 9)

December 5, 2015 Azure, IoT, Videos , , , ,

In the last month, I recorded 3 sessions, 15 minutes each, that illustrate Telemetry for Internet of Things – Pre and Post Azure IoT Suite for Channel 9.

These short videos can help the audience understand general concept of Internet of Things, Event Hubs, Azure IoT Suite and Hub. The examples discussed in the video are in .NET and NodeJS

 

Video #1: Understanding IoT and Event Pipeline

Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-Internet-of-Things-1-Understanding-IoT-Event-Processing-Pipeline-and-Event-Hub

 

Video #2: Azure Event Hubs using Azure SDK and NodeJS

Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-Internet-of-Things-2-Azure-Event-Hubs-using-SDK-and-NodeJS

 

Video #3: Azure IoT Suite – Device Provisioning, Producer, Consumer and Registry

Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-Internet-of-Things-3-Azure-Iot-Suite-Device-Provisioning-Producer-Consumer-and-Reg

 

Packaging your Libraries with NuGet (Channel 9)

December 4, 2015 NuGet, Videos, Visual Studio ,

I recently did a recording that illustrates the need of NuGet and how to package your libraries with NuGet.

The recording is available on Channel9

Direct Link: https://channel9.msdn.com/Events/APAC-Influencer-Hero-2015/Singapore-Influencer-Showcase/01-Punit-Ganshani-Packaging-your-libraries-with-NuGet

 

Collab365 Session: Azure IoT – Telemetry and Reliable messaging

September 22, 2015 Azure, IoT, Sessions, Videos , ,

If you are keen to learn Azure, Office365 and SharePoint then Collab365 is the Global Online Conference you MUST attend. It has online sessions running 2 full days for CxOs, Architects, Developers, IT PRO, Developers, Project Managers, DBAs, Business Analysts, DBA, UI Designers, Social Managers, Project Managers and even Sales!

So surely there is something for everyone!

Over 120 Speakers from 6 continents. 62 MVP’s. 6 MCM’s. Microsoft Product Managers and experts. The level of submission to the event was staggering.

Registration is free is so don’t miss this opportunity!

 

My session on “Internet of Things – Telemetry and Reliable Messaging” is scheduled on 8th Oct 2015 1:00 AM UTC.

​This session on Internet of Things will focus on understanding how small devices, regardless of their operating system, can be provisioned in Azure to stream sensor collected data for the purpose of analytics and business optimizations. Aspects of communication like device to cloud telemetry (D2C) and cloud to device (C2D) feedbacks using AMQP protocol will be demonstrated for durable and reliable messaging.

  • Understand Azure IoT Suite offerings
  • How to reliably stream sensor data to Azure Event Hubs
  • How to reliably receive commands and notifications from applications or backend
  • Understand secured channel communication

The session will be Level 300 session and will be aimed at CxOs and Architects

Don’t forget to register yourself at: http://www.collab365.events/
Agenda can be viewed at: https://collab365.conferencehosts.com/sitepages/agenda.aspx

See you soon!

Collab365agenda

Scheduling Background Tasks in ASP.NET using Quartz.NET

August 27, 2015 ASP.NET, ASP.NET vNext, Visual Studio , ,

 

Ever wondered how we can have critical tasks (not just sending out newsletters, tweeting, etc.) scheduled as background tasks our an ASP.NET website? This post outlines a quick way to use an open-source tooling to schedule background tasks in not more than 3 steps.

For scheduling background tasks, I recommend using one of the two open-source libraries – Quartz or Hangfire.

If we don’t need any monitoring, are a fan of zero/minimal configuration, don’t have any database or cache, etc. we can choose Quartz otherwise we can use Hangfire. In this post, we will use Quartz as a scheduling framework. To start with, we need to add reference of the NuGet package ‘Quartz’ to our Web Application by typing following command in Package Manager Console (or we can also use the UI in Visual Studio)

Install-Package Quartz

Now, there are 3 steps to adding a background tasks

 

Defining a Job

The beauty about Quartz is that it allows us to define the job in a separate class which ensures right abstraction and encapsulation. So let’s define a MaintenanceJob that inherits the interface IJob which has one member Execute. The method defines the action to be performed when the scheduled job is triggered

using Quartz;
namespace Tasks
{
    public class MaintenanceJob : IJob
    {
       public void Execute(IJobExecutionContext context)
       {
            var ftpLocation = context.JobDetail.JobDataMap.Get("ftp.location");
            // zip old log files
            // delete the files once zip is completed
            // sftp the zip to another location
        }
    }
}

Here, the IJobExecutionContext provides us the context of the job like – JobRunTime, PreviousFireTimeUtc, NextFireTimeUtc, Trigger, JobDetail, etc. JobDetail can be set from Trigger or Scheduler as additional data passed to the scheduled jobs.

Defining a Job Trigger

 

Trigger defines when a Job should be executed. There are different types of triggers – Time based, CRON, Calendar, Schedule, etc.

We want to run this MaintenanceJob once daily (at interval of 24 hours) at midnight. So our trigger definition will look like,

        public static ITrigger TimeTrigger()
        {
            return TriggerBuilder.Create()
               .WithDailyTimeIntervalSchedule
                 (s =>
                    s.WithIntervalInHours(24)
                   .OnEveryDay()
                   .StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(0, 0))
                 )
               .Build();
        }

 

When we use Time Interval Schedule, we have many options to schedule this job on weekdays OnMondayThroughFriday or on weekends OnSaturdayAndSunday, every minute/second, etc. If we were to define the trigger using CRON expressions, our trigger will look like,

        public static ITrigger CRONTrigger()
        {
            return TriggerBuilder.Create()
               .WithCronSchedule("0 57 23 ? * *", s=> s.WithMisfireHandlingInstructionDoNothing())
               .Build();
        }

When we use CRON based trigger, we can use CRON expressions to define interval and can also actions to handle failures, etc.  The above expression will run the job every day at 23:57 (server time)

 

Defining a Job Schedule

A scheduler acts as an entry point and definition for all Quartz jobs. So we need to derive a correlation between the job we created and the trigger we defined. This scheduler should be called in the Application Start of our ASP.NET website (Webforms or MVC). Now we can either write the below code directly in Application_Start method in Global.asax or we can structure it in a new class called JobScheduler

    public class JobScheduler
    {
        public static void Start()
        {
            IScheduler scheduler = StdSchedulerFactory.GetDefaultScheduler();
            scheduler.Start();

            IJobDetail job = JobBuilder.Create<MaintenanceJob>().Build();
            job.JobDataMap.Add("ftp.location", "ftp://SomeFileLocation");
            scheduler.ScheduleJob(job, Triggers.TimeTrigger());
        }
    }

In the above code, we are using a scheduler, defining (not creating an object) MaintenanceJob using JobBuilder and associating MaintenanceJob with the TimeTrigger trigger. Next, we need to have this JobScheduler.Start method called when the application starts (i.e. at every IIS reset)

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            JobScheduler.Start();
        }

 

If we need to run tasks on a schedule as part of our ASP.NET application with reliable accuracy and without multiple Batch Scripts or PowerShell scripts running as Scheduled Tasks, choose Quartz. The code is also available as Gist on GitHub

Concerned about your privacy in Windows 10?

August 17, 2015 Windows ,

Concerned about your privacy in Windows 10?

Many articles have been written that Windows 10 sends information to Microsoft servers in background. While I do not have information on what kind of information Windows 10 really sends to Microsoft servers there are enough controls in the settings to tighten the privacy settings if you are concerned about data being sent to Microsoft. However, unlike many other software, you can change these privacy settings. Here are few settings you can play with to control privacy, diagnostic information and location

Change Privacy Options

 

To view them, you just need to search for Privacy Settings in the “Search the web and Windows” box near the Start button. You can turn off all the options if you would like to.

Control Diagnostic data

 

In the same Privacy settings, you can select Feedback & diagnostics settings and define the frequency at which Windows should ask you for feedback and the device data (full, basic or enhanced) to Microsoft.

 

Change Location Settings

 

Location settings allow Windows 10 applications to retrieve your location. There are 2 levels of settings – one for location settings for all users using the laptop, second for the logged in user. I have kept Location settings ON as I use location based features like Weather, Cortana, etc.

Wi-Fi Sense

 

Wi-Fi sense is the new feature that allows sharing your Wi-Fi password with your contacts on networks you choose (like Skype, Facebook or Outlook.com). You can search for Network and Internet settings, click on Wi-Fi and navigate to “Manage Wi-Fi settings”

You can turn off the setting “Connect to networks shared by my contacts” which will also stop sharing your Wi-Fi password to your contacts (using Windows 10) when they are in the range. I do not think they will come to know your password, it’s just that Windows 10 will automatically connect them to your Wi-Fi network when they are in range (i.e. your home).

Note: If you think there are other settings that could help privacy settings, do comment in this post. I’ll include them as revisions to this post.

Follow on Feedly