<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: azure</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/azure.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2021-03-28T05:19:57+00:00</updated><author><name>Simon Willison</name></author><entry><title>Weeknotes: SpatiaLite 5, Datasette on Azure, more CDC vaccination history</title><link href="https://simonwillison.net/2021/Mar/28/weeknotes/#atom-tag" rel="alternate"/><published>2021-03-28T05:19:57+00:00</published><updated>2021-03-28T05:19:57+00:00</updated><id>https://simonwillison.net/2021/Mar/28/weeknotes/#atom-tag</id><summary type="html">
    &lt;p&gt;This week I got SpatiaLite 5 working in the Datasette Docker image, improved the CDC vaccination history git scraper, figured out Datasette on Azure and we closed on a new home!&lt;/p&gt;

&lt;h4 id="spatialite-5-datasette"&gt;SpatiaLite 5 for Datasette&lt;/h4&gt;
&lt;p&gt;&lt;a href="https://www.gaia-gis.it/fossil/libspatialite/wiki?name=5.0.0-doc"&gt;SpatiaLite 5&lt;/a&gt; came out earlier this year with a bunch of exciting improvements, most notably an implementation of &lt;a href="https://www.gaia-gis.it/fossil/libspatialite/wiki?name=KNN"&gt;KNN&lt;/a&gt; (K-nearest neighbours) - a way to efficiently answer the question "what are the 10 closest rows to this latitude/longitude point".&lt;/p&gt;
&lt;p&gt;I love building &lt;a href="https://www.owlsnearme.com/"&gt;X near me&lt;/a&gt; websites so I expect I'll be using this a &lt;em&gt;lot&lt;/em&gt; in the future.&lt;/p&gt;
&lt;p&gt;I spent a bunch of time this week figuring out how best to install it into a Docker container for use with Datasette. I finally cracked it in &lt;a href="https://github.com/simonw/datasette/issues/1249"&gt;issue 1249&lt;/a&gt; and the &lt;a href="https://github.com/simonw/datasette/blob/3fcfc8513465339ac5f055296cbb67f5262af02b/Dockerfile"&gt;Dockerfile&lt;/a&gt; in the Datasette repository now builds with the SpatiaLite 5.0 extension, using a pattern &lt;a href="https://til.simonwillison.net/docker/debian-unstable-packages"&gt;I figured out&lt;/a&gt; for installing Debian unstable packages into a Debian stable base container.&lt;/p&gt;
&lt;p&gt;When Datasette 0.56 is released the official Datasette Docker image will bundle SpatiaLite 5.0.&lt;/p&gt;
&lt;h4 id="cdc-vaccination-datasette"&gt;CDC vaccination history in Datasette&lt;/h4&gt;
&lt;p&gt;I'm tracking the CDC's per-state vaccination numbers in my &lt;a href="https://github.com/simonw/cdc-vaccination-history"&gt;cdc-vaccination-history&lt;/a&gt; repository, as described in my &lt;a href="https://simonwillison.net/2021/Mar/5/git-scraping/"&gt;Git scraping lightning talk&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Scraping data into a git repository to track changes to it over time is easy. What's harder is extracting that data back out of the commit history in order to analyze and visualize it later.&lt;/p&gt;
&lt;p&gt;To demonstrate how this can work I added a &lt;a href="https://github.com/simonw/cdc-vaccination-history/blob/1fd1003f34ec512cf0b89c68fe609e130c7fe3f1/build_database.py"&gt;build_database.py&lt;/a&gt; script to that repository which iterates through the git history and uses it to build a SQLite database containing daily state reports. I also added &lt;a href="https://github.com/simonw/cdc-vaccination-history/blob/1fd1003f34ec512cf0b89c68fe609e130c7fe3f1/.github/workflows/scrape.yml#L29-L57"&gt;steps to the GitHub Actions workflow&lt;/a&gt; to publish that SQLite database using Datasette and Vercel.&lt;/p&gt;
&lt;p&gt;I installed the &lt;a href="https://datasette.io/plugins/datasette-vega"&gt;datasette-vega&lt;/a&gt; visualization plugin there too. Here's &lt;a href="https://cdc-vaccination-history.datasette.io/cdc/daily_reports?_sort=id&amp;amp;Location__exact=CA#g.mark=bar&amp;amp;g.x_column=Date&amp;amp;g.x_type=temporal&amp;amp;g.y_column=Doses_Administered&amp;amp;g.y_type=quantitative"&gt;a chart&lt;/a&gt; showing the number of doses administered over time in California.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Chart of vaccines distributed in California, which is going up at a healthy pace" src="https://static.simonwillison.net/static/2021/cdc-vaccines-california.png" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;This morning I &lt;a href="https://github.com/simonw/cdc-vaccination-history/commit/1b274d3aab5cc58ae6c79411dbc15d28d8bd0c8b#diff-87ee5504a3e25ac558b343724c905f2f7949e8cec3d92b9c4300bb922afa164f"&gt;started capturing&lt;/a&gt; the CDC's per-county data too, but I've not yet written code to load that into Datasette. [UPDATE: that table is now available: &lt;a href="https://cdc-vaccination-history.datasette.io/cdc/daily_reports_counties"&gt;cdc/daily_reports_counties&lt;/a&gt;]&lt;/p&gt;
&lt;h4&gt;Datasette on Azure&lt;/h4&gt;
&lt;p&gt;I'm keen to make Datasette easy to deploy in as many places as possible. I already have mechanisms for publishing to Heroku, Cloud Run, Vercel and Fly.io - today I worked out the recipe needed for &lt;a href="https://docs.microsoft.com/en-us/azure/azure-functions/"&gt;Azure Functions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I haven't bundled it into a &lt;code&gt;datasette-publish-azure&lt;/code&gt; plugin yet but that's the next step. In the meantime the &lt;a href="https://github.com/simonw/azure-functions-datasette"&gt;azure-functions-datasette&lt;/a&gt; repo has a working example with instructions on how to deploy it.&lt;/p&gt;
&lt;p&gt;Thanks go to Anthony Shaw for &lt;a href="https://github.com/Azure/azure-functions-python-library/issues/75#issuecomment-808553496"&gt;building out the ASGI wrapper&lt;/a&gt; needed to run ASGI applications like Datasette on Azure Functions.&lt;/p&gt;
&lt;h4&gt;iam-to-sqlite&lt;/h4&gt;
&lt;p&gt;I spend way too much time &lt;a href="https://twitter.com/search?q=from%3Asimonw%20iam&amp;amp;src=typed_query"&gt;whinging about IAM&lt;/a&gt; on Twitter. I'm certain that properly learning IAM will unlock the entire world of AWS, but I have so far been unable to overcome my discomfort with it long enough to actually figure it out.&lt;/p&gt;
&lt;p&gt;After &lt;a href="https://twitter.com/simonw/status/1374494730088706058"&gt;yet another unproductive whinge&lt;/a&gt; this week I guilted myself into putting in some effort, and it's already started to pay off: I figured out how to dump out all existing IAM data (users, groups, roles and policies) as JSON using the &lt;code&gt;aws  iam get-account-authorization-details&lt;/code&gt; command, and got so excited about it that I built &lt;a href="https://github.com/simonw/iam-to-sqlite"&gt;iam-to-sqlite&lt;/a&gt; as a wrapper around that command that writes the results into SQLite so I can browse them using Datasette!&lt;/p&gt;
&lt;p&gt;&lt;img alt="Datasette showing IAM database tables" src="https://static.simonwillison.net/static/2021/iam-to-sqlite.jpg" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;p&gt;I'm increasingly realizing that the key to me understanding how pretty much any service works is to pull their JSON into a SQLite database so I can explore it as relational tables.&lt;/p&gt;
&lt;h4&gt;A useful trick for writing weeknotes&lt;/h4&gt;
&lt;p&gt;When writing weeknotes like these, it's really useful to be able to see all of the commits from the past week across many different projects.&lt;/p&gt;
&lt;p&gt;Today I realized you can use GitHub search for this. Run a search for &lt;code&gt;author:simonw created:&amp;gt;2021-03-20&lt;/code&gt; and filter to commits, ordered by "Recently committed".&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/search?l=&amp;amp;o=desc&amp;amp;q=author%3Asimonw+created%3A%3E2021-03-20&amp;amp;s=committer-date&amp;amp;type=Commits"&gt;Here's that search for me&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;Django pull request accepted!&lt;/h4&gt;
&lt;p&gt;I had &lt;a href="https://github.com/django/django/pull/14171"&gt;a pull request&lt;/a&gt; accepted to Django this week! It was a documentation fix for the &lt;a href="https://docs.djangoproject.com/en/dev/ref/models/expressions/#django.db.models.expressions.RawSQL"&gt;RawSQL query expression&lt;/a&gt; - I found a pattern for using it as part of an &lt;code&gt;.filter(id__in=RawSQL(...))&lt;/code&gt; query that wasn't covered by the documentation.&lt;/p&gt;
&lt;h4&gt;And we found a new home&lt;/h4&gt;
&lt;p&gt;One other project this week: Natalie and I closed on a new home! We're moving to El Granada, a tiny town just north of Half Moon Bay, on the coast 40 minutes south of San Francisco. We'll be ten minutes from the ocean, with plenty of &lt;a href="https://pinnipeds-near-me.now.sh/"&gt;pinnipeds&lt;/a&gt; and &lt;a href="https://simonwillison.net/2020/May/21/dogsheep-photos/"&gt;pelicans&lt;/a&gt;. Exciting!&lt;/p&gt;
&lt;p&gt;&lt;img alt="Cleo asleep on the deck with the Pacific ocean in the distance" src="https://static.simonwillison.net/static/2021/new-house-cleo.jpg" style="max-width:100%;" /&gt;&lt;/p&gt;
&lt;h4&gt;TIL this week&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/docker/gdb-python-docker"&gt;Running gdb against a Python process in a running Docker container&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/python/tracing-every-statement"&gt;Tracing every executed Python statement&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/docker/debian-unstable-packages"&gt;Installing packages from Debian unstable in a Docker image based on stable&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/postgresql/closest-locations-to-a-point"&gt;Closest locations to a point&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/zeit-now/redirecting-all-paths-on-vercel"&gt;Redirecting all paths on a Vercel instance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://til.simonwillison.net/azure/all-traffic-to-subdomain"&gt;Writing an Azure Function that serves all traffic to a subdomain&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Releases this week&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/datasette-publish-vercel"&gt;datasette-publish-vercel&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/datasette-publish-vercel/releases/tag/0.9.3"&gt;0.9.3&lt;/a&gt; - (&lt;a href="https://github.com/simonw/datasette-publish-vercel/releases"&gt;15 releases total&lt;/a&gt;) - 2021-03-26
&lt;br /&gt;Datasette plugin for publishing data using Vercel&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/sqlite-transform"&gt;sqlite-transform&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/sqlite-transform/releases/tag/0.5"&gt;0.5&lt;/a&gt; - (&lt;a href="https://github.com/simonw/sqlite-transform/releases"&gt;6 releases total&lt;/a&gt;) - 2021-03-24
&lt;br /&gt;Tool for running transformations on columns in a SQLite database&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/django-sql-dashboard"&gt;django-sql-dashboard&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/django-sql-dashboard/releases/tag/0.5a0"&gt;0.5a0&lt;/a&gt; - (&lt;a href="https://github.com/simonw/django-sql-dashboard/releases"&gt;12 releases total&lt;/a&gt;) - 2021-03-24
&lt;br /&gt;Django app for building dashboards using raw SQL queries&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/iam-to-sqlite"&gt;iam-to-sqlite&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/iam-to-sqlite/releases/tag/0.1"&gt;0.1&lt;/a&gt; - 2021-03-24
&lt;br /&gt;Load Amazon IAM data into a SQLite database&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/tableau-to-sqlite"&gt;tableau-to-sqlite&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/tableau-to-sqlite/releases/tag/0.2.1"&gt;0.2.1&lt;/a&gt; - (&lt;a href="https://github.com/simonw/tableau-to-sqlite/releases"&gt;4 releases total&lt;/a&gt;) - 2021-03-22
&lt;br /&gt;Fetch data from Tableau into a SQLite database&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/c64"&gt;c64&lt;/a&gt;&lt;/strong&gt;: &lt;a href="https://github.com/simonw/c64/releases/tag/0.1a0"&gt;0.1a0&lt;/a&gt; - 2021-03-21
&lt;br /&gt;Experimental package of ASGI utilities extracted from Datasette&lt;/li&gt;
&lt;/ul&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/aws"&gt;aws&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/azure"&gt;azure&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/datasette"&gt;datasette&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/weeknotes"&gt;weeknotes&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/git-scraping"&gt;git-scraping&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="aws"/><category term="azure"/><category term="datasette"/><category term="weeknotes"/><category term="git-scraping"/></entry><entry><title>Azure Readiness Checklist</title><link href="https://simonwillison.net/2019/Oct/26/azure-readiness-checklist/#atom-tag" rel="alternate"/><published>2019-10-26T20:32:46+00:00</published><updated>2019-10-26T20:32:46+00:00</updated><id>https://simonwillison.net/2019/Oct/26/azure-readiness-checklist/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/ghostinthewires/Azure-Readiness-Checklist/blob/master/README.md"&gt;Azure Readiness Checklist&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
I love a good comprehensive checklist. This one is focused on large projects running on Azure but it’s still fun to browse through if you are hosting elsewhere, mainly as a reminder of quite how much still goes into deploying large web services into production.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/mipsytipsy/status/1187930078098808832"&gt;Charity Majors&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/azure"&gt;azure&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/checklists"&gt;checklists&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/deployment"&gt;deployment&lt;/a&gt;&lt;/p&gt;



</summary><category term="azure"/><category term="checklists"/><category term="deployment"/></entry><entry><title>Cloud-first: Rapid webapp deployment using containers</title><link href="https://simonwillison.net/2018/Mar/28/webapp-deployment-using-containers/#atom-tag" rel="alternate"/><published>2018-03-28T15:50:36+00:00</published><updated>2018-03-28T15:50:36+00:00</updated><id>https://simonwillison.net/2018/Mar/28/webapp-deployment-using-containers/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://wwwf.imperial.ac.uk/blog/research-software-engineering/2018/03/27/cloud-first-rapid-webapp-deployment-using-containers/"&gt;Cloud-first: Rapid webapp deployment using containers&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
The Research Software Engineering group at ICL have written a tutorial on deploying web apps as Docker containers using Azure and they use Datasette as the example application.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/imperialrse/status/978900269667901441"&gt;@ImperialRSE&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/azure"&gt;azure&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/docker"&gt;docker&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/datasette"&gt;datasette&lt;/a&gt;&lt;/p&gt;



</summary><category term="azure"/><category term="docker"/><category term="datasette"/></entry><entry><title>Popfly Shutting Down</title><link href="https://simonwillison.net/2009/Jul/17/popfly/#atom-tag" rel="alternate"/><published>2009-07-17T09:32:46+00:00</published><updated>2009-07-17T09:32:46+00:00</updated><id>https://simonwillison.net/2009/Jul/17/popfly/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://popflyteam.spaces.live.com/blog/cns!51018025071FD37F!336.entry"&gt;Popfly Shutting Down&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Yet another reminder that building stuff on a closed-source platform (especially a hosted service) is risky business, even from a vendor as large as Microsoft. This certainly won’t help them make the case for Azure.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/azure"&gt;azure&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/closedsource"&gt;closedsource&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/microsoft"&gt;microsoft&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/open-source"&gt;open-source&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/popfly"&gt;popfly&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sharecropping"&gt;sharecropping&lt;/a&gt;&lt;/p&gt;



</summary><category term="azure"/><category term="closedsource"/><category term="microsoft"/><category term="open-source"/><category term="popfly"/><category term="sharecropping"/></entry></feed>