Microsoft Future Decoded, November 1st 2017, Day 2 – Tech Deep Dives

These are my notes from the day. It’s not a detailed summary of the event, just notes for things I found interesting or want to remember to try out or do.

Expo

Not much that was relevant to us. Mostly vendors helping people migrate to the cloud.

Innvovation Keynote

Focused on Mixed Reality, DNA storage, blockchain in Azure. All very interesting but nothing immediately actionable.

CosmosDB – Global Scale, Multi-Model, Guaranteed Latency

  • We should add some validation onto all the entities we store in CosmosDB that runs before we save/update. Probably using FluentValidation. This should include anything used to generate the ID or the PartitionKey, e.g. OrganisationIdentifier.
  • When we go live, start by over-provisioning RUs and then once we can see our usage through the portal, dial it down.
  • Find out more about the different consistency levels as there could be performance benefits, particularly when importing data. This is configurable per-request.
  • Think about how we want to configure indexing – lazy?
  • We can use Azure Functions with CosmosDB triggers to trigger copying of data to SQL Server
  • Endjin Cloud Adoption Risk Model poster
  • The IndexingPolicy is configurable, we need to work out what we need
  • Even if we’re not partitioning to begin with, we need to set a PartitionKey and make sure it’s a good one
  • Although the SDK will handle and retry errors, e.g. 429 – we need to decide what to do if this still fails. Endjin use a dead letter queue.
  • We could provide a UI for editing RU configuration without needing to re-deploy – though the Azure Portal should be able to handle most requirements for this
  • Look into per minute request units configuration to give some flexibility for bursty traffic
  • Cross partition queries are expensive so avoid using them where possible
  • Sign up for http://azureweekly.info/ a summary of the week’s top news in the Microsoft Azure ecosystem, as well as interesting historic content that’s well worth reading.
  • Since we’re migrating from RavenDB, check for gaps in CosmosDB tooling, e.g. how easy is it to manually edit a single document?
  • Once you select the API for accessing CosmosDB you can’t then use a different API. For example you can’t mix the table storage API with DocumentDB API.
  • Check the current document size limit and make sure none of the data we’re migrating is approaching it
  • Make sure we’re logging the RUs used by all requests. See: Cosmos DB Request Units and the .NET SDK

DevOps: Zero to Hero with Visual Studio Team Services

  • Look at how to use the VSTS Release feature alongside Gitflow/Hubflow. There must be some documentation on it.
  • PowerBI can be hooked up to VSTS so you can generate dashboards and reports from VSTS activity. This could be a good way of getting an overview of all builds/releases. See: https://docs.microsoft.com/en-us/vsts/report/powerbi/

Microsoft SQL – What you need to know for Privacy, Compliance and GDPR

  • Find about the Microsoft Assessment and Planning Toolkit (not relevant to us as designed for cloud migrations)
  • A classification, e.g. “address”, “name”, “email” can be assigned to columns in SQL Server to make it easier to identify personal data
  • Some example code used the FORMSOF function – could be useful one day. See: Querying SQL Server Using Full-Text Search
  • Try out SQL Server Vulnerability Assessment Tools
  • There was an interesting demo of temporal tables showing how it can be used to a) expire data after a specified date b) restore data to a previous version (without doing a full database restore). See: Temporal Tables Temporal tables
  • It was implied that it’s okay to keep backups containing data of individuals that have asked to have their data deleted so long as you also keep a list of these individuals and make sure that after restoring any backups, there’s a process to run through this list and re-delete the data of those individuals.

Empowering Keynote

I didn’t stay for this but the video is available online.

Creating a self signed SSL certificate on Windows using PowerShell

Run this PowerShell command as Administrator:

New-SelfSignedCertificate –DnsName *.local-dev.com –CertStoreLocation cert:\LocalMachine\My

Open Manage Computer Certificates (typing certificates in the Start menu should find it)

Open Personal\Certificates

Find the *.local-dev.com certificate that has an expiration date of a year from today. Delete any others for *.local-dev.com to avoid confusion later on.

Right-click and choose Copy.

Navigate to Trusted Root Certification Authorities\Certificates

Right-click and paste.

Restart your machine.

In IIS, update the bindings for all sites to use the SSL certificate created above, it will be called *.local-dev.com.

