Using .NET Core SDK 2.1.0-rc1 with TFS Build

So .NET Core 2.1 RC is out. With its Go Live Support I am fairly confident that I could upgrade my super secret project.

Upgrading my projects was easy.

I download and installed the 2.1.300-RC1 from https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-rc1  and for VS2017 it should also show on your notifications window by the way.

5

Once my tools are upgraded I then did some minor changes on all of my CSPROJ.

Make sure that the target framework is 2.1 and the Package Reference version is 2.1.0-rc1-final. Rebuild and viola, .NET Core 2.1.  Here’s an example of one of my API’s.

image

I would not cover the other new and shiny things about .NET Core 2.1-RC like the one from Preview1 and Preview2 but certainly you can look it up here: https://blogs.msdn.microsoft.com/webdev/2018/04/12/asp-net-core-2-1-0-preview2-now-available/

Publishing to Azure

So now for the harder part. I saw from a blog post that Azure App Service will start deploying 2.1 RC next week.

NEXT WEEK DAW

https://blogs.msdn.microsoft.com/webdev/2018/05/07/asp-net-core-2-1-0-rc1-now-available/

But the the impatient me, went ahead used the .NET Core Tool Installer.

image

I used the name from the release notes https://github.com/dotnet/core/blob/master/release-notes/releases.csv

Broke my build saying that the .NET Core Package name is wrong.

But I saw this GitHub Issue thread that says use “To use 2.1.0-RC -> to download SDK, use “2.1.300-rc1-008673”. And to download runtime, use “2.1.0-rc1”.

https://github.com/Microsoft/vsts-tasks/issues/7032

Viola! That works!

image

Now for the fun part.

Using UseHttpsRedirection and HTTPClient Extensions!

That’s all for now!

Advertisements

Robocopy /MT on Windows 10 (Revisited)

I blogged about the /MT switch of Robocopy way before on Windows 7 and I have been using it for the longest time for moving large amounts of files.

https://johndelizo.wordpress.com/2009/03/04/windows-7-multithread-file-copy-using-robocopy-utility/

This time I had a chance to screenshot some personal files that I have moved to another drive. Since its not for work, might as well share this to everyone.

Note that these are not Solid State Drives and are just plain HDD and are used for storage only.

So I started with this command that moves everything even if the folder is empty on a specified destination and logs the operation on a .log file”

“robocopy <source> <destination> /mt:120 /E /move /log:robocopy.log”

ROBOCOPY1

Around 20GB-ish worth of files are being moved now.

ROBOCOPY2

And checking the disk activities while the copy is running.

ROBOCOPY3

And for the results!

image

Tadaaa!

RemoteFX 3D Video Adapter

Hey this would be a quick post or even a micro post about a new feature in Hyper-V called RemoteFX 3D Video Adapter that was just shipped out with Windows 10 and WS2016.

So I was doing a lab work for a Windows 2016 deployment and found new features such as the Remote FX.

HYPERV4

It seems that I can already share my desktop GPU to my Hyper-V guest! Cool! I have already alot of use cases in my mind, like running my supervised learning ai on my Hyper-V. I just need to install Unity and VS on a VM, play around there so that my PC and Mac is not always maxed out (will try to constrain it now to a 4gb memory so that I could work while waiting for the operations to complete).

Anyway, back to this lab. Yes folks, still using ol’reliable WDS.

WDS2

Azure Mobile App

Currently OOF with only an IPhone. So while waiting here, I was browsing apps and checked out of curiousity if there is a mobile app for Azure.

There is.

Downloaded this and signed in using my live account.

This will open a new web view pop-up.

After logging in you will be redirected to your home page. I can also filter my services.

Hamburger menu opens your profile and will display your directories with subscriptions.

And heres the details of my app. Happy to see its running without any errors 🙂

Heres a sample of the app insights for one of my web app.

This is so cool this app goes into my first screen.

So thats it for now! Coolness!

Moving to SSL / HTTPS

Recently I have walked the talk and have moved my personal site to HTTPS.

Although I have already moved, redirected and configured many many web front end to use SSL, I haven’t got around to implement this to my own websites. In comparison, my site is not a transactional site or doing any registration – I only use this as my portfolio site as well as a live test environment where I can experiment, learn, validate and do pretty much everything without any impact to anyone but me.

There are a lot of articles here, herehere, here, here and there regarding the pros and cons of having a site over HTTPS.  Basically from what I am reading now is it has an additional cost and additional load but it has to be done.

