Categories
Azure DevOps Cloud

How to fix Azure MissingSubscriptionRegistration error

Are you trying to deploy an Azure Resource Manager (ARM) template and getting the error MissingSubscriptionRegistration? In this article we’ll take a look at what the cause of the error is, and how you can easily rectify the problem.

Sometimes when trying to run an ARM template in a new subscription to create Azure resources, customers come across the following error:

MissingSubscriptionRegistration: The subscription is not registered to use namespace 'Microsoft.Web'

The namespace may be different depending on the resources you’re trying to create – but effectively this error is telling you that for your subscription, you cannot create resources belonging to the aforementioned namespace. In the case of this example, that’s Microsoft.Web – specifically an App Service.

By default, a new subscription will have most resource providers disabled as a precautionary security measure. You can see a full list of default enabled providers here.

By having most providers disabled, compromised accounts are unable to create a raft of resources. Therefore it’s critical that you only enable namespaces you need to use.

Normally deploying an ARM template should automatically enable the resource namespace – but sometimes it doesn’t work as expected. Similarly, creating a resource manually in the Azure portal should also automatically enable the resource namespace.

Fixing this error is quite straightforward, assuming you have owner or contributor access to the subscription. If you don’t, you’ll need to get your IT administrator to make these changes on your behalf.

Open the Azure Portal, navigate to Subscriptions and choose the subscription you’re trying to deploy the ARM template into. Then, go to Resource providers in the sidebar.

Now scroll through the list of all resource providers until you see the one mentioned in the error message you received. Click the namespace to highlight it, and then choose Register from the menu bar.

This will now activate the namespace, allowing you to create resources that reside within it and thereby the error will be resolved.

Note however that the namespace may not be activated immediately – you may need to wait up to 15 minutes before running the ARM template deployment again.

The registering status shows in the portal while the namespace is being activated – so a quick refresh of the page will allow you to see when the work is completed.

Categories
.NET Core

Get started with ABP framework on a Mac

In this post we’ll explore setting up the popular ABP framework for .NET Core on a Mac with a Postgres database.

In case you’re unaware, the ABP framework offers a number of out of the box features that can save a tremendous amount of time when starting a new web application. This includes a strong and opinionated architecture based on domain driven design, as well as multi-tenancy, theming and more.

Getting your environment setup

In this post we’ll explore getting the basic ABP app with Blazor up and running on a Mac.

Firstly, if you haven’t already done so download and install the latest .NET Core 5 SDK from Microsoft’s site.

Once installed you’ll want to add the ABP command line tools. These will allow you to quickly scaffold projects and code. This can be installed by opening the Terminal.app on your Mac, and running this line of code:

dotnet tool install -g Volo.Abp.Cli

If you’re running a more recent version of macOS – such as Big Sur – you’ll now be using ZSH by default instead of Bash in the Terminal app.

Try running the command abp --help. If you get a message stating that abp is not a known command, you may need to create a .zshrc file to allow you to access the ABP CLI from ZSH. Within Terminal, run the following commands:

  1. vi ~/.zshrc
  2. Paste export PATH=$HOME/.dotnet/tools:$PATH
  3. Run the command :wq to write the file to disk and quit
  4. Restart Terminal.app and you should be able to run abp --help

Creating the ABP project

Create a new folder called ToDoProject. Navigate to it from within Terminal, and run the following command:

abp new TodoApp -u blazor-server

This creates a new .NET Core solution based on the ABP framework.

If you’re on a Windows machine, normally you would now run the DbMigrator project to setup your database tables. However by default the ABP project uses LocalDB which is unavailable on the Mac.

As an alternative, you can use Postgres which IS available for the Mac.

The easiest way to install Postgres is to download and install the Postgres.app for free. Once launched, you can then install an app like Postico or use the command line to create a new Postgres database.

If using Postico, connect to your localhost Postgres server either via the server settings within Postico, or by double clicking the server from within the Postgres app.

Then, navigate to your server within Postico by clicking localhost in the top navigation bar. Click “+ Database” and add a new database called todoapp.

Click these buttons to setup the new database

