Category Archives: Web Development

ASP.NET Core 2.0 + VS2017

I presented ASP.NET Core 2.0 and Visual Studio 2017 at DC Metro Devs on Tue August 8, 2017. Here is the presentation material with the slides, links and my contact information.

asp-net-logo

Download PPTX or view slideshow below

SlideShare: https://www.slideshare.net/shahedC3000/aspnet-core-20-the-future-of-web-apps

The all-new ASP .NET Core 2.0 introduces some great new capabilities, the ability to host on multiple server platforms, and a number of new tools that you will want to get familiar with. Learn about the future of ASP.NET Core MVC, Web API, Razor Web Pages, .NET Core Tools and Visual Studio 2017!

 

Azure Functions – Dev Workflow

If you’re looking for new ways to put your code in the cloud, look no further than serverless code deployments with Azure Functions! If you need some tutorials and basic information to get started, check out the following links first, especially the Quick Login page.

Azure Functions

Special Thanks: I’d like to give credit to my awesome colleague Joe Raio, who walked me through these steps during a hackathon project.

Useful Links

The rest of this blog post will focus on how you can develop Azure Functions without being tied to a web browser. You’ll learn how to write the code on your own dev machine, which will enable you to easily commit/push your code into any source code repository.

Step 0: Install Node.js if you haven’t done so already

Download Node.js from the following URL. This includes npm.

Step 1: Install the Azure-CLI npm package

Get more information at the following URL:

In a brand new folder, run the following command from a command line:

> npm i -g azure-functions-cli 
This folder can reside anywhere in your project’s folder structure, to ensure that you can easily check in your code into source control.
UPDATE: There is a newer URL for the Azure Functions CLI, now called Core Tools:

The install command is now:

npm i -g azure-functions-core-tools

Step 2: Create a new Azure Function locally

In the same folder, run the following command to create a new Function App locally:
> func init
Now, run the following command to create a new Function within your Function App.
> func new
Next:
  • Select a language, e.g. C#
  • Select a template, e.g. HttpTriggerWithParameters
  • Enter a name for your new Function, e.g. “MyFunction”, which will create a subfolder using the Function’s name.

Step 3: Observe the folder structure and its files.

Open the folder in your code editor, e.g. Visual Studio Code and take a look at the folder structure. For my C# function, here’s what I can expect in my function’s subfolder:
  • readme.md is a typical “Readme” file, in markdown format, useful for Github repos.
  • run.csx is contains the code for your Azure Function
  • function.json defines the function bindings and other configuration settings

In the Function App’s main folder, the appsettings.js file will be shared by all the functions in this Function App. You can update this settings file by pulling down the actual settings file from your a Function App in your Azure account.

Step 4: Log in to Azure from the command line

Type the following command at the command line:

> func azure login

Follow the onscreen prompts and instructions to log in to your Azure account. If you have two-factor authentication enabled, make sure you have your verification method ready for a quick login process.

Step 5: Get a list of Function Apps in your Azure account

Type the following command at the command line:

> func azure functionapp list

Step 6: Import your App Settings from the cloud

Type the following command at the command line:

> func azure functionapp fetch-app-settings <fn-app-name>

Make sure that you replace the placeholder <fn-app-name> with your own function app’s name. If you have the settings file open locally (e.g. in VS Code), you’ll notice that local file gets updated automatically!

Step 7: Run your function locally (optional)

If you want to run your function locally, type the following command at the command line:

> func host start

This should start the function locally and display the local URL with port number. Use this URL and port number to run it in a web browser and provide parameters via the QueryString. Note that QueryString parameters start with a “?” but subsequent parameters are separated by “&” ampersand characters.

Step 8: Publish back to Azure

Each time you want to publish your Function to Azure, type the following command at the command line:

> func azure functionapp publish <fn-app-name>

Once again, make sure that you replace the placeholder <fn-app-name> with your own function app’s name.

Step 9: Enable CORS for your Function App

If your Function App is hosted in Azure, you will need to enable CORS to ensure that it can be called from JavaScript code with a different origin. For step by step instructions, follow the guide at:

Conclusion

Now you’re ready to use your function from anywhere: directly in a web browser, from a mobile app, web app and more!

Celebrating 3 Years at Microsoft!

It’s been three years since I joined Microsoft… how did I get here? Before you begin, check out my new Facebook page for developers: Shahed Codes! And then connect with me on LinkedIn!

mslogo Wake Up And Code!

With a background in ASP .NET web application development for enterprise customers, I recently published my first book, “ASP .NET Core Essentials”, via Packt Publishing. You can check it out at the following URL: https://www.packtpub.com/web-development/aspnet-core-essentials

But first, a little history…

Back in 2011, I published a couple of silly little indie games for Xbox 360, using XNA and C# in Visual Studio. While working at my day job, I had gotten a little bored with business applications and decided to teach myself game programming. I made a little profit with my games, including Angry Zombie Ninja Cats.

Ninja Cat Sprite Sheet

Ninja Cat Sprite Sheet

