Deploy .NETCoreApp to Azure Service Fabric

Should be obvious how to do this.

Either it is not obvious or I am really slow (yep, left myself open).  So you can’t wait to use the .NET Core 1.0.x platform and you are a glutton for punishment like me.  You want to get your brand new .NETCoreApps up on Azure Service Fabric.  Well it is not exactly clear how to do this and the Visual Studio templates don’t help here.

Note: Visual Studio 2015 Update 3 with latest tooling as of this post date do have an ASP.NET Core template for Azure Service Fabric.  But ASP.NET Core is not a .NETCoreApp.

Why do you want to do this? In my case, my company has been steadily porting our aging .NET Framework libraries to the new .NET Core.  I do not want to go back to the old .NET Frameworks.  Microsoft just informed we developers about the new .NET Standard 2.0 here.  If you were around back in the late 1990’s and very early 2000’s you likely struggled with the transition from ASP Classic to .NET 1.0/1.1.  If that wasn’t enough .NET 2.0 quickly followed.  There was no direct port from the 1.1 to 2.0 back then.  It seems that we should have learned by now that 1.x anything is just a trial run.  So we all have deja vu with .NET Standard 2.0.  Yeah this time its going to be better…  My fingers are crossed.

The Nitty Gritty

So I promised to tell you how to deploy your .NETCoreApp to Azure Service Fabric.  The first thing to know is this is a “guest executable” in service fabric. Read this article for background here “Deploy a Guest Executable to Service Fabric”.  I expect that you have a working .NETCoreApp that you want to run in Azure Service Fabric ready and tested locally.  The best way to do the deployment is to use Visual Studio as the article describes.  But you must do a little prep-work first for the .NETCoreApp to make it work.

It is utterly simple. In Visual Studio with your desired .NETCoreApp, right-click the project.  From the context menu click “Publish…” and use “File System” as the target location.  Make a note where you put your output.  The default is bin/release.  This causes Visual Studio to gather all the files necessary to run your application into a single folder.  The current Visual Studio tooling does not do this for .NETCoreApp when publishing to the fabric.

Now that you have a complete package you are ready to create your Azure Service Fabric guest executable.  From Visual Studio create a new Service Fabric project and select the guest executable template.  A configuration dialog appears. In the required Code Package input field browse to the folder discussed above and select it.  If you are still developing your .NETCoreApp select the “link” to your code and also choose “CodeBase” for your work folder. From here you publish your .NETCoreApp to your Azure Service Fabric (cloud or local).

Parting Shots:

If you are still developing your .NETCoreApp you will have to repeat the publish cycle every time you want to test in the fabric.

The clue to the problem was found in the Microsoft documentation article mentioned above.  The tip off was this statement:

Service Fabric does an xcopy of the content of the application root directory…

That simple statement and the word “xcopy”.  The ah-ha! moment.  All the reference libraries are not present in the bin folder!  Visual Studio keeps all the standard libraries in a common location on the local computer.

I hope this saves you a bunch of time.

Advertisements

New Microsoft .NET Core Changes Many Application Responsibilities

My company is devoted to the Microsoft .NET platform and the Azure cloud services.  Cloud services are not simple even though the hype seems to indicate such.  Cloud applications are different (or should be) to take advantage of cloud services.  Writing cloud applications is not an extension of yesterday’s coding methods.  Supporting and release management of cloud applications is also different from prior systems.

Intact Partners produces software application platform services and development automation software called PowerLine with Compose. The major advantage of PowerLine platform is performance and cost enhancements at development and with on-going application maintenance.  PowerLine can reduce development coding effort by as much as 80% through its robotics.  Below I hope to show you why PowerLine with Compose is a sound decision.

It seems to me many people like the “New Microsoft” and its new open source .NET model for application development.  The old .NET Framework is now 15 years old and still tied directly to Windows OS’s.  The new .NET Core is a ground up rewrite that separates .NET from Windows making a cross platform development environment for other competing OS’s such as iOS and Linux and other languages such as Node, PHP, Java and more.  That is generally great news to the non-Microsoft community.  I happen to agree even though I am a .NET/C# developer.

IMPACT

So things have changed and .NET Core is now the shining light as the centerpiece of the .NET development effort at Microsoft.  If you are a developer or a business person with applications written with the .NET Framework you should take heed.  Your job is changing.

Lets quickly review Microsoft official position, CEO Satya Nadella continues to declare “Mobile First, Cloud First World”.  This simply means that Microsoft is committed to Azure and Windows 10 with its money.  Azure is Microsoft’s “open cloud platform” meaning Azure will run other operating systems non-Windows.  Microsoft wants apps to run on Azure supporting Windows 10 regardless of the OS.  Solution: create a single code base supporting Microsoft’s goals.  This code base is .NET Core.