Now we need to make some changes to the sample ABP app. Open the TodoApp.sln in your editor of choice (for the Mac this can include Visual Studio for Mac, Visual Studio Code or Rider).

Next replace the SQL package with Postgres. Add the Volo.Abp.EntityFrameworkCore.PostgreSql package via Nuget, and remove Volo.Abp.EntityFrameworkCore.SqlServer.

Then follow the rest of the steps in this article to update your project files to use the new Postgres package.

Lastly you’ll need to update the connection strings for your database.

Open src/TodoApp.Blazor/appsettings.json and update the following line to connect to your Postgres database, updating `<your username>` with your database username (for a Mac this is normally your Mac login username, unless you’ve specified a new user):

"ConnectionStrings": {
  "Default": "Server=localhost;Port=5432;Database=todoapp;User Id=<your username>/;Password="
}

Similarly, open src/TodoApp.DbMigrator/appsettings.json and update the same connection string:

"ConnectionStrings": {
  "Default": "Server=localhost;Port=5432;Database=todoapp;User Id=<your username>/;Password="
}

From within your IDE you should now be able to build and run your app, or from the Terminal app run dotnet run to see your first ABP web app running!

Categories
Microsoft Graph

How to export Microsoft Teams chats

Looking to export chats within Microsoft Teams? Exporting chats from Teams is an oft-requested feature, but at the moment there’s no out of the box functionality available for end users.

If you’re an end user

If you don’t have admin rights, at present your options are limited for exporting chats from Teams especially while using a work Office 365 account.

If you’re using a personal Microsoft account with Teams, you may be able to export your messages following the steps listed here.

For work accounts, one option is to setup a workflow using Microsoft Flow to call the Microsoft Graph API and convert individual chats to HTML or a PDF file.

An alternative is to call the Graph API endpoints to retrieve messages and conversations yourself as part of your own script/program, although that has a higher degree of complexity when compared to using a tool such as Microsoft Flow. These endpoints are also in beta.

If you’re an admin

The options are still quite limited, but you can try and use the eDiscovery tools available in Office 365 to retrieve messages from channels.

Categories
Cloud

Integrating Gumroad and WordPress

Gumroad is one of the hottest new ways for creatives to sell their products and services online. And with WordPress being one of the most popular content management systems in the world right now, in this post we’ll explore how you can connect both systems together to offer paid products and services from your WordPress blog.

There are 3 ways in which you can connect Gumroad with your WordPress site:

  • Via the free, official Gumroad plugin
  • Using the HTML embed codes
  • Via a paid third-party WordPress plugin

Free, official Gumroad plugin

Free (WordPress Plugin Marketplace)

This is the easiest free way to connect Gumroad and your website. You simply install the free Gumroad plugin from the Plugins section of your WordPress administration site.

The plugin adds a Gutenberg block that can be used within your content.

Unfortunately that’s about as advanced as you can get when using the official plugin. There’s no support for syncing paying customers between Gumroad and WordPress for sites such as online courses or membership areas. For that you’ll need to use a third-party plugin.

HTML embed codes

Gumroad provides HTML code that you can manually insert on your product pages within WordPress.

You can choose from an overlay, where a customer performs the entire flow from within a modal window on your site or an embed which can redirect customers to the Gumroad site to complete the transaction.

To generate the code, simply open your product within the Gumroad website, click “Share” and copy and paste the code from either “Overlay” or “Embed” into your WordPress post.

3rd-party WordPress plugin

If you’re looking for something more advanced – perhaps to restrict your content & blog posts to paying customers – then you may want to turn to a premium third-party WordPress plugin.

ProductPress (paid, pricing starting at $39) is one of the more established products in this space, allowing you to setup sites for things like online courses and membership sites.

These plugins rely on the Gumroad API to integrate deeper into your WordPress installation – so make sure if you are using a third-party plugin that it’s legitimate and not going to compromise your customer data or Gumroad account.

Categories
Azure Azure DevOps

Getting started with Azure Bicep

Bicep is a new language from Microsoft that allows you to easily specify your Azure infrastructure as code.