With mixed reviews, the ratings bounced back and forth between 3 stars and 4 stars, and finally settled on approximately 3.5 stars. The game even got a brutally honest review from Indie Gamer Chick, who later invited me to write a couple of dev articles for her website:

The latter article even got republished on Gamasutra:

By 2012, I branched out into make free dev tools for XBLIG indie devs, such as the XNA Sales Data Analyzer and XBLIG Basic Starter Kit. The Sales Data Analyzer tool was received well by the indie media (including my now-colleague Dave Voyles), and was used by XNA developers across the US and around the world! :)

statsUS analyticsMap

The first time I ever spoke at a public event was at NoVA Code Camp in 2013, while I was working at Excella Consulting. I joined my colleagues Sahil Talwar and Doguhan Uluca in delivering a 3-part presentation on a complete end-to-end lean web application architecture. Specifically, I talked about Entity Framework Code First Migrations.

Source: https://twitter.com/shahedC/status/326068261336788992

Combining my background in enterprise business applications and indie game development, I decided to start speaking on various topics ranging from ASP .NET to Xbox game development. By 2014, I achieved a triple-achievement with the following:

  1. mentioned in Official Xbox Magazine
  2. selected to received MVP Award
  3. received job offer from Microsoft
Source: Official Xbox Magazine, March 2014, Page 65

Source: Official Xbox Magazine, March 2014, Page 65

The MVP Award for Microsoft is only for members of the community who are not employees of Microsoft, so I gave up the award when I accepted a job offer from Microsoft in March 2014. Since then, I’ve had the chance to work with all sorts of development tools, technology and platforms, including:

All of the above allowed me to start working on customer projects ranging from Xamarin and Azure to ASP .NET Core and IoT. Upcoming projects will include Bot Framework, Cognitive Services and HoloLens! I also got a chance to build an internal Kinect v2 application called Speech Bubbles, which tracks passers-by and displays cartoon bubbles above their heads to follow them around as they continue walking.

I had the opportunity to record 3 courses for Microsoft Virtual Academy with my then-colleague James Quick. The primary topic was Game Development with Construct 2, including the use of Xbox One controllers and the publishing process of getting your game into the Windows Store and the Xbox Store.

mva

Over the years, I’ve had the chance to speak at various community events around the DC/MD/VA region, along the East Coast and even across the US. When Unity Technologies came to town, I hosted their official Unity Roadshow events with Carl Callewaert, Unity’s Global Director of Evangelism. I even took some time off to fly to Barcelona (Spain!) to teach a game dev workshop to a team of King employees. In case you haven’t heard of King, they’re the developers of a popular mobile game called Candy Crush.

carl-unity king

In addition to community events, I’ve delivered talks and mentored students at various hackathons, including: American University, Georgetown University, Gallaudet University, Howard University, University of Maryland @ College Park, University of Maryland @ Baltimore County, James Madison University, Johns Hopkins University, George Mason University, University of Pennsylvania, University of Virginia (UVA), Virginia Polytechnic Institute and State University (Virginia Tech) and Massachusetts Institute of Technology (MIT).

universities

One of these hackathons was HackMIT, where I had the opportunity to join my colleague Gavin Bauman in training a group of HackMIT attendees at the beginning of the hackathon. We also mentored the students throughout the event.

Fast-forward to 2017, I’ve been facilitating the NoVA Code Camp event at the Microsoft office in Reston VA (now twice a year). This community-led event owes its existence to volunteers from the community, including current organizers Ed Snider and Stan Reeser. Past organizers include Tasha Scott and Greg Hurlman.

The following Twitter Moment consolidates the tweets that mention our sponsors and speakers at NoVA Code Camp 2017.1 for Spring 2017:

FB-FindUsOnFacebook-printpackaging-2

I’ve continued to administer and moderate multiple developer groups on Facebook (and a real-life Meetup group):

Hope you found some inspiration in my journey. If you’ve made it this far… check out my previous anniversary blog post from 2016!

 

 

Azure @ Angelbeat 2017

Here is the material for “Capture the Cloud with Azure”, an Azure 101 presentation delivered at Angelbeat on March 29, 2017.

Slideshare: https://www.slideshare.net/shahedC3000/capture-the-cloud-with-azure-74089744

Download PPTX: http://wakeupandcode.com/public_downloads/Azure-Angelbeat-2017.pptx

Azure portal links:

Azure App Service (Web, Mobile, Logic, API):

Data, Storage, Analytics

Media Services, Internet of Things

Infrastructure:

 

ASP.NET Core + VS2017 @ Caparea

I presented ASP.NET Core (Overview) and Visual Studio 2017 at Caparea on Tue March 28, 2017. Here is the presentation material with the slides, links and my contact information.

asp-net-logo

Download PPTX or view slideshow below

SlideShare: https://www.slideshare.net/shahedC3000/aspnet-core-in-2017-the-future-of-web-apps

Initially named ASP .NET 5, the new ASP .NET Core introduces some great new capabilities, the ability to host on multiple server platforms, and a number of new tools that you will want to get familiar with. Learn about the future of ASP.NET Core MVC, Web API, Web Page, .NET Core Tools and Visual Studio 2017!