Azure Functions and ServiceBus gotcha

Okay, so this might not be a gotcha, but I lost an hour early this morning trying to diagnose a problem with an Azure Function I’m writing. I’m using ServiceBus triggers and outputs to form a processing pipeline using the functions. One function reads the messages on a queue and then puts another message on a queue for another function to handle.

I was getting this non descriptive error when running locally.

error

After much experimentation I realised that the ServiceBus queue in the function.json must actually exist 🙂 For some reason I assumed the host would create them as required! Anyway.

Might be of use to somebody else.

Back to basics

Tempus Fugit. As a developer, one of the things that causes me to stress the most, is a simple lack of time.

I have so many ideas (mostly useless) floating around in my head that I would like to turn into reality. I have three apps in the App Store, which I don’t really update. I also have a day job.

Faced with so many things to do, I really struggle to focus. I can lock in on something for a week or two, but a customer email will arrive, or a new idea will pop into my head, and my priorities change, leaving something half done.

This excellent Commit Strip is basically my product range – http://www.commitstrip.com/en/2014/11/25/west-side-project-story/

Strip-Side-project-650-finalenglish

My iOS app, Roomr, is a good example of this.

What started out as a simple app for viewing the availablility of meeting rooms morphed into something more complicated, but which wasn’t *more* useful. I kept reacting to user’s feature requests, without keeping an eye on the growing complexity. Complexity, I said to myself, is natural as a product evolves.

Roomr doesn’t make much money. I’ve sold a few thousand units over the years, which I’m very thankful for, but it’s never actually been worth my time. Rather than maintaining that app, I’d have been better building an app for somebody else and getting paid.

It took me a long time to accept this simple truth.

Uncontrolled feature creep is the biggest issue I face.

I recently had a user state, in an email, that if I added feature X, they’d buy ten units of the app. I knew it would take me 20+ hours to implement this and that ten sales hardly covered 1/2 an hour of my time, but I went ahead anyway, knowing full well, that I’d probably never see a return on this investment. I justified it by saying “if I add feature X, more people will buy it”.

The fact of the matter is, it won’t make a blind bit of difference. I’ve had this request from two or three other users in the past three years.

Another justification for adding complexity is that by adding feature X, a large company will buy many, many licenses i.e. £££ for me. Again, reailty has taught me otherwise. I’ve had large multinationals inquire about the app and large scale deployments, but none of them ever made a purchase, despite many changes. An app with just one developer behind it, presents too much risk for companies, which I understand.

I’ve come to realise that, when you’re on your own building apps, simplicity is probably best. My iOS apps, Roomr and Peopler started with a very narrow focus on doing one thing and doing it well. Somewhere along the road, I lost focus on that. Sure, it was fun and interesting working on the complex stuff, but in the end, I think my nerves and customers, suffered.

I had planned on Roomr 4.0 being more complex than the previous versions, but I think it’s time to start ripping stuff out and making the app more focused than before. I’m also going to try ad support. If I can generate more revenue, it will be easier for me to update the apps.

This will, I suspect, upset some existing customers, but I would rather try a new approach, then kill the app off completely.

Import SaaS invoices into FreeAgent

One of the major pains when dealing with SaaS providers, is importing their invoices.

We all know the drill:

  • You log into your SaaS application
  • You find their invoice section.
  • You create a new bill in FreeAgent and copy/paste your way through the details and being sure to account for the various currencies!
  • You download the PDF form of the invoice and attach to the bill.
  • You then explain a banking transaction with this new bill.
  • Repeat over and over again for the various SaaS providers that take your money Smile

There is no standard way of getting these invoices and each provider has their own way of presenting the bills.

Painful is an understatement!.

Thankfully, Free Agent offers a very powerful (and easy to understand API) that enables developers to create applications that can interact with your account. As both a developer and a FreeAgent user, i decided to try and solve this woe.

My first idea was create an online service that could simply connect to each of my SaaS proviers. scrape the HTML and download new invoices each month. Whilst this is possible, it would mean having my service credentials sitting up on a server. Not good.

My second idea was to have a local windows service that did something similar. This approach started well until I hit Github. I use Two Factor Authentication, which I recommend, which makes automation impossible. The price of safety I suppose.

Having resigned myself to the “manual” approach, I explored the idea of using a Chome extension. This meant not having to worry about the credentials as I simply log into the providers the normal way. I also don’t have to worry about cloud security since none of my data leaves Chrome except when sent to FreeAgent (over HTTPS of course).

