kubernetes/kops · error

expected azureblob:// ConfigStore.Base for Azure cluster, go

Error message

expected azureblob:// ConfigStore.Base for Azure cluster, got %q

What it means

azureStorageAccountFromConfigStore resolves the Azure storage account name backing the cluster's state store. It builds a VFS path from ConfigStore.Base and requires it to be an *vfs.AzureBlobPath; anything else (s3, gs, file, memfs) means the state store is not Azure blob storage, so the Azure account name cannot be derived and the cluster creation aborts.

Source

Thrown at upup/pkg/fi/cloudup/defaults.go:181

		c.Spec.CloudProvider.Azure.StorageAccountID = *sa.ID
	}

	return ensureKubernetesVersion(vfsContext, c)
}

// azureStorageAccountFromConfigStore extracts the Azure storage account
// from an azureblob:// ConfigStore.Base.
func azureStorageAccountFromConfigStore(vfsContext *vfs.VFSContext, configBase string) (string, error) {
	if configBase == "" {
		return "", fmt.Errorf("ConfigStore.Base is not set; cannot determine Azure storage account")
	}
	p, err := vfsContext.BuildVfsPath(configBase)
	if err != nil {
		return "", fmt.Errorf("parsing ConfigStore.Base %q: %w", configBase, err)
	}
	azurePath, ok := p.(*vfs.AzureBlobPath)
	if !ok {
		return "", fmt.Errorf("expected azureblob:// ConfigStore.Base for Azure cluster, got %q", configBase)
	}
	return azurePath.Account(), nil
}

// ensureKubernetesVersion populates KubernetesVersion, if it is not already set
// It will be populated with the latest stable kubernetes version, or the version from the channel
func ensureKubernetesVersion(vfsContext *vfs.VFSContext, c *kops.Cluster) error {
	if c.Spec.KubernetesVersion == "" {
		if c.Spec.Channel != "" {
			channel, err := kops.LoadChannel(vfsContext, c.Spec.Channel)
			if err != nil {
				return err
			}
			kubernetesVersion := kops.RecommendedKubernetesVersion(channel, kopsversion.Version)
			if kubernetesVersion != nil {
				c.Spec.KubernetesVersion = kubernetesVersion.String()
				klog.Infof("Using KubernetesVersion %q from channel %q", c.Spec.KubernetesVersion, c.Spec.Channel)
			} else {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Set the state store to an Azure Blob Storage URL, e.g. kops create cluster --state azureblob://<storage-account-name> ...
  2. Verify KOPS_STATE_STORE env var is azureblob://... for Azure clusters, not s3:// or gs://
  3. Export the cluster config and correct cluster.spec.configBase, then update the cluster
  4. If testing locally, create a local Azure storage emulator path or use a cloud matching your state store

Example fix

// before
kops create cluster --cloud azure --state s3://my-kops-state ...  # error
// after
kops create cluster --cloud azure --state azureblob://mystorageaccount ...
Defensive patterns

Strategy: validation

Validate before calling

if !strings.HasPrefix(configBase, "azureblob://") {
    return fmt.Errorf("Azure cluster requires azureblob:// state store, got %q", configBase)
}

Type guard

func isAzureBlobPath(p vfs.VFSPath) (*vfs.AzureBlobPath, bool) {
    ap, ok := p.(*vfs.AzureBlobPath)
    return ap, ok
}

Prevention

When it happens

Trigger: Running `kops create cluster` with cloud=azure but a ConfigStore.Base (state store) that is not an azureblob:// URL, e.g. --state=s3://bucket or the default file store; also calling PerformAssignments with a configBase pointing at a non-Azure VFS path.

Common situations: Copying an AWS/GCP cluster config and switching the cloud to Azure without changing the state store; forgetting --state=azureblob://<account>; local testing with memfs/file state stores while targeting Azure.

Related errors


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