It’s an improvement on writing Azure Resource Manager (ARM) templates directly by better supporting features such as type safety and code modularity and reuse.

That said, Bicep still has a very close relationship with ARM templates. In fact, it’s an abstraction over ARM templates with templates written using Bicep able to be transpiled back to ARM templates. And if you have a bunch of existing ARM templates, they can be transpiled and converted into Bicep files.

Let’s now take a look at how you can get started using Bicep.

Preparing your environment

There’s a few things you’ll want to install in order to start using Bicep.

First you’ll want to download Visual Studio Code (free) and install the Bicep extension (also free). This will give you an editor in which to write your Bicep files, and the extension adds handy features such as Intellisense code suggestions and template validation to ensure the correct syntax.

You’ll also need to install the Bicep command line interface (CLI). The easiest, cross-platform way to do this is by installing the Azure command line interface. But if you’re after an alternative, see this list.

Become a Bicep guru

Dive deeper into Bicep with our getting started with Bicep course on Udemy today!

Writing your first Bicep file

Open Visual Studio Code, and create a new file called HelloWorld.bicep. In it, paste the following code:

resource appConfig 'Microsoft.AppConfiguration/[email protected]' = {
  name: 'bicepDemoAppConfig'
  location: 'westus2'
  sku: {
    name: 'standard'
  }
}

In this template, we’re creating an App Configuration service in Azure. Lets breakdown the template:

appConfig provides a local resource name for use within the template if you need to refer to this resource as a dependency, or from within another resource.

Microsoft.AppConfiguration/[email protected] refers to the resource type and the values that can be configured. See this Microsoft documentation for a full list of resource types.

As such, name, location and sku are all values that can be set for the resource type.

Next steps

To learn how to deploy this template, or to find out about more advanced Bicep topics including for loops, conditional statements and modularised templates check out our Udemy course on getting started with Bicep.

Categories
Cloud

Setting Digital Ocean environment variables

Are you trying to work out how to setup environment variables for your Digital Ocean droplet or app running on the app platform? Here’s how.

Digital Ocean droplet environment variables

Setting an environment variable for a droplet is a little more complicated than for an app running on the app platform.

Follow these steps to set environment variables on a Linux droplet:

  1. SSH into your droplet. If you’re not sure how to do that, see here
  2. Once connected, run the following command to set your environment variable:
export YOUR_VARIABLE_KEY=<your-variable-value>

App platform environment variables

To set environment variables for an app running on Digital Ocean’s app platform, follow these steps:

  1. Login to the Digital Ocean portal
  2. Open your app
  3. Click the “Settings” tab
  4. Scroll down until you see “App-Level Environment Variables”
  5. Click “Edit” and add the environment variable key and value
  6. Click “Save”

Your environment variable will now be available for your app.

Categories
Azure

How to create an Azure app service with a database

Need to deploy your app to an Azure app service, and rely on a database such as Postgres or Azure SQL?

Microsoft is now previewing a new blade in the Azure portal that lets you quickly spin up an Azure app service with an associated database.

Supported database engines for the preview are Postgres or serverless Azure SQL server.

To get started using the new blade, click here or search the Azure Marketplace for “web app database”.

The blade – currently in preview – is fairly basic compared to the normal app service blade, but allows you to specify the app name, runtime and database engine. You can also set the server name and database name.

By default it’ll spin up an app service using the Premium V2 tier, but you can scale this down (or up if required) once the service is created using the regular Azure scale up settings.

The database connection information will automatically be set as environment variables for your app service.

Categories
Google Tables

How to use Google Tables outside the US

Google recently launched a new product called Tables – a lightweight database similar to the likes of Airtable.

However being in beta, and launched by Google’s incubator Area 120, it’s only officially available in the United States for now.