Source: https://kx.cloudingenium.com/microsoft/powershell/how-to-create-a-self-signed-san-certificate-on-powershell/

RavenDB: CryptographicException & FormatException: Input string was not in a correct format

If you get an error similar to the below and are using encrypted databases, make sure that you’re running the RavenDB process as the same user you were when the databases were created/encrypted.

The encryption keys are stored in per-user stores by Windows so if you created the database while RavenDB was running as a Windows Service (as LOCAL SYSTEM) and then later run RavenDB directly using Raven.Server.exe it will be running as the logged in user, not LOCAL SYSTEM and won’t have access to the encryption keys.

Raven.Database.Server.Tenancy.AbstractLandlord`1,Warn,,45,Could not unprotect secured db data Raven/Encryption/EncryptIndexes setting the value to '<data could not be decrypted>',"System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.
   at System.Security.Cryptography.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope)
   at Raven.Database.Server.Tenancy.DatabasesLandlord.Unprotect(DatabaseDocument databaseDocument) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\Tenancy\DatabaseLandlord.cs:line 283
Raven.Database.Server.Controllers.RavenDbApiController,Warn,,45,Could not open database named: XXXX Input string was not in a correct format.,"System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at Raven.Database.Config.InMemoryRavenConfiguration.Initialize() in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Config\InMemoryRavenConfiguration.cs:line 339
   at Raven.Database.Server.Tenancy.DatabasesLandlord.CreateConfiguration(String tenantId, DatabaseDocument document, String folderPropName, InMemoryRavenConfiguration parentConfiguration) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\Tenancy\DatabaseLandlord.cs:line 263
   at Raven.Database.Server.Tenancy.DatabasesLandlord.CreateTenantConfiguration(String tenantId, Boolean ignoreDisabledDatabase) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\Tenancy\DatabaseLandlord.cs:line 99
   at Raven.Database.Server.Tenancy.DatabasesLandlord.TryGetOrCreateResourceStore(String tenantId, Task`1& database) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\Tenancy\DatabaseLandlord.cs:line 160
   at Raven.Database.Server.Controllers.RavenDbApiController.TrySetupRequestToProperResource(RequestWebApiEventArgs& args) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\Controllers\RavenDbApiController.cs:line 618

Pukka tea tasting notes

I bought a Pukka teas taster pack a few weeks ago, and kept notes so I could remember which ones I wanted to buy more of. These are my personal tastes and opinions, your results may differ!

star anise & cinnamon – “A velvety swirl of organic star anise, cinnamon & ginger” – Good but not sure I’d want to drink a whole box full, perhaps one for winter.

lively english breakfast – “A perky blend of organic whole leaf tea, ginseng & licorice” – Had this with milk. Quite good but a bit “fruity” for tea with milk. Not one I’ll be buying a box of.

three tulsi – “A sacred organic blend flowering with vibrant clarity” – A bit like Jasmine tea, not bad but a bit flowery for me.

lemon, ginger & manuka honey – “A welcoming cup of spicy-sweet organic bliss” – Very good, a classic. Though the manuka honey is only a flavouring, it doesn’t actually contain any. Not so good if left to go cold.

cool mint green – “An organic spearmint splash into green’s goodness” – Pretty much what it says on the tin – green tea with a hint of mint. A good combo – takes the edge of the green tea bitterness. Might buy this one.

rooibos & honeybush – “A copper red charm of organic earthy delight” – Not much to say really, tastes of rooibos – quite nice but not that keen personally.

lemongrass & ginger – “An uplifting organic lemony zing with a flying finish” – Not bad, hard to describe really – not quite as interesting as it sounds. Not interesting enough to consider buying any more. The lemony-ness is very subtle.

licorice & cinnamon – “A luxuriously sweet organic treasure gilded with golden spice” – You can’t really go wrong with this one – very nice, sweet and warming. Would buy again.

lemon & mandarin with lemon verbena – “An organic citrus sensation to cheer your senses” – Not quite as exciting or fruity as it sounds but a good fruity tea, similar to lemon and ginger I guess.

detox – “A lemony spring of organic aniseed, fennel & cardamom” – Nice and refreshing, light, lemony. Doubt it actually detoxes anything though!

elderberry & echinacea with elderflower – “A rich organic embrace tingling with fruity warmth” – Fruity, nice. Hard to distinguish all the flavours but would buy again.

