Check! In Serverless framework for Azure, when got an authentication error

Kazumi IWANAGA (OHIRA)
2 min readOct 24, 2019

When I had tried to use Serverless framework to deploy Faas on Azure, I got an error below.

Error

Serverless: Error logging into azure
Error — — — — — — — — — — — — — — — — — — — — — — — — —
Error: Authentication returned an empty list of subscriptions. Try another form of authentication. See the serverless-azure-functions README for more help

The capture of the error
All log of the error

Reason

This error has occurred when the target directory of Azure has no subscription.

As evidence, the subscription array in the authentication cache file ( ~/.azure/slsTokenCache.json ) is empty like below.

Example of ~/.azure/slsTokenCache.json

Solutions

There are two ways.

  1. Remove the cache above and set your available directory as default directory of Azure account available(See below), then try it again.
  2. Use another authentication with using Service Principal
    — See https://github.com/serverless/serverless-azure-functions#advanced-authentication

To set your default directory on Azure portal, see the following steps.

How to set your default directory on Azure portal

Has solved? Enjoy serverless development!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Kazumi IWANAGA (OHIRA)
Kazumi IWANAGA (OHIRA)

Written by Kazumi IWANAGA (OHIRA)

Hello! :) I’m a developer, Microsoft MVP(Azure). My interests: Azure, Serverless, IaC, Container, IoT, and other many exciting things!

No responses yet

Write a response