Mobile First Cloud First

A blog by Geert van der Cruijsen on Apps, Cloud & ALM

Connecting to Azure Blob Storage events using Azure Event Grid

I was looking for a solution to sync an Azure blob storage containing images to a third party solution that contained an API to upload images. my initial thoughts were to hook up Azure Functions to react on Azure Blob Storage triggers. One thing that is not possible with blob storage triggers is to act on delete. there is only a trigger on adding or changing files.

Luckily Microsoft announced a new solution called Event Grid a few months back. Event Grid is great for connecting events that come from azure resources (or custom resources) to things like Azure Functions or Logic Apps.

eventgrid

Event Grid also supports events for Blob Storage where you get events for adding, changing or deleting items. So how to get started?

Event Grid is easy to setup and exists out of 2 parts. Topics and Subscriptions. Topics are places where events are sent to by Azure resources or even custom publishers. Subscriptions can be made on topics and will receive the events from a certain topic.

Creating the Storage Account / Event Grid Topic

Azure Blob storage has an Event Grid topic built in so you don’t have to actually create a separate Event Grid Topic. At the time of writing Event Grid is only available in West Central US and US West 2 regions so if you create a Storage account there i’ll automatically also get an Event Grid Topic.

Let’s create the topic using Azure CLI

#create resourcegroup
az group create -n <<ResourceGroupName>> -l westus2
#create storage account 
az storage account create \    
   --location westus2 \ 
   --name <<NameOfStorageAccount>> \  
   --access-tier cool \    
   --kind blobstorage \    
   --resource-group <<ResourceGroupName>> \ 
   --sku Standard_LRS \

Or using the Azure Portal:

Screen Shot 2017-12-06 at 15.12.33

When we open the storage account in the azure portal we’ll see that in the left menu is an option called Event Grid. In this menu you can see a list of all subscriptions to this Event Grid Topic. Current we don’t have one so lets take a look on how we can do that.

Creating the Event Grid Subscriptions

Since a topic can have multiple subscribers let’s add 2 different subscribers. First we’ll create a very simple subscription that allows us to see what the events actually look like and after that we’ll take a look in adding an Azure Function that handles the events.

Simple test subscription using Requestb.in

Requestb.in is a website where you can request a simple URL that collects all http messages sent to that URL. This is a free service and will keep the last 20 messages for a maximum amount of 48 hours. As soon as we created our requestbin we’ll receive a URL that looks like something like this: https://requestb.in/1ckzahm1

we can add this URL as a web hook subscription to the topic we created earlier. this can be done either using Azure CLI or the Azure portal.

az eventgrid resource event-subscription create    
   --endpoint "https://requestb.in/1ckzahm1" \    
   --name requestbinsubscription \  
   --provider-namespace Microsoft.Storage \  
   --resource-type storageAccounts \  
   --resource-group <<ResourceGroupName>> \   
   --resource-name cloudinarysync

Or in the Azure portal:

 Screen Shot 2017-12-06 at 15.15.18

when we upload a file to the storage account now we are able to see the event that was triggered by going to the requestb.in inspect web page. We’ll see the json payload containing the event details so we can use this later in our Azure function.

Screen Shot 2017-12-06 at 15.19.03

Example json for file adding and deleting looks like the following:

File Add/Change event

File Deleted event

So we’ve seen the easiest way to hook up the Storage account events using Event Grid. Let’s add an Azure function that actually does something with the events.

Azure Function

When you create a new Azure Function you’ll have to choose the trigger type. you can choose between several options here like a Http Trigger, Webhook Trigger or Event Grid Trigger.  When looking at the list you might think Event Grid Trigger is the way to go. I tend to disagree for now. The events sent from the Event Grid are just play POST http messages so choosing a webhook trigger or Http trigger works just as good and they are even easier to test locally. The thing that Event Grid Trigger adds is that it maps the json payload shown above to a typed object so you can immediatly use it without parsing the json yourself. Another downside from Http Trigger and Webhook trigger is that you’ll have to arrange security yourself since everyone who knows the url could call the webhook by default. Let’s look at both options.

If you are using the portal use the small link below “Get started on your own” called “Custom Function” to choose the trigger type.