The idea is simple. When you visit a supported website, the extension injects an import button into the appropriate parts of the page. CLicking the button opens a dialog, prepopulated as best as possible.  You can then set the contact and category and optionally select the bank transaction you want to explain. Here is a GIF showing the flow on a dummy provider I created.

i4mFz7VxBD

This works *really* well, but it’s not 100%. Not all SaaS providers give all the information on the screen (I’ve tried parsing the PDF, but it’s too brittle and I don’t like my data going out of Chrome). Companies like Microsoft also redirect you all over the place when trying to open the invoice PDF, so sometimes you have to take actions like opening a PDF so the security cookies are set.

That said, overall, it’s made a massive difference to my accounting workflow. I can visit four or five providers in the space of 15 minutes and import 15 invoices. The rate of error is much lower since the extension is handling it for me.

At this moment in time, the extension supports:

  • Github
  • Office 365
  • Microsoft Azure
  • Taxamo
  • Hover (without PDF invoices it’s a bit disgusting so I’m looking at taking a screenshot)
  • Google Adwords
  • Forward

I want to add some memory into the extension, so it will preselect the contact and category for particular sites and I’ve a lot of JavaScript to clean up.

I think this could benefit other FreeAgent users and I’d ultimately like to release it and charge a monthly subscription. This would help me support providers beyond those I use myself.

If this workflow of invoice importing sounds familiar and is something you dread, I’d love if you could get in touch. I really like a few beta testers that could try this extension out and see if it’s a help or a hinderance. Please leave a comment or drop me an email – tomas@coldbear.co.uk

Android Beacon Monitoring Woes

My new experimental app, Job Tracker, has been out in the wild with my beta tester for the past few days and, whilst the feedback has been good, the app is just not working as I expected.

The main problem is that, after a random period of time, it stops picking up the beacons. This is due, I believe, to the fact that Android is killing my monitoring service due to memory pressure and failing to restart it. That or my implementation is utter rubbish. I’m going with the former 🙂

In order to make region monitoring work for beacons, you need to have an Android Service running that actually performs the monitoring. I had originally implemented this as a background service. To try and work around the problem, I’ve made my Monitoring Service run in the foreground and added a Ongoing notification to inform users as such.

device-2015-01-22-091258

This will, I hope, keep the service running for much longer, allowing a better experience for the user. This is just a reminder that iBeacons are certainly an Apple invention and hopefully Android will eventually bake iBeacon support into the OS.

Track your work. The iBeacon way (Van drivers only)

After a discussion with two of my brothers around the problems they face as mobile workers (electrician and mechanic), we got thinking about an app that might help them.

After much experimentation with Android and the (awesome) Estimote beacons, I have developed a simple Tracking application yesterday. It’s amazing what you can achieve when you have some clear and simple goals

By placing an Estimote beacon in their vans, their phones will track when they enter and exit. Combine this with their GPS location and you have a simple way of knowing when and where they leave their van.

A simple notification pops up when their enter their van asking them to complete the job details.

device-2015-01-10-134854

device-2015-01-10-134908

The biggest challenge here has been learning who Android finds locations. I finally settled on the FusedLocationAPI provider, but even this proved difficult to use. I wish Android would sort out it’s documentation or provider more up-to-date best practices!

Anyway, I have the Estimote SDK integrated, but the current challenge is making it work when the app has been killed. Simple in iOS. Not so simple in Android. In fact, I have yet to find any code samples on how I’m supposed to do it!

More to do, but this is coming together nicely!

Adding invoices from saas apps to freeagent

I’m a very happy FreeAgent user. I’ve been using it for just over one year now and can’t complain too much. Okay, so I’d love to be able to set the currency of bills, but that’s not a deal breaker for me right now.

I’m a freelance developer, so I’m responsible for my own accounts. Keeping your accounts up-to-date is important, but can be time consuming. One of the things that I find most annoying is that for each SaaS or advertising platform I use, I have to manually import the invoices and create a bill. It takes a few steps, so individually it’s not very complicated. The drawback is that I have to do it on four or five different sites. Find the invoice, export the PDF, return to FreeAgent, create the bill, import the PDF and set a few other details. Like I said, it’s not hard, but it’s repetitive.

As a developer, I know that anything repetitive can be automated.

My first instinct was to create a simple web application that would left me connect to FreeAgent and then import the invoices by using HTML scraping from the various pages. This, however, was going to be impossible since I use two-factor authentication on almost every site and NONE of the providers I want invoices for offer an API for that sort of thing.

My next idea was a local Windows8 application, but that suffered from the same limitations as the web app, thought it would have been possible using WebViews to get past the authentication steps.

