Posts

Showing posts from 2017

Git clone

Moving repository between TFS servers was very challenging task. It was possible but very complicated and almost every time I've seen it done in companies it ended up in history and branching lost. Recently I was planning moving git repository between VSTS accounts. Normal situation project starts as POC and ends up as always working solution. In git there is no problem at all to move repository with all the history and branches in 3 lines. And that's really it. And the fun part is that it's fast because we don't pull all the code but only object definitions. Update: The mirror can be maintained in sync thanks to command: git remote update and again git push --mirror https://yourNewAddress.visualstudio.com/defaultCollection/_git/newProjectName

Creating code first database delopyment - Migrate.exe and VSTS

Image
Creating database deployment. My case is EF 6 (in core there would be also possibility to create sql script great article here ) It should be so simple. As a developer you just go to Package Management Console and run Update-Database. Everything is just happening. Well not that everything. You have to set default project to project that should be use to find your code first migrations.  You have to set startup project to one that contains config file with database connection string.  And you have to have valid connection string If you don't have the startup project set right you get 'enigmatic' exception, that I will address later. System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, ...

DevOps gibberish

Image
DevOps is like a dirty word in programming world. It supposed to be a bridge between developers world and the IT Pro's world, between creating code and building infrastructure/ deploying code and application. I think first problem here is that developers think of themselves as artists, creators in the pure beautiful way, the way they don't ever have to deploy theirs  solution anywhere.

Decompilation - async await problem hunt