Screen Shot 2017-12-06 at 20.10.54

Screen Shot 2017-12-06 at 20.12.47 Screen Shot 2017-12-06 at 20.12.59 Screen Shot 2017-12-06 at 20.13.11

Event Grid Trigger

When you open your event grid trigger (if you created it via the portal but also for precompiled functions that you uploaded there is a link on the top right called “Add Event Grid Subscription”. Click this to set up the Event Grid Trigger.

Screen Shot 2017-12-06 at 20.14.06

 

 

In the “Create Event Subscription” window select the “Storage Account” topic type and select your storage account. After pressing Create your Azure Function will be triggered after each change in the storage account.

Screen Shot 2017-12-06 at 20.14.31

 

Http / Webhook Trigger

Webhook or Http Triggers work almost the same way. in the Portal there is a link on the top right to get the Function URL. When you click this  you’ll see a popup with the endpoint that you should copy. after this adding the subscription works exactly the same as i described above for the requestb.in except now you’ll enter this URL you just copied.

Screen Shot 2017-12-06 at 20.15.23

Now we’ve set up the plumbing we can start writing our function. i’ll show you the code for a http trigger but an Event grid Trigger function would like almost the same. you can skip the parsing of the json there because you get a typed  object as parameter containing all information.

 

Pitfalls & Tips

So if everything is correct you should have a working Azure Function now. But how to track the events that are coming in? You could set up application insights and track usage yourself but a nice feature of Event Grid is that it has build in logging and metrics. The metrics itself are a bit hidden in the Azure Portal so i’ll explain how to find them.

The subscriptions itself cannot be found in the resource group of the topic. When navigating to the storage account and clicking Event Grid you can get a list of your subscriptions but no metrics.

For metrics of the subscriptions you have to go to your left menu in the Azure portal and click the > arrow for more resources. search for Subscriptions and here the Event Grid Subscriptions will show up here

Screen Shot 2017-12-06 at 20.53.32

 

when you go here you’ll get an overview of all events that were triggered by a Topic and the subscriptions connected to the topic. You can also see when the Event Grid did retries and which events completed successfully or failed. It took me a while to find this so hopefully this helps more people find it.

Screen Shot 2017-12-05 at 17.29.52

 

Another thing to note is that right after creation of the subscription it might take a while for the events to start firing. I don’t know if this is something that is related to the preview state of Event Grid or if it will always be the case.  In the end all events fired but it took a while for the first events to be fired. After it was running for a while the events were triggered really fast. even when i did a large amount of changes the events were fired within seconds.

Hopefully this is useful for you developers who want to react to triggers from Azure Storage.

Happy Coding!

Geert van der Cruijsen

Please follow and like:
RSS
Follow by Email
Facebook
Google+
https://mobilefirstcloudfirst.net/2017/12/connecting-azure-blob-storage-events-using-event-grid/
LinkedIn

Setting up Continuous delivery for Azure API management with VSTS

Where Continuous delivery for web applications on Azure is becoming quite popular and common  I couldn’t find anything about settting this up for your API definitions in Azure API management. Since i had to set this up at my current customer I thought it was a good idea to share this in a blogpost so everyone can enjoy it. In this blogpost i’ll explain how you can set up Continuous delivery of your API definitions in Azure API management including the actual API implementation in Azure Web apps using VSTS (Visual Studio Team Services)

azure api management

First let me explain the architecture we use for our API landscape. As explained we use Azure API management for exposing the APIs to the outside world and we use Azure Web Apps for hosting the API implementation. These Web apps (Both .Net Core and Full framework .Net Web APIs) are hosted in an ASE (App Service Environment) so they are not exposed directly to the internet while we can still use all the cool things Azure Web Apps offer. These API web apps then connect to datastores hosted in Azure or connect to the on premise hosted environments through an express route or VPN.

To be able to set up our Continuous Delivery pipeline we have to arrange the following things.

  • Build your API implementation so we have a releasable package
  • Create infrastructure to host the API implementation
  • Deploy the API implementation package to the newly created infrastructure
  • Add API definition to Azure API management.
  • Repeat above steps for each environment. (DTAP)

Building your App

The first step can be different from my example if you’re not building your APIs using .Net technology. In our landscape we have a mix of APIs made with .Net Core and APIs made with .Net Full Framework because they needed libraries that were not available in .Net Core (yet). I’m not going into details on how to build your API using VSTS because i’ll assume  you’re already doing this or you know how to do this. If not here is a link to the official documentation.

One thing to keep in mind is that your API  web app does have to expose a API definition so Azure API Management can import this. We use Swashbuckle for this to automatically generate a swagger definition. If you’re using .Net Core you’ll have to use Swashbuckle.AspNetCore

Deploying the API implementation & adding it to Azure API management

For automating the deployments we’re going to the use Release Management feature of VSTS. In our first environment we’ll create steps to do all the things we described above.

 Screen Shot 2017-07-21 at 13.20.30

 The steps in our workflow are the following:

  1. Create web application infrastructure by rolling out an ARM template
  2. Set environment specific variables
  3. deploy the API implementation package
  4. Use a task group to add the API definition to Azure API management.

Creating the web app infrastructure & deploying the API Implementation package

the first and third steps are the basic steps of deploying a web application to Azure web apps. This is no different for APIs so i’ll just link to an existing blogpost here that explains these if you don’t know what they do.

Setting environment specific variables

the second task is a custom task created by my colleague Pascal Naber. It can help you overwrite specific variables you want to use in your environments by storing these settings as App Settings on your Azure web app. We use this to set the connection strings to backend systems for example a Redis Cache or a database.

Add API to API Management

So if we release the first 3 steps we would have an API that would on it’s own. But the main reason of this blogpost was that we want to have our API exposed through Azure API management so let’s have a look on how we can do that.

Azure API management has Powershell commands to interact with it and we can use this to add API definitions to Azure API management too. Below is a sample piece of Powershell that can import such an API definition from a Swagger file.

The script is built up out of 3 parts: first we retrieve the API management context by using the New-AzureRmApiManagementContext Commandlet. When we’ve gotten a context we can use this to interact with our API management instance. The second part is retrieving the swagger file from our running Web app through wget which is short for doing a GET web request. We’ll download the swagger file to a temporary disk location because in our case our web apps are running in an ASE  and therefore are not accessible through the Internet. if your web apps are connected to the internet you can also directly use the URL in the 3rd command to import the Swagger file into Azure API Management. Import-AzureRmApiManagementApi.

So now we have a script that we can use to import the API let’s add it to the VSTS release pipeline we could just add the powershell script to our source control and call the powershell using the build in powershell task. I’d like to make the developers’ life in our dev teams as easy as possible so i’m tried to abstract all Powershell mumbo jumbo away from them so they can focus on their APIs. To do this i’ve created a “Task Group” in VSTS containing this Powershell task so developers can just pick the “Add API to API Management Task” from the list in VSTS and supply the necessary parameters.

Screen Shot 2017-07-21 at 13.22.00

Screen Shot 2017-07-21 at 13.23.46

When we add this task group to the release we can run our release again and the API should be added to Azure API Management.

 Screen Shot 2017-07-21 at 13.20.30

Success!! Our initial continuous delivery process is fixed. At my current client we have 4 different API management instances and we also deploy our APIs 4x. A Development, Test, Acceptance and Production instance. The workflow we created deploys the API to our development environment. We’ve set this up to be continuous so every time a build completes on the master branch we create a new release that will deploy a new API instance to Azure and will update our Development Azure API management instance.

We can now clone this environment 3x so we create a pipeline that will move from dev, test to acceptance and production. I always set the trigger to automatically after the previous environment is completed. if we run our release again we’ll have 4 API instances deployed and in all 4 Azure API management instances they corresponding API will be imported.

Now the only thing you have to add is optionally adding integration tests to the environment you prefer and you are ready to roll!

Screen Shot 2017-07-21 at 13.24.10

 

Happy Coding!

Geert van der Cruijsen

Please follow and like:
RSS
Follow by Email
Facebook
Google+
https://mobilefirstcloudfirst.net/2017/07/setting-continuous-delivery-azure-api-management-vsts/
LinkedIn

Session videos to watch from Build 2017 for Mobile developers

It’s been 2 weeks since we had a great week at Build 2017 in Seattle. In the weeks after Build all recorded sessions came online on Channel 9. I’ve created a list of all things relevant for (Xamarin) mobile developers ranging from the new Xamarin announcements that made the headlines to some other sessions that you might have missed but can be relevant for mobile developers.

build

Lets start with the basics:

Keynotes of day 1 & 2

Although the first day didn’t have that much mobile stuff in it it did a good job on displaying where Microsoft is aiming for in the future. AI is a big part in this and AI can also be big on Mobile so it might still inspire you to build great new innovations. The Second day was the day of Windows and also contained all the mobile stuff.

https://channel9.msdn.com/Events/Build/2017/KEY01 & https://channel9.msdn.com/Events/Build/2017/KEY02

20170510_080708

“With great power comes great responsibility – Satya Nadella –  build 2017”

 

Xamarin

Xamarin had a bunch of sessions where they announced new things and showed their roadmap.

Xamarin: The future of mobile app development

When i first looked at the Build sessions i was about to skip this session. Sure James + Miguel are great presenters so that’s almost worth to watch but i expected this to be some Xamarin introduction. Luckily Miguel mentioned that this wasn’t the case so i was there. In this session Miguel explains what Microsoft is trying to achieve for mobile developers and they show all the new cool tools & bits for developers. a must watch! i especially like the bit where they demo the live player and the fastlane integration.

https://channel9.msdn.com/Events/Build/2017/B8103

 

Visual Studio for Mac

20170510_152836

During the keynote Visual Studio for Mac was already announced but in this session Miguel and Joseph go through more of the details of Visual studio for the Mac and what the future for this IDE will look like.  Joseph and Miguel were clearly having fun on stage. Bunch of Hackers!

https://channel9.msdn.com/Events/Build/2017/B8095

20170510_160818

 

What’s new in Xamarin.Forms

The third and last session held by Xamarin folks was about Xamarin Forms. Nobody less than Jason Smith explains about what is to come in Xamarin Forms 3.0 such as performance improvements,  and the FlexLayout which is an awesome feature for building apps across multiple device sizes. Some other things Jason mentioned were css like styling, one time binding and improvements in the listview

https://channel9.msdn.com/Events/Build/2017/B8099

 

Mobile Center & Visual Studio

Mobile center is a new product that together with VSTS should cover most devops teams in a full devops solution for mobile developers. Here are the key sessions to watch regarding mobile center:

Visual Studio Mobile Center: Ship mobile apps faster

The major session by the Mobile Center team is a must watch if you are thinking about using mobile center.  Thomas Dohmke and Keith Ballinger explain all the new features of mobile center like UWP support, Push notifications and store deployments

https://channel9.msdn.com/Events/Build/2017/B8072

 

Visual Studio Mobile Center and Visual Studio Team Services: Better together for your Mobile DevOps

This session by Simana Pasat explains what mobile center does and how this fits together with VSTS.

https://channel9.msdn.com/Events/Build/2017/T6079

 

General C# & .Net

Build is not only about mobile development. There are several other sessions that are not specific for mobile developers but can be really useful for mobile developers since we still code in C# and .Net right?

20170510_114637

Three Runtimes, one standard… .NET Standard: All in Visual Studio 2017

Scott Hanselman and Scott Hunter gave a great presentation on .Net Standard and .Net core. important changes coming to .Net in the coming year. If you’re not up to date with what .Net standard is all about this session has your covered. Next to that the 2 Scotts are just generally funny so worth a watch even if you’re already an expert on .Net Core and .Net Standard 2.0

https://channel9.msdn.com/Events/Build/2017/B8001

 

The future of C#

This session is a classic Build session that Mads and Dustin do every year. When i read the session abstract it made me laugh: “We’re Back!” it stated as this is a Build classic i remembered back from when i was at Build in 2012. This year they showed all the new features of C# 7 but also the road ahead of C# 7.1, 7.2 and C# 8!!

https://channel9.msdn.com/Events/Build/2017/B8104

 

SignalR .NET Core: Realtime cross-platform open web communication

Damian Edwards and David Fowler explain the future of SignalR. SignalR was already a way of building real time communication between several devices but this was always a bit unreliable and wonky, especially on Mobile devices. With SignalR Core they are focussing on a complete rebuild from the ground up and looks really promising. I think this will be used a lot after it’s GA somewhere later this year

https://channel9.msdn.com/Events/Build/2017/B8078

 

Cognitive Services

Cognitive services and AI were a major topic at build.  Here are some videos (next to the keynote) that might inspire you to use cognitive services in your apps

Computer vision made easy: From pre-trained models to Custom Vision, Microsoft Cognitive Services has you covered

Computer vision is a super cool topic and it’s so easy to implement. In this session Anna Roth shows you the possibilities of cognitive services related to computer vision

https://channel9.msdn.com/Events/Build/2017/B8020

 

Using Microsoft Cognitive Services to bring the power of speech recognition to your apps

Next to computer vision speech recognition is another cognitive service that really blows my mind how far we’ve come with technology in the past few years. Watch this session for everything about speech recognition in your apps

https://channel9.msdn.com/Events/Build/2017/B8092

Project Rome

Project Rome is a really interesting project for mobile developers and most mobile dev’s i’ve spoken at Build or after Build still didn’t have any knowledge about it. Project Rome focusses on inter device experiences for apps which is something that is going to be huge in the future is my prediction.

bill buxton

Cross-device and cross-platform experiences with Project Rome and Microsoft Graph

This session gives a good overview of what is possible by using Project Rome. Vikas and Carmen gave lots of demo’s and explained the why, the what and how of project rome

https://channel9.msdn.com/Events/Build/2017/B8025

 

App engagement in Windows Timeline and Cortana with User Activities and Project Rome

Project Rome goes hand in hand with the Microsoft Graph and the addition of User Activities and Devices to the Microsoft Graph. In this session Shawn and Juan describe how you can engage users cross device by using the features of Cortana and the new Windows Timeline.

https://channel9.msdn.com/Events/Build/2017/B8108

 

Bots

“Bots are the new apps”. it’s a sentence i’ve heard quite often in the past year which was unofficially called “the year of the bots”. Is this mobile tech?  I’m still not convinced this will replace native mobile apps but it’s a great addition to cover certain mobile moments.

bot framework

Bot capabilities, patterns and principles

I visited this session and i have to say i really liked it.  Mat Velloso and Ryan Volum give some real life examples of how you could set up a bot and what design patterns you can use to set up a good bot. Even if you’re not a bot developer this might inspire you to build some small bots or integrate them in your apps.

https://channel9.msdn.com/Events/Build/2017/B8010

 

Windows

UWP was a big topic at Build as it is every year. although i haven’t focussed on this much during this year of Build since i was at all sessions above here focussing Xamarin and other Mobile or Azure related topics there is still quite a big list of videos worth watching is you’re building UWP apps.

The first major announcement that i really liked was the Fluent design system. Although i’m a dev i really love good design and these kind of systems really help me to build great stuff. I absolutely loved Metro (back when it was announced) but Microsoft didn’t upgrade this design language that much up until now.

 

fluent design system

Introducing Fluent Design

https://channel9.msdn.com/Events/Build/2017/B8066

Build Amazing Apps with Fluent Design

https://channel9.msdn.com/Events/Build/2017/B8034

 

Other sessions on UWP development:

What’s new and coming for Windows UI: XAML and composition

https://channel9.msdn.com/Events/Build/2017/B8100

Windows Store: Manage and promote apps your way

https://channel9.msdn.com/Events/Build/2017/B8098

App Model evolution

https://channel9.msdn.com/Events/Build/2017/B8004

Nextgen UWP app distribution: Building extensible, stream-able, componentized apps

https://channel9.msdn.com/Events/Build/2017/B8093

Ten things you didn’t know about Visual Studio 2017 for building .NET UWP apps

https://channel9.msdn.com/Events/Build/2017/B8096

XAML custom controls for UWP: Start to finish

https://channel9.msdn.com/Events/Build/2017/B8035

 

 

These sessions should cover quite some of your spare time to get you fully up to date of current mobile development in the Microsoft space. I really like listening to some of them during my commute. Did i miss any important sessions? please let me know in the comments.

20170512_151116

I had a great time at Build in Seattle so hopefully to see you next time.

Happy Coding!

Geert van der Cruijsen

Please follow and like:
RSS
Follow by Email
Facebook
Google+
https://mobilefirstcloudfirst.net/2017/05/session-videos-watch-build-2017-mobile-developers/
LinkedIn

Created an open source VSTS build & release task for Azure Web App Virtual File System

I’ve created a new VSTS Build & Release task to help you interact with the (VFS) Virtual File System API (Part of KUDU API of your Azure Web App). Currently this task can only be used to delete specific files or directories from the web app during your build or release workflow. It will be updated in the near future to also be able to list files or to upload / download files through the VFS API.

banner

The reason i made this task was that i needed it at my current customer. We’re deploying our custom solution to a Sitecore website running on Azure web apps using MSDeploy. The deployment consists of 2 parts: an install of the out-of-the-box Sitecore installation and the deployment of our customisations. When deploying new versions we want to keep the Sitecore installation and MSDeploy will update most of our customisations. Some customisations however create artifacts that stay on the server and aren’t  in control of the MSDeploy package that can cause errors on our web application. This new VSTS Build / Release task can help you delete these files. In the future this task will be updated with other functionality of the VFS API such as listing, uploading or downloading files.

The task is available in the VSTS Marketplace and is open source on github.

Let’s have a look how to use this task and how it works under the hood.
Continue reading

Please follow and like:
RSS
Follow by Email
Facebook
Google+
https://mobilefirstcloudfirst.net/2017/02/created-open-source-vsts-build-release-task-azure-web-app-virtual-file-system/
LinkedIn

Building, testing and deploying precompiled Azure Functions

Azure functions are great to build small specialized services really fast. When you create an Azure Functions project by using the built-in template from the SDK in Visual Studio you’ll automatically get a function made in a CSX file. This looks like plain old C# but in fact it is actually  is C# Script. When you’re deploying these files to Azure you don’t have to compile them locally or on a build server but you can just upload them to your Azure Storage directly.

In the last update for Azure Functions the option to build precompiled functions was added. Doing this is actually pretty simple. I’ve created a sample project on Github containing a precompiled Azure function, unit tests for the function and an ARM template to deploy the function. Lets go over the steps to create a precompiled Azure function.

Continue reading

Please follow and like:
RSS
Follow by Email
Facebook
Google+
https://mobilefirstcloudfirst.net/2017/01/building-testing-deploying-precompiled-azure-functions/
LinkedIn

It’s 2017: Test automation is not optional when building mobile apps!

Note: although this post focusses on mobile app development using Xamarin it also applies to other native mobile apps built in Swift, Java or even web apps. it’s 2017! whatever you are building get started with Test Automation!

As a consultant working for Xpirit i get to see a lot of different customers which I help with my expertise in building mobile applications to improve their mobile apps. Something I noticed in the previous year is that continuous delivery is a hot topic and companies and teams focus on deploying apps automatically to their testers through hockeyapp or even to the stores in beta and / or production.

In agile scenario’s (and come on who isn’t doing that currently? Every company or project I visit is saying they are agile or doing Scrum although some only do dailies and call that scrum 😉 ) In the current world it is really important to be able to release often because you want to be able to adapt to customer needs which are almost always changing and evolving.

Implementing a Shift left Quality Model

Test Automation is a process that does not belong to the developers or testers alone. It’s something that has to be in everyone’s mind from Product Owner to Developer and Tester. Automated tests can help you lower regression test effort but investing in Test Automation can really help you make a shift left focussing on quality earlier in your application development process.

Continue reading

Please follow and like:
RSS
Follow by Email
Facebook
Google+
https://mobilefirstcloudfirst.net/2017/01/2017-test-automation-not-optional-building-mobile-apps/
LinkedIn

Created an open source VSTS build & release task for Sitecore.Ship

At my current customer we’re implementing an Azure environment which also contains a Sitecore application. We’re using VSTS to for all aspects of the application development lifecycle from agile planning to source control and automated builds & releases. In the release pipeline we can use the out of the box Azure web deploy build steps to deploy our code to our web app which is a Sitecore instance. The next step is to be able to also deploy the Sitecore content we created as code using TDS to our Sitecore Site.

Sitecore.Ship is an open source project which makes it easy to deploy Sitecore .Update files to your Sitecore Instance. It is created by Kevin Obee and it can be found here on Github

in our Build we build our TDS projects using MSBuild to generate .Update files which we can then deploy in our release pipeline to Sitecore. There was one problem however which was that there was no build task to do this. Since my role at my current client is supporting all the development teams in improving their continuous delivery process i decided to create a task to make their life easier.

sitecoreship
Continue reading

Please follow and like:
RSS
Follow by Email
Facebook
Google+
https://mobilefirstcloudfirst.net/2017/01/created-open-source-vsts-build-release-task-sitecore-ship/
LinkedIn

Fix “App may slow down your iPhone” popup for Xamarin apps

For a while now (september 2015)  Apple requires apps that are submitted to iTunes to be 64 bit. When building your app for the simulator this isn’t required because app doesn’t go through the Apple screening. Since iOS 10.1 update however Apple added a little popup that checks if an app supports X64 and otherwise will show you a popup telling: “[App name] may slow down your iPhone”. It will only show the error message once and is meant for old apps which are added to the store before september 2015 and are still on peoples phones/tablets who need to update to X64.

Popup message: [App name] may slow down your iPhone

Screen Shot 2016-11-08 at 22.09.46

The fix is quite easy. just set the iOS build to support X64 also when building for the simulator.

Xamarin Studio

in Xamarin Studio go to properties of your iOS project. by rightclicking your iOS project. -> iOS Build tab  -> make sure that Supported Architecture for each configuration contains X86_64 or i386 + x86_64

Screen Shot 2016-11-08 at 22.08.58

Visual Studio

in Visual Studio right click your iOS project and select properties. -> go to iOS Build -> Advance tab ->make sure that Supported Architecture for each configuration contains X86_64 or i386 + x86_64

Screen Shot 2016-11-08 at 21.45.38

 

Although this is a small issue i got some questions by new developers what this message meant. so hopefully this blogposts helps those who were questioning why this message is showing up all of a sudden.

Happy coding!

Geert van der Cruijsen

Please follow and like:
RSS
Follow by Email
Facebook
Google+
https://mobilefirstcloudfirst.net/2016/11/fix-app-may-slow-down-your-iphone-popup-for-xamarin-apps/
LinkedIn

Adding an Azure web app to an Application Service Environment running in another subscription

Web apps and Api apps  in Azure are great, however when using them you have to agree to have them connected to the internet directly without the possibility of adding a WAF or other kind of additional protection (next to the default Azure line of defense). When you want to add something like that you have to add an Internal Application Service Environment to host your apps so you can control the network access to these apps.

App Service

However adding an Application Service Environment is quite costly if you are only running a few apps in them. (Minimum requirements for an Application Service Environment are 2 P2’s and 2 P1’s to run the Application Service Environment (ASE)

In our case adding an ASE was fine except that we have a scenario where we have quite a lot of subscriptions and most of them are quite small running only a couple of apps in them. Adding an ASE for each subscription was going to become a bit to costly so we came up with the idea of creating 1 central subscription called “Shared Services” where we would host things that multiple departments could share such as WAF functionality, the VNet, the Express route and also the ASE.

After creating the design we ran in to some problems actually implementing it because we weren’t able to select an ASE in another subscription which was part of the same enterprise agreement when creating an App Service Plan or Web App in Azure.  After checking it seems that this is a limitation of the Azure Portal and we had to use ARM templates to create our web app. This didn’t matter because we were planning on using ARM templates anyway. so we started to give it a try.

At first we had some trouble adding the ASE as our hosting environment. we tried adding the “HostingEnvironment” to point to the name of the ASE in our other subscription but this did not work and we kept receiving errors like “Cannot find HostingEnvironment with name *HostingEnvironmentName*. (Code: NotFound)”

ASE erorr message

 

After that we tried to remove the “HostingEnvironment” property and only set the “HostingEnvironmentID” to directly link to the full resourceID of our ASE. this did get our hopes up because we were able to deploy the web app, however it was running on the P1’s that were part of the workerpool of our internal ASE but it still had a public dns name and was accessible from the internet. I guess we weren’t supposed to created it this way. so i asked help from the Microsoft product team and they pointed me to the right correction.

It all boils down to using a newer API version of the Web App and App Service Plan ARM template API than that are generated in visual studio when building ARM templates. we had to use apiVersion: 2015-08-01

in here we can set the “hostingEnvironmentProfile” to the full resourceID of our ASE for both the App Service Plan as the Web App. Next to that we also have to set the sku to the correct worker pool within our ASE.

Now when we try to deploy our ARM template it will actually create an App Service Plan and Web App in another subscription than where our ASE is running. Nice!

Hopefully this post will help you when you run in to the same problems i did when trying to deploy web apps in an ASE using ARM templates.

Happy Coding / Deploying

Geert van der Cruijsen

Please follow and like:
RSS
Follow by Email
Facebook
Google+
https://mobilefirstcloudfirst.net/2016/11/adding-an-azure-web-app-to-an-application-service-environment-running-in-another-subscription/
LinkedIn

Techdays 2016 slides & Recap

Last week 4 and 5th of October Microsoft organized Techdays in the Netherlands and the full Xpirit team was there as platinum sponsor. We organized lots of cool things such as the Techdays Minihack zone where people could get hands on expierence and compete for cool prizes.  Xpirit was also the supplier of the official Techdays app which we open sourced during Techdays. The source can be found here on github: https://github.com/XpiritBV/app-evolve

 

As Xpirit we delivered 17 sessions and had 7 speakers on the event.  I delivered 2 sessions on Xamarin topics. Here are the slides for the sessions. The Videos are coming later (and will be in Dutch).

Xamarin Test cloud – From zero to hero in automated UI testing

Session abstract:

Looking at the mobile device landscape it became almost impossible to do manual testing on all types of devices that your customers use. Not even thinking about what your app looks like on some very rare Android devices. To ensure great quality of your apps you’ll have to introduce automated UI testing and Xamarin Test cloud can  be the tool for the job. During this session Geert will show how to  start building automated tests for mobile apps to demonstrate the features of Xamarin test cloud and how it could help you in your app development cycle. ‘Geert will give best practices and tips on what to test and what not to test and how to structure your tests. Join this session if you want to ensure your apps look great on all devices.

Slides:

Video: (in Dutch)

 

Techdays 2016 app: Behind the Scenes

Co-presenter: Roy Cornelissen

Session Abstract:

Every conference needs a good mobile app. During this session Roy and Geert will take you through the story of how they’ve built the Techdays 2016 app for iOS, Android and the Windows platform using Xamarin.Forms. They will show you cool stats of the app, it’s architecture, cool features we added and how we added them and lessons learned while building this app.

Slides:

Video: (in Dutch)

 

Next to all the cool sessions and minihacks we’ve delivered at Techdays we also launched a new issue of our magazine “Xpirit Magazine”. this magazine contains a lot of cool technical articles written by my colleagues and me. We handed out the magazine to everyone at Techdays but if you missed it you can still get a free copy (either pdf or FREE hardcopy)  here: xpir.it/magazine-3

XpiritMagazine_cover_large-1 (1)

articles covered:

CONTINUOUS DELIVERY 3.0
■ Continuous Delivery 3.0 – The next ‘next step’
■ Release management, from technical to functional practice
■ Infrastructure as Code
MOBILE
■ Mobile Innovation – Don’t wait for the ‘perfect’ app
■ Exploring the Microsoft Bot Framework
■ Continuous Delivery 3.0 for Mobile apps
ALM
■ Extending your Build and Release pipeline
■ Technical Debt you application Lifecycle
■ Doing testing right
CLOUD
■ Containers on the Microsoft platform: the full picture
■ Conquer the world with Azure Machine Learning
■ How to accelerate your choices using data

 

Hope to see you next year on Techdays. Xpirit will definitely be there!

Geert van der Cruijsen

Please follow and like:
RSS
Follow by Email
Facebook
Google+
https://mobilefirstcloudfirst.net/2016/10/techdays-2016-slides-recap/
LinkedIn
« Older posts