And thanks to modern tech, the move is fairly easy:

  1. Choose your CA. – Validation and Order
  2. Create CSR – Using a tool or MMC / Inetmgr
  3. Install PFX to your website. – Azure Website Basic Tier and Above.
  4. Auto redirection – using IIS URL Rewrite Rules (Azure) with a demo of TFS Online 🙂

So here’s my contribution to the secure modern web! Happy SSL!

image_thumb[5]_thumb

So this exercise got me thinking, we are really in the age of the cloud service already. From requesting certificates to installation, scaling my application and even a source code rebuild-test-deploy scenario and I haven’t touched not a single MMC or any server directly. The old concepts are there from web deploy about file being used or using a IIS manager to request for a CSR and fulfilling the certificate request but in a modern way. Difference is I used to do MSTSC but now, I am talking to the web browser. This could have taken days to do or even weeks not to mention there would be misconfiguration from my end but now, I am up and running “as I wish”.  Hmm. 🙂

Moving to SSL / HTTPS-PART 4

“We deprecated the hosted XAML build controller on July 1st 2017. We recommend that you migrate to our new build system. However if you still need to run XAML builds during the migration then you must set up a private XAML build controller now”.

Yes yes. I forgot to upgrade. Lets move on.

So in order to do publish, we just need to login to our visualstudio.com account and go to the project that we need to publish.

There is a tab called Build and Release, and there should be an Azure web app template.

A

Once applied, you need to first choose which Solution to build and deploy, kinda like WEBDEPLOY before.

B

Then we need to link our azure account and then choose which app service to deploy on.

C

The link happens when you authorize your visual studio by logging in to your azure account. Note that this is a pop-up.

D

Then click refresh if you dont see your app service on drop-down.

E

Then viola, you can now save or save and then already queue for deployment.

G

This should queue up and warm up an available agent again, like WEBDEPLOY before.

H

Once the Agent fires-up the deployment, you will notice that the scripting engine and console is going to be shown and you will see the progress of this.

I

Aha! You are still using WEBDEPLOY! Long live web deploy!

J

NOOOOOOO! Okay, new Relic is giving me a bump. Like the old WEBDEPLOY, file is in used so therefore you cant override and your deployment task will fail.

K

As I remember, its just as easy as:

<EnableMSDeployAppOffline>true</EnableMSDeployAppOffline>

Or we could just easily do a slot deployment and switch slots after . I just remembered that I am on B1 tier in Azure. There is no slot deployment for that! Great.

I remembered, this is my PERSONAL site, no one visits this or any use of this. Lets just stop the site.

So lets do this, lets insert two deployment task in the build definition. One to stop and one to start, effectively a sandwich before and after deployment. So add an Azure App Service Manager task.

L

The first one, stop the App Service. You know which subscription and app service to stop.

M

After the Azure Service Deployment task, we should start the service.

N

Lets try it out, save the build definition and queue build!

O

Aha! Stop worked!

Q

Publishing.. Yes!

R

Build says its okay and was deployed successfully.

image

This got me thinking, we are really in the cloud already and from requesting certificates to installation, scaling my application and even a source code rebuild-test-deploy that I haven’t touched not a single MMC or any server directly.

Moving to SSL / HTTPS-PART 3

Azure Websites Basic Pricing Tier (SSL Support)

So you now have an SSL Certificate? Lets install it to your Azure Website. I distinctly remember, in order for you to have a custom domain (without the .azurewebsite.net), you have to be in the D1 Shared instance in which I am right now.

So from D1 Shared, I upgraded to B1.

23

24

Once upgraded, you can now go the SSL settings. You can search it thru the web app settings and in there, click Upload Certificate.

25

Now remember the PFX file that we created on the earlier part? Use that and use the password that we added when we exported the PFX.

26

27

28

Still within SSL settings, we now have to bind the uploaded SSL with the domain that we want to secure. Click SSL Bindings.

29

Choose the SNI SSL after using the hostname and certificate name combination. Then click Add Binding.

30

So that’s it, in just 3 easy steps we already have a working SSL Certificate bound to our site.

31

Now to check, lets go to https://www.johndelizo.com/ using chrome and IE.

32

Valid certificate! Sweet!

33

But our old http only site is still active. So we may need to automatically redirect visitors from http to https. Rewrite should do this. Lets edit web.config!

So my TFS Online is linked to my Azure Websites. I already have a redirect before and should be a fairly easy web.config change, build deploy.

35

Oh no. I got a message: “We deprecated the hosted XAML build controller on July 1st 2017. We recommend that you migrate to our new build system. However if you still need to run XAML builds during the migration then you must set up a private XAML build controller now”.

36

I cant believe I never got around to update my own build! Okay, no time to waste, lets just create a new build definition. Stay tuned for part 4.