Image
The story Project that I love (because it's my baby) and work with, is written in very asynchronous manner. It's great in most of the times - e.g. no blocking of user interface, faster background loading. But sometimes problems occurs... We had one problem, strange things where happening. Whoever tested the case got different 'special' effects. I won't describe details but it looked like not all threads/tasks where synchronized on UI thread and refreshed data didn't appear before it was used again. What could be the reason? Nice code and design, we are using generic method invoker to call other methods - it's a wrapper for all calls. It's of course asynchronous and calls asynchronous methods by lambda expression, something like this: return await CallSleepyComplicatedAwaitingWithFunc(() => CallSleepyComplicated());     Internet never dies When something is posted once on internet it is there forever (or at leas a very long time). But wor...

Decompilation - dll spy toolset

Image
Did you ever needed to check what is inside some DLL or EXE file? In the dark ages that was popular way to gain certain knowledge, sometimes not so legal, but it was time that there was no open source. I know, not good enough excuse. Let's leave it alone in past. Still, curiosity of decompiling is a good thing. In dark ages there was a .Net Reflector  but one day it became a Pro version (paid version). fortunately where is a need there is a product, even two, maybe more but those two i know best dotPeek from Jet Brains and Just Decompile from Telerik. Using them is very easy, just drop file and it will be decompiled. Both applications are pretty efficient and generates almost ideally projected original code. Dot peek even recreates comments! Why this is alarming? Comments doesn't supposedly end up in released application. Decompiling you own code to exactly the same code is not very useful.  There is one more tool that is much more interesting. ILSpy . D...

Set output variable in a Powershell VSTS Build Task

Image
I have value in my artifact files. I set it in  this post . So now I can use it. I will get it almost the same way - using powershell.

VSTS build variable publish as artifact

Image
Powershell is a powerful tool. It's easy to create file in the fly, read from file, call some API. It's easy and flexible. I decided that I want to use all those tree operations in one of my VSTS pipelines. The scenario is: - take variable filled while build queuing - write it's value to text file that will be available as artifact - use artifact file value (read the file) - set Release variable with file content - use release variable for API call (or any other use).

Virtualize my work machine.

Image
Some experiments take some time. Others take much longer. Although they are not so complicated. Data-intensive operations take a long time. My experiment was to visualize my working machine. It's very good machine (gaming 14" MSI that I adore) but still it can be better :) In azure in the MSDN subscription I have money to spent so I can create quite heavy loaded machine with not so big price - of course if I don't use it all the time. And working machine should be (at least in theory) working only 8 h / 20 days a month.

Hardware in my handbag

Image
I'm Microsoft fanboy. I code in  C#. But I'm also mobile developer (I like to thinkt about myself as a full stack mobile developer). That's why I have a lot of hardware in my purse everyday. And even more on conferences.

Azure and Java resources shelved for later use

Image
I had a plan to create few posts about Azure related with Java and my work at one clients application. Here is the full Azure and Java story . I've created quite a lot of App Services in a process (it never work the first time I try to record it) and now all those resources are eating my virtual MSDN money! I could delete all of them. But if I wanted to come back some day and continue this story? I decided that I need to archive this structure.

Microsoft fanboy

Image
I'm Microsoft fanboy. I always liked Microsoft and from start I always worked in Microsoft Technology stack, I like technologies and that it they gives me job and there is always wide community ready to help and share knowledge. 

My opinions

Image
My opinion doesn't count.

Azure App Service console

Image
App Service Plan under the hood is a virtual machine with some pre-installed application like IIS. It's a little more complicated than just a VM per App Service Plan, and I as a user cannot access or change this machine. Well this is possible but in a App Service Environment . If you go down in list of App Service available tabs you'll find Console. This is fascinating tool. It is just a console.. but it's on App Service Plan virtual machine.

Azure post deployment scripts

Image
Let's do a trick. After deploying application (that was easy with Ftp or Git ) it would be nice to take some action. For example send an email, or write release notes to release page. I will do much fancier thing - I will write some text to console output.

Azure deploy. Local Git Repository

Image
Besides FTP there are other ways to deploy application to App Service. You can read more here . It was not so clear for me from the official explanation. I really thought that it's about the local repository based somewhere in my company's basement. But it turns out that this is repository local to Azure. It's fully functional git repository. You can see the history of my commits as example.

Azure Tomcat 7. Release

Image
Release the Kraken! Finally that I have ready infrastructure and I've shown the internals through Ftp, I can make the release. Release definition you can find here . This is very simple definition because it contains only one task -> copy WAR file to Azure using Ftp.

Azure Tomcat 7

Image
    Yeah I stumbled a bit writing in  Azure stories. Create App Service  about creating Tomcat 8 application. Well not that this is not correct or functional, it's just that I don't know how to deploy application to this App Service. It's full Tomcat and I know Tom Cat but no Tomcat 8. That's why I will live it to you. Sorry. But hopefully the simple solution I will present in moment will also be helpful in may other cases. I'm creating one more App Service, this time it will be just Web App with some properties  that will allow me to use Tomcat 7.

Azure application deployment preparation. FTP

Image
Creating App Service is quite easy thoue it takes some time. Afterwords I have fully functional web site. Well not exactly it's web site server without any application. Now I need to deploy my applications to Azure. There are few ways to do it, but first it would be nice to set the deployment credentials  with are used by FTP or Git for authentication.

Azure stories. Create App Service

Image
Lately I was talking about difference in PaaS and IaaS . I will probably come back to IaaS in the future, but most of the time I'll concentrate on PaaS solutions. PaaS is much closer to mine mindset, it's more intuitive for developer. I don't want to know (mostly) what's inside PaaS, what's under the hood, I just want it to work. I want to create to very simple pages both displaying only Hello World, based on .Net and Java. First the code and deployment packages. You can find full explanation here , and we can assume that we have 'something' ready to be deployed. Where I can deploy it?

Azure about PaaS and IaaS

When I started to work with Azure everyone told me that's there are two ways of creating things with Azure one way PaaS another way is IaaS . So what's the difference and what it is in the first place? PaaS is the new way of making things and IaaS is the old way, what do I mean by old ways. Well long, long time ago there where desktops, and some times there were Virtual Machines working on desktops, it was pretty simple because virtual machine was almost the same as normal with the difference that it needed additional software to run and wasn't physically connected to hardware rather with proxy application like Dropbox or VMware or any other. So IaaS is the same but on a could. IaaS is a VM with all needed stuff somewhere in data center available for me via internet. It's Infrastructure as a Service (Iaas). It's not only VM but IP address and other network related stuff I don't know too much about.

Living creature

Image
There is something very beautiful in fractals. We are looking at the symmetry and feel just right.  But I think there is something even more beautiful. It's alive creature. Something that's growing, something that is loved, taken care of, sometimes die a little bit and other time just blooms. It is a baby of mine, its my project. This is not only my baby is the teamwork, team effort.

Azure and Java. The build

Image
Backstory I already told so now some pure devops. The Java Hello World. I found first site that was simple index page with greetings. I forked it and added my own text just to be sure that's the page I'm looking for. You can get the repository here . Creating build definition is very simple because it's almost whole template. The only thing I change is removing restriction on published files types. I want to use .war not .jar in future release definition. Ready definition you can get here , or create it like shown below. Additionally I also created Hello World Asp MVC application and build for it. I will use it as side by side solution to show more options. Repo and build definition .

Unit Tests and VSTS. How to configure team services build with different testing frameworks.

Image
Configuring build just to check if code is compiling - it's boring and obvious, just create build, choose repository and add build solution task. That's it. This kind of build is useful for checking code integrity eg. after automatic merge. But it's much better to have also unit tests and run them, you can be more or less sure that when tests are green then the merge didn't broke anything vital.

First build with Vsts and GitHub

Image
I'm going to create simple build with different test frameworks the repository is already available on my GitHub . So Vsts will contain build definition and GitHub contains the code. I need to make a connection between them.

Visual Studio Team Services - VSTS in few word

GitHub is great. I have a GitHub account and I'm planning to share all source code for this blog on GitHub, especially that public repoes are free on GitHub. But I also have a Vsts account, well to be honest a few of them for different purposes, but in the end one is my main directory and others are just for fun, experiments or other strange stuff. Why I don't have all in GitHub? Vsts has no capacity restriction on it's content so I can have everything there, and the most important detail is that Vsts is free and it is private. No one not-invited can see my code collection, and not all code should be public. I also store file like old emails that felt right to be archived somewhere, or some documentation file related to very old projects like my master thesis (this really should not be seen by public anymore :D ). This is my private space for all my code at least since 2012.

Azure stories. Azure and Java

There's always a story to tell behind the stage, and this is one of many why I like VSTS ( Visual Studio Team Services ).  Recently I was working with a client trying to find the best cloud architecture for their project.  The small problem was that they we're writing in Java and I am a Microsoft Technology Stack, so the first problem I encountered was how to start because I know 'something' about cloud and azure but I don't know how to proceed with web applications wrote in Java. The easiest way is to Google something... but Googling something isn't enough because you can Google only the source code and you need something up and running ready to show.  The running something is the biggest problem here - how I can build Java, how to test it. So I have some skills in DevOps in VSTS, i love VSTS and i like creating Continuous Integrations on it. 

Women in IT

Image
J stands for Joanna. In Polish there is this rule that female names must end with vowel. I'm a .NET developer with, nicely said, 10+ years of experience. I read a lot about all those diversity problem, programs like 'woman to Polytechnics'. This is now a day a real thing. There is not enough developers and employers are looking for people to fill the gap, I really understand it.

Having a mentor and difficult beginnings

Image
I never had a mentor or even a person that believed in me. Well not never ever because I'm talking about first five years of my commercial job. After those five years I found friends, allies that at least where on my side.

Starting point

Image
It is not easy to start. To get out of your cozy little closet or basement, especially when you are an introverted developer always feeling phony about yourself.  And it really doesn't matter that everyone tells you that you are good, even special and you know so many things that other don't know. It doesn't really feels like it