So in my last post i pointed readers to resources for setting up a vpn connection to access your Azure Stack environment without having to RDP into a server while I am on my home network. It also allows me to access via Visual Studio as well as have multiple users connect if I choose. So that has been working great, but I need to access Azure Stack while I am on the road, which is often. So I decided to try and setup a VPN connection to my Home and then use the Azure Stack VPN to access the portal from my local PC while traveling. Now i am not a networking guru by any means but I did figure it out.
At first I setup a VPN server using the built in Windows 2016 Remote Access functionality. I must of spent an hour trying to get the connection to work to no avail. I was about to abandon the idea for now until I ran across a VPN sever called softEther. I am sure there are many choices out there, but this is what i ran with. There is a client and a server piece. I installed the server bits on the 2016 server using the default settings. No real configuration. Next I installed the client in my local machine. I was trying to get it to connect but i still was not successful even though they are meant to work together fairly easily. Not sure why yet but I am looking into it.
Not wanting to give up i decided to try and setup the VPN using the Windows 10 client. As soon as i configured it I connected with no issue. I used the following settings.
Now i am using a Pre-shared key which is not as secure as a certificate. So I am going to work on that next. Just wanted to test the theory out.
Now that I am connected i figured i would try the Azure Stack VPN connection to get into the environment. That work straight away and now I can connect to my Azure Stack from my remote machine while on the road.
Now i am new to all this so this may not be the best or easiest way to do this. I feel there is something far more simple than what I have setup, but until I find that I am using what I have. If anyone knows an easier way, please reach out to me on twitter (@pjhacker) so I can implement it. If there is no easier way then here you go. Hope someone can use this info.
Now that I have deployed azure stack I want to access it from my PC rather than remoting into the Azure Stack server.
You can follow these instructions for connecting to Azure Stack via a VPN:
This is nice because i can now access through my local browser.
EDIT: Here is how I set it up. I have had a couple questions about the setup so I will post what I ran.
Import-Module D:\AzureStack.Connect.psm1 – Download from the link above and save to a local directory path
$Password = ConvertTo-SecureString “<AzureStack Admin Password>” -AsPlainText -Force
# Add Azure Stack One Node host to the trusted hosts on your client computer
Set-Item wsman:\localhost\Client\TrustedHosts -Value “ip address of host” -Concatenate
$natIp = Get-AzureStackNatServerAddress -HostComputer “ip address of host” -Password $Password
# Create VPN connection entry for the current user
Add-AzureStackVpnConnection -ServerAddress $natIp -Password $Password
# Connect to the Azure Stack instance. This command can be used multiple times.
Connect-AzureStackVpn -Password $Password
#winrm quickconfig -transport:https
In my last post i talked about getting started with the deployment of Azure Stack POC TP2. In this final post on the experience there is not much left to say. I had hit a roadblock and was not able to get past step 22. I asked in forums and scoured the net but nothing. I was going to just give up for a while when i found a post that was talking about the time changing on the server could be an issue. I looked back through the steps in my deploy and saw that the step did change the time and therefore may be the issue. So now that i have a direction (right or wrong) and i was running with it. The first thing i did was to just rerun the deployment since i figured the time change completed and it would not effect it this time, again right or wrong it was a direction. Low and behold it flew past step 22 and by late last night i had a full deploy of Azure Stack on my server. I was pretty impressed with the install. Sure i ran into a couple issues, some from not reading carefully enough and some i cannot explain why, but its done. I will say that the forums were not a big help right now. I am sure that will change as it gets used more, but the answers to my questions all came from searching the internet and trial and error. I will of course work in the forums to see if I can help anyone as i go through using it.
I decided that i was going to deploy the Technology Preview 2 of Azure Stack (Azure on my hardware). I have a pretty hefty server with the following:
- 2) 6core CPUs
- 192 GB Ram
- 12TB storage – 4drives x 3TB each
- 1) 500GB OS drive
To start, I need to go into the Azure portal and create a new user in a directory that has administrator rights. I struggled a bit with this because i was using my Azure account that i access with my Microsoft account. This is not allowed from what I can see. It must be a non-Microsoft domain account (you can use your company domain). For me that meant that I had to buy a new domain name, which i did and found that I could get myazurestack.com, so i bought that. Now that I have a domain I logged into Azure using my MS account, created a new user with the @myazurestack domain. I then created a new AD directory (in old portal) and added the new user to that directory.
Next I downloaded Azure Stack POC TP2. Once I have that I extract the files. You need to run the Azure Precheck ps1 file to ensure that your machine meets the minimum requirements. You get that here. I also ran the vhdx extract. Its the .exe file in the downloaded files
So now that i have a valid server, and an Azure domain account I ran the BootToVHD.ps1 powershell script so that I can reboot into the CloudBuilder.vhdx virtual machine. The reboot took a bit since it rebooted twice. Then asked for some info and to set an administrator password.
Once i logged in i ran the InstallAzureStackPOC.ps1 file like so:
Now here is where I made mistakes. I first off formatted and initialized the 4 disks that I will be using. Bad move, they need to be left Unallocated (no volume). So when it got to step 18 it failed to find any disks. After digging around for a quite a while i read that in order to create a storage pool in windows, I need to have unallocted disks. Since this is what step 18 is trying to do I decided to give it a try. That worked and I got past step 18. I figured we were on our way to deploying. Not so fast, I ran into another error on step 19. Bottom line was that I need to log into the server with the AzureStack\azurestackadmin user. I went back and looked and I apparently missed the part where it stated that was what I needed to do. So make sure you login to the server with that user. So i am currently on my way to deploy, but it failed on step 22 (Task: Invocation of interface ‘Configure’ of role ‘Cloud\Fabric\BGP’ failed: ) and I had to ask in the Azure Stack forums whats going on. I looked around and found no info on that step or error, which i figured would be the case since its so new. I will report back as soon as I get going again.
This month i have really put my self out there. I have quite a few code camps to speak at. I have listed them here since i get asked about it. Now I’ll just point folks here.
October 2 – Silicon Valley Code Camp
October 5 – DogFood Conference
October 8 – Desert Code Camp
October 14 – DevSpace
October 20 Little Rock Tech Fest
October 26 Prairie.Code()
October 28 Raleigh Code Camp
Hope to see some of you at these events as they are all bound to be good conferences. The folks putting these on do a fantastic job and should be commended for all they do.
I recently created an MVC 5 app in VS 2015 and tried to build it with VSTS. It failed every time even though it built fine i VS 2015. It appears the issue is the NuGet packages that are stored in VSTS. I deleted the packages directory and rebuilt the solution with VSTS and everything worked fine. I am not sure why it fails this time compared to all other times i have created a solution with a packages directory in VSTS, but i will need to dig in and find the answer.
Here is the actual error I get.
The “Microsoft.CodeAnalysis.BuildTasks.Csc” task could not be
loaded from the assembly …\packages\Microsoft.Net.Compilers.1.0.0\build..\tools\Microsoft.Build.Tasks.CodeAnalysis.dll. Could not load file or assembly ‘file:///…\packages\Microsoft.Net.Compilers.1.0.0\tools\Microsoft.Build.Tasks.CodeAnalysis.dll’ or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
So i demo the new VSTS build features and one question i get a lot is “What’s the difference between MSBuild and the Visual Studio Build steps?” so I am going to list out some reasons for using one or the other.
Lets say you dont want to build an .sln file to build but rather the .proj files. Then this is the option could use. It also does not require Visual Studio to be deployed on the build server.
If you want to build multiple projects, specify search criteria. You can use a single-folder wildcard (
*) and recursive wildcards (
**). For example,
**\*.*proj searches for all MSBuild project (.*proj) files in all subdirectories.
Make the sure the projects you specify are downloaded by this build definition. On the Repository tab:
- If you use TFVC, make sure that the project is a child of one of the mappings on the Repository tab.
- If you use Git, make sure that the project or project is in your Git repo, in a branch that you’re building.
If you are building a solution, in most cases you should use the Visual Studio Build step. This step automatically:
Information about how to implement the steps are here in the MSDN library.
So i just stumbled across this feature in Azure. Its the ability to export templates of resource groups. This is wicked cool. I could have used this months ago. What i like (there is a lot to like) is that I can use it as a great teaching tool. If i am looking to automate my deployments and I get stuck on a particular item, i can easily create it in the UI then export the template to see how i would code it up. Its really easy to do. Just go into the Azure portal and select a Resource Group you want to export.In the settings you will find the “Export Template” option.
Click on it and it will produce the the template with some options to download, save, or even redeploy it. This is what i need so I am going to download it locally and start to work on it.. You also have the option of clicking through the resources, parameters, and variables. Not only does it show you the resources, but you also have the option to view the Powershell or CLI code.I also like the fact that it gives me the parameters file i can use and build off of.
I have been waiting for this functionality for a while now and its nice that the team has released it finally. I will definitely using this feature in the future.
I have been doing a series of webcasts on YouTube around TFS/VSTS Build. i was approached by the folks at CatLight to demo that in the videos i do. I decided to look at the tool and write aa post first.Its a free download and easy setup to get it running. It sits in the tray and turns colors based on a build. Red means there is a failed build on one of your projects, amber is a partial completion. Just the cat outline mean your good. Click on the cat icon in the tray opens the Dashboard where you can configure what projects you want to monitor as well as the current status of the builds for each project. Click on the build name in the Dashboard and i takes you to that build summary. I can see the usefulness in the tool, as a visual way to stay on top of builds. Of course there are other ways to do it also. If this sounds interesting go to http://catlight.io and check it out.
I do a lot of demos and code camps where I show off VSTS. The one thing i have to do is get sample data ready to go so I can demo well, I was reading about some VSTS extensions in the Marketplace when i came across a new extension that allows users to create sample data in a team project. I see its in preview and was just put out a few days ago. If you are not familiar with the Marketplace, its a place that the community can publish extensions for VSTS and TFS.
Its easy to install and setup the Sample Data widget. Go to the marketplace and install the widget first.
Once installed go into VSTS and select a team project that you nee to create sample data for. Go to the Home page of the team project and in the bottom right corner, you will see a round blue circle with a pencil in it. Clicking on that brings up a green circle with a plus in it. This one allows you to add widgets to the Home page to customize as you need. Click it and when the widget selection dialog comes up scroll down until you find the Sample Data widget and select it. Click the Add button on the dialog and when it goes away you just click the blue circle with a checkmark in it and you’re all set. The widget should be added to the bottom of the home page. When you find it, enter the name of the team project you want to add data to and click on Create. It will start creating test data for you. In my case it gave me an error the first time, so i clicked Delete to clean up the sample data and tried again. It failed again, but when i checked to see if there was any data created there was. I looked through it and there does not appear to be any issues with the data so i am going with it. I guess I’ll go back to the Marketplace and leave the team a message that i have some issues with it and i am sure they will look at that at some point. You have to remember that its in Preview so no worries.I will work through some demos and see how it goes. So if you need sample data for any reason in VSTS, check it out.