Even though the company promised over a year ago support for .NET Framework 4.6.2 in Azure it still is not available.  Now, the older Azure services supporting .NET Framework are listed as “classic”.  One likely should conclude, Microsoft is not “innovating” with .NET Framework anymore (no investment in new features).

Read this 12/2014 quote from Microsoft , “The .NET Framework is still the platform of choice for building rich desktop and .NET Core does not change that” [emphasis added].  This same statement was repeated in 7/2015.  A discerning developer should quickly see that mobile, server, web, and cloud were not mentioned in the statement.  If you are a Windows desktop developer only then you are OK with .NET Framework.  The rest of us should be developing .NET Core.

AREAS of CONCERN

I will not cover .NET Core in detail, ample coverage is being done by Microsoft on MSDN and the community at large.  What I want to impress upon you is the shift in responsibilities occurring with .NET Core implementations.  There are many structural changes in .NET Core.  Development is similar but it is different significantly enough that old development habits will have to be broken.  Update and release patterns are significantly altered.  The alterations are subtle if you are not tuned-in to Microsoft’s release pattern changes.

Microsoft release pattern changes. All operating system updates are now only released as cumulative updates.  Immediately this affects all applications impacted by system patches which also includes security and compliance patches.  In the past where applications were dedicated to Windows servers the patches were generally applied by the server administrators. Microsoft fixed a real issue with this method where .NET Framework updates broke existing applications in 2010.  The .NET Framework 4.0 release allowed side-by-side installs of the framework on the same machine.  The problem is not the .NET Framework.  The issues going forward for applications is .NET Core does not depend at all on Windows Server and any of the installed frameworks.  In fact .NET Core does not depend on Windows OS of any kind and .NET Core does not need .NET Framework installed on the server as in the past.

What this means.  The responsibility to update/patch your application shifted from the server administrator to the developers or vendors.

With no framework how does this update stuff work?  Simply put you need PowerLine with Compose.  PowerLine is a managed set of cloud services that are maintained as part of the system services powering your application.  Compose is a development and maintenance tool.  Running your application in Compose regularly automatically imports updates and security patches from Microsoft and tests those as part of its operation.

The tide is out, the ballgame is over, cat is out of the bag – however you like to describe things you really can’t control; the fact is every application including most desktop ones are now legacy.  It is not a matter of if you adopt, it is when will you.  A person in my office asked me, “What are they [application owners] going to do?  There are too many applications at risk now.”  I hope you get started with PowerLine with Compose quickly.

Cloud Business and Florida Hurricane Hermine

Eleven (11) years since the last hurricane hits Florida!  My company, Intact Partners, is an “all-in” cloud business.  Office 365 Enterprise, Microsoft Azure, and Visual Studio Online (TFS) its business as usual, almost.  The “almost” is just related to the fact that employees are working from their homes using Skype for Business.  All of our work, applications, and files are safely stored away on the cloud.  We haven’t missed a beat!

So last night hurricane Hermine rolled into Tallahassee, Florida.  We lost power at our house at 1:32 AM. No electrical power, no cable, and no Internet. (No Internet is caused by the wide area power outage taking down backbone services.)  No worries here.  The backup generator is powering the house, Windows Phone is providing Internet service and my Surface Pro 3 is providing all my normal services.  Business as usual for Intact Partners.

When you think you business continuity is better in your local datacenter, my experience says you are wrong!  This in not the first time I have experienced Microsoft Azure coming through in a hurricane.  When I was CIO at Florida Department of State during the 2012 presidential election I had moved the election system to Azure.  Hurricane Sandy rolled over Virginia where one of the Azure datacenters is located.  It happened on the first day of early voting in Florida that year.  To prove the disaster recovery ability of the system we constructed on Azure I “failed-over” our service from the San Antonio Azure center to the Virginia center just after Sandy.  Florida’s election 2012 was run on our Azure disaster site and was a total success.

This morning as I compose this blog, I am at home with my family as are my employees are with theirs, not worried about business interruptions for my company and more importantly I am not fretting about my customers.  Their services are safely and securely operating in Azure.  The people I am praying for this morning are the more than 100 thousand people without power and the crews working hard to restore power and save lives.  I will continue to pray for those who are still in the path of Hermine as it rolls on north up the east coast today.

Larry Aultman, CEO
Intact Partners

Been a Long Absence

Building my company has consumed so much time I have neglected my blog.  I am sure that it will take some time to get back into the habit so please follow me.

It has been nearly four years since I last blogged and a lot has happened in my life personally and professionally.  The personal side is best left to Facebook.  My professional profile is maintained on LinkedIn and my company can be found here.

I have not totally be silent while not blogging.  On the company site under the Solutions menu you can find my whitepapers.

I plan to talk about business topics related to Microsoft Azure and the new .NET Core development platform.

So please come back often for my thoughts and opinions about cloud computing.

Thanks,

Larry