wild apple & cinnamon with ginger – “A sunlit orchard of organic warmth & sweet spice” – Not bad and quite warming though not sure about the apple.

blackcurrant beauty – “Deliciously deep purple organic fruits to help you glow inside and out” – Blackcurranty, not much more to say.

womankind – “A delicate dance of organic cranberry, rose & sweet vanilla” – I had this in a pink mug to match the packaging. Not bad, lots of ingredients but none of them really stood out. Fairly generic “fruity” tea.

clean green – “A fresh burst of pure organic green tea with a luscious lemony lift” – Basically green tea with a hint of lemon. Pretty good though, takes the bitter edge off. I’d buy this if I wanted a green tea.

vanilla chai – “A caffeine-free organic lift flushed with cinnamon warmth” – Nicer than other chai teas I’ve had – I couldn’t really taste the vanilla but it seemed to work.

relax – “A deeply soothing fusion of organic chamomile, fennel & marshmallow root” – I had this on a stressful day to put it to the test – not sure if it worked or not. It was nice but not memorable – I probably wouldn’t buy this again.

sweet vanilla green – “A seductively sweet organic melody of soothing vanilla and whole leaf green tea” – Good but not that sweet and not much vanilla flavour. Better than plain green tea though.

gorgeous earl grey – “An inspiring infusion of organic whole leaf, bergamot & lavendar” – I’m not a massive earl grey fan but this one seemed pretty good – nice and smooth though I was left with a bitter taste when I’d finished the cup.

three ginger – “A warming swirl of organic ginger, galangal & golden turmeric” – It’s a good ginger tea, but it’s just ginger tea – couldn’t taste the other ingredients.

three licorice – “A sweet song of nourishing organic licorice from Kazakhstan, Pakistan & Egypt” – Very good and strong flavour but I think I still prefer the “peppermint & licorice” tea by Pukka.

cleanse – “A radiant blend of organic nettle, fennel & peppermint” – Hard to decribe, tasted mostly of peppermint but not as strong as a pure peppermint. Nice, but a bit boring.

supreme matcha green – “A vital wellspring of organic whole leaf green tea & the finest matcha” – Much like any other green tea I’ve had – a bit bitter but feels like it’s doing you good. The matcha is only 2% so probably more of a marketing gimmick than anything else.

three fennel – “Soothing organic sweet & wild fennel seeds with fennel leaf” – This smells pretty good and tastes ok too – a bit bland but I like it, I just don’t know why.

chamomile, vanilla & manuka honey – “A soothing dip in an organic pool of calm” – I was so calmed when I drank this that I’ve totally forgotten what it tasted like. It contains manuka honey flavouring, not actual manuka honey which is a bit of a swizz.

three cinnamon – “A sweet embrace of organic Indian, Indonesian & Vietnamese cinnamon” – Very cinnamony for obvious reasons – nice flavour, warming and has the best disclaimer – “Do not drink more than 4 cups a day”

night time – “organic oat flower, lavender & limeflower tea for peaceful sleep” – I had this during the afternoon and didn’t fall asleep (fortunately). It was pretty good, drinkable, hard to describe the flavour though – not as exotic a taste as the description might suggest.

revitalise – “A burst of warming organic cinnamon, cardamom & ginger” – Nice, smooth but not particularly memorable.

after dinner – “A delicious digestif of organic sweet fennel, roasted chicory & caradmom” – I had this mid-afternoon but I think it would go well after a big dinner, especially steak or similar.

serene jasmine green – “A sensual haven of organic green jasmine tea, chamomile & lavender” – Doesn’t taste as fancy or complicated as it sounds but good if you like that kind of flavour – I prefer the sweeter flavours personally.

original chai – “A royal flush of organic cinnamon, cardamom & ginger” – My favourite of the chai teas so far, or perhaps it’s just growing on me. I’d consider buying more of this one.

Running IISRESET from Visual Studio

If you want a quick way of running IISRESET from within Visual Studio:

Tools > External Tools…

clip_image001

Add a new menu item to run C:\Windows\System32\iisreset.exe (note the checkboxes at the bottom)…

clip_image002

You then get a new menu item…

clip_image003

And the output is displayed in the Output panel…

clip_image004

Depending on your UAC settings, you may need to be running Visual Studio as Administrator for this to work.