After a little time reflecting, I was reminded of the Buffer App Chrome extensions that lets you buffer images etc. inline. This seemed like it might be adaptable. A quick bit of reading and 2 hours of experimentation and I had this working in GitHub!

image

The button Add to Bills is automatically inserted by my extension. It can read the row, pick up the date, download the PDF invoice automatically and upload it to my FreeAgent account. Things like the Currency still need to be manually modified, but the bulk of the work is done.

Another thirty minutes and I had Azure billing support to!

image

There is a lot of work to do before this Extension can be released to the Chrome Store and I’d like to add support for more accounting platforms (extending beyond FreeAgent) and billing sources, but I’m happy with this as a starting point.

If you’re a FreeAgent user who suffers from invoice importing fatigue, I’d love to hear your thoughts on this.

Testing iOS Enterprise features without an MDM

Recently, I deployed a special version of Roomr to a large enterprise customer for inclusion in their Enterprise App Store. Part of the arrangement was that I support two enterprise features; Single Sign-On and Managed App Configuration.

This, on the face of it, was an excellent deal. I watched some WWDC videos on preparing apps for Enterprise and had managed to land a face to face meeting with the head of IT at this company. It seemed like a small amount of code would need changing in exchange for a tremendous financial opportunity (the company in question has over 120K employees world wide).

However, things are rarely as easy as they appear.

I immediately discovered, to my dismay, that the Managed App Configuration feature required a full MDM (mobile device management) platform to operate correctly. I searched the internet looking for MDM software that I could download and use for testing, but sadly I couldn’t find any. All of the major providers offer trial versions, but you have to get in touch with them etc. etc. As I wasn’t going to buy their software, they were understandable disinterested.

I knew I needed to test my software before releasing it, so I needed another approach.

I decided to build the software I needed to complete my testing. After some prelimiary research I discovered I needed to be a member of the Apple iOS Enterprise developer program. At £185, this was a hefty amount, but the potential earnings from a successful enterprise deployment made it worth the investment. I handed over my credit card information and got Cold Bear Ltd registered within the Enterprise program.

After getting the MDM protocol documentation (thanks to Peter Marcos at Apple for helping with this), I got to work. After much hair pulling, use of SSL and prolific swearing, I got a basic MDM solution working. Another few hours and I had tested my Enterprise code. I packaged up the IPA and emailed it to my client.

After the dust settled, I got an email from another developer who was having trouble testing the same Managed Configuration feature. After establishing that he would be willing to pay money for a simple way to test this feature (his MDM wasn’t working) I started refactoring my code.

After more swearing and hair pulling, TestMDM (http://testmdm.cloudapp.net) was born! TestMDM offers basic MDM functionality in a time-boxed fashion. You might want to test your app for an hour or a week and you only pay for the time you need. I hope this strikes a balance between the time and cost purchasing an MDM and the need to test some features quickly and effectively.

It’s almost ready for launch. I’m just putting the finishing touches to the device enrolment functionality to make it as easy as possible.

So, if you’re an enterprise developer or thinking of getting into enterprise development, TestMDM might be of use to you. If you’d like to know more, please drop me an email – tomas@coldbear.co.uk and I’d be happy to have a chat about what you need for enterprise development.

Tom

PS The name TestMDM is most likely to change Smile If you have any suggestions, I’d love to hear them.

Blackwall Tunnels Alerts

I think it’s fair to say that most people who live in London, do at one time or another, have to use the Blackwall Tunnel. Other Londoners use it each and every day to get to and from work.

I am somebody who has the use the tunnel when visiting some family, so it’s a once-a-fortnight experience for me. Despite my infrequent use of the tunnel, I do seem to get caught in lots and lots of traffic, usually due to minor accidents in or around the tunnel. Whilst not the end of the world (I’m not rushing to get to work or home to make dinner), it does frustrate me. It frustrates me an awful lot.

Like any modern person I turn to my smartphone for a solution. Whilst there are many great traffic apps available in the App Store, they cover either the whole of London or the whole of the UK. This makes it a little tricky to find information about one particular section of the traffic network. So Blackwall Tunnel Alert was born.AllClear_400px

The interface is very simple. You see a large status indication. When something goes wrong, you will see the status changes and the cause of the issues are also shown.

Moderate_400px

The interface is simple and it’s easy to see if there is something bad happening.

It’s also possible to upgrade the app to provide you with push notifications so you can be alerted when the status has changed.

Blackwall Tunnel Alert is available to download from the iOS App Store for free and requires iOS 7.

 

App_Store_Badge21