kubernetes/kops · error

Azure storage account name is required

Error message

Azure storage account name is required

What it means

newAzureClient builds an azblob.Client pointed at https://<accountName>.blob.core.windows.net/. Because the URL and authentication are account-specific, an empty account name is rejected up front with this error before any credential or client construction, and it is surfaced through getAzureBlobClient.

Source

Thrown at util/pkg/vfs/azureclient.go:29

distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package vfs

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
)

func newAzureClient(ctx context.Context, accountName string) (*azblob.Client, error) {
	if accountName == "" {
		return nil, fmt.Errorf("Azure storage account name is required")
	}

	url := fmt.Sprintf("https://%s.blob.core.windows.net/", accountName)

	credential, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		return nil, err
	}

	client, err := azblob.NewClient(url, credential, nil)
	if err != nil {
		return nil, err
	}

	return client, nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Configure the Azure storage account name in the kops cluster spec (Cluster.Spec.ConfigStore / azure configuration)
  2. Set AZURE_STORAGE_ACCOUNT in the environment if the account is sourced from env
  3. Check the code path that derives accountName and fix empty/missing config resolution
  4. Re-run the kops command after the account name is populated

Example fix

// before
client, err := getAzureBlobClient(ctx, os.Getenv("AZURE_STORAGE_ACCOUNT"))

// after
account := os.Getenv("AZURE_STORAGE_ACCOUNT")
if account == "" {
	return nil, fmt.Errorf("AZURE_STORAGE_ACCOUNT env var must be set to use Azure VFS")
}
client, err := getAzureBlobClient(ctx, account)
Defensive patterns

Strategy: validation

Validate before calling

account := os.Getenv("AZURE_STORAGE_ACCOUNT")
if account == "" {
	return nil, fmt.Errorf("Azure storage account name is required: set AZURE_STORAGE_ACCOUNT or configure it in the cluster spec")
}

Try / catch

client, err := getAzureBlobClient(ctx, accountName)
if err != nil {
	if strings.Contains(err.Error(), "account name is required") {
		return nil, fmt.Errorf("Azure VFS not configured: missing storage account name: %w", err)
	}
	return nil, err
}

Prevention

When it happens

Trigger: getAzureBlobClient (or any caller of newAzureClient) invoked with an empty accountName string — typically when the storage account was never configured in the kops cluster spec or the Azure cloud discovery returned no account.

Common situations: Running kops against an Azure cluster whose Azure storage account config is missing/empty; env vars like AZURE_STORAGE_ACCOUNT unset when constructing a VFS client manually; misparsed Azure config where the account field defaults to "".

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/28e704d3c0ddbb30. Report an issue: GitHub.