But if you’re outside the US, at least for now you can still access Tables using the following method. Note that the usual caveats apply, in that Google may block this at any time and your success may vary.

  1. Sign up for a free trial of a VPN with a United States point of presence, such as encrypt.me
  2. Configure your computer/Mac/phone to use the VPN. Normally that involves downloading an app provided by your VPN provider.
  3. Enable the VPN, and open the Google Tables site. Click “Get started” in the top right-hand corner to login.
  4. You should get prompted to sign in with your Google Account. Enter your Google credentials, and as long as your VPN is active you should be able to login and start using Tables.
  5. If you’re not able to login still, make sure your VPN is located in the United States. To configure this in encrypt.me, go to Preferences > Transporter > North America > United States and choose a location.
Categories
Google Tables

Meet Google Tables – Google’s Airtable competitor

Google – through its incubator Area 120 – recently announced its own Airtable competitor, Tables. In this post we’ll take a look at how you can get started with Tables.

Meet Google Tables

What is Google Tables?

Think of Tables as a lightweight spreadsheet, similar to Microsoft Access database, or a competitor to Airtable. Using bots, you can create automations that do everything from emailing people when rows are added or changed, to modifying other rows or posting to a webhook.

Google Tables beta, available now in the United States.

Is Tables free?

Yes, there’s a free plan available. However it limits the number of rows you can have in a table to 1000, and you can only have 100 tables in total.

The paid plan ups that to 10,000 rows across 1000 tables, as well as providing more generous attachment sizes and actions.

Why use Tables instead of Google Sheets?

At this point Sheets are far more advanced than Tables. If you’re after functionality like formulas, you’ll want to stick to Sheets.

Tables really shines for lightweight data, like form responses and datasets that you might otherwise look to store in a database.

Be sure to check out Tables pricing too, as Sheets might be able to meet your needs for free.

Also note that Tables is still a part of Google’s incubator Area 120. As such it’s essentially still classified an experiment unlike Sheets, which is a fully-fledged Google product. This means there is no guarantee of Tables continued availability – particularly given Google’s history of losing interest in its experiments.

What other features does Tables have?

Tables allow you to create forms to allow anyone to input data into your tables. The form title, description and submission message can be customised, as can the layout of fields on the page. Each field maps to a field in your table, and can be hidden or marked as required.

The other powerful feature of Tables is automations via Bots. Bots allow you to perform various actions based on a set list of triggers, which include insertion or deletion of rows, column value changes, and cron or time-based.

What’s the difference between a workspace and a table?

A workspace is a collection of tables. Each table stores a particular set of data, organised into columns and rows. Workspaces can be shared with other people.

Where is Tables available?

Officially at the moment only those located in the United States can use Tables. But if you’re still keen to try it out, follow these steps to get access from anywhere.

Categories
Microsoft Teams

Microsoft Teams training resources

So your team is looking to start using Microsoft Teams as a form of internal communication? We’ve compiled a list of the best Microsoft Teams training resources for getting everyone up to speed about how to make the most out of the service.

While this list is far from conclusive, many of the resources below cover end-user and admin training, while some are more targeted to one scenario or the other.

Microsoft training

Free, Microsoft Training

If you’re looking for the best free training, it’s hard to go past Microsoft’s official training resources. Microsoft has created training for admins and end-users.

And if reading guides isn’t your thing, they even run free instructor-led sessions that anyone can sign up for, and run on a frequent basis.

Microsoft Teams essential training

Paid, LinkedIn Learning

One of the most-watched Microsoft Teams courses on LinkedIn Learning, this course will run you through the basics of setting up a Microsoft Teams workspace.

It then dives into incorporating the best of Teams functionality into your team’s workflow. A quiz at the end of each chapter helps recap what you just learnt.

Mastering Microsoft Teams Training

Paid, Udemy

While this training was recorded last year, the majority of the content remains relevant when using Microsoft Teams. Heavily focused on end-user functionality, this course won’t satisfy those looking for admin tips.

The course has some good content, and can be had at a more affordable price than the LinkedIn Learning course.

Adopt & Embrace Microsoft Teams

Paid, Amazon

If a book is more your thing, and you’re after a book that covers integrating Microsoft Teams within your team’s workflow then Adopt & Embrace Microsoft Teams is a solid buy.

The book covers integrating Microsoft Teams from a manager’s perspective, and includes chapters on getting to know Teams, through to some principles and best practices.