Skip to content

azure: Use generated declarations#2194

Draft
bwateratmsft wants to merge 11 commits intomainfrom
bmw/declarations
Draft

azure: Use generated declarations#2194
bwateratmsft wants to merge 11 commits intomainfrom
bmw/declarations

Conversation

@bwateratmsft
Copy link
Contributor

@bwateratmsft bwateratmsft commented Feb 11, 2026

This has been annoying since forever, and would be part of the work toward #1349.

Consider the old index.d.ts:

Details
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

/* eslint-disable @typescript-eslint/no-explicit-any */

import { AuthorizationManagementClient, type RoleDefinition } from '@azure/arm-authorization';
import { Identity, ManagedServiceIdentityClient } from '@azure/arm-msi';
import type { ExtendedLocation, ResourceGroup } from '@azure/arm-resources';
import type { Location } from '@azure/arm-resources-subscriptions';
import type { StorageAccount } from '@azure/arm-storage';
import { type StorageManagementClient } from '@azure/arm-storage';
import type { ServiceClient, ServiceClientOptions } from '@azure/core-client';
import type { PagedAsyncIterableIterator } from '@azure/core-paging';
import type { PipelineRequestOptions, PipelineResponse } from '@azure/core-rest-pipeline';
import type { Environment } from '@azure/ms-rest-azure-env';
import type { AzExtParentTreeItem, AzExtServiceClientCredentials, AzExtServiceClientCredentialsT2, AzExtTreeItem, AzureNameStep, AzureWizardExecuteStep, AzureWizardExecuteStepWithActivityOutput, AzureWizardPromptStep, IActionContext, IAzureNamingRules, IAzureQuickPickItem, IAzureQuickPickOptions, IAzureUserInput, IRelatedNameWizardContext, ISubscriptionActionContext, ISubscriptionContext, IWizardOptions, TreeElementBase, UIExtensionVariables } from '@microsoft/vscode-azext-utils';
import type { AzureSubscription } from '@microsoft/vscode-azureresources-api';
import { Disposable, LogOutputChannel, Progress, ProviderResult, TreeItem, Uri } from 'vscode';

export type OpenInPortalOptions = {
    /**
     * A query string applied directly to the host URL, e.g. "feature.staticwebsites=true" (turns on a preview feature)
     */
    queryPrefix?: string;
};

/**
 * Implement this class to display resources under a standard subscription tree item
 */
export declare abstract class SubscriptionTreeItemBase extends AzExtParentTreeItem {
    public static readonly contextValue: string;
    public readonly contextValue: string;
    public readonly label: string;
    constructor(parent: AzExtParentTreeItem, subscription: ISubscriptionContext);
}

/**
 * A tree item for an Azure Account, which will display subscriptions. For Azure-centered extensions, this will be at the root of the tree.
 */
export declare abstract class AzureAccountTreeItemBase extends AzExtParentTreeItem implements Disposable {
    public static readonly contextValue: string;
    public contextValue: string;
    public label: string;
    public disposables: Disposable[];
    public childTypeLabel: string;
    public autoSelectInTreeItemPicker: boolean;

    //#region Methods implemented by base class
    /**
     * Implement this to create a subscription tree item under this Azure Account node
     * @param root Contains basic information about the subscription - should be passed in to the constructor of `SubscriptionTreeItemBase`
     */
    public abstract createSubscriptionTreeItem(root: ISubscriptionContext): SubscriptionTreeItemBase | Promise<SubscriptionTreeItemBase>;
    //#endregion

    /**
     * Azure Account Tree Item
     * @param parent The parent of this node or undefined if it's the root of the tree.
     * @param testAccount Unofficial api for testing
     */
    public constructor(parent?: AzExtParentTreeItem, testAccount?: {});

    public dispose(): void;

    /**
     * If user is logged in and only has one subscription selected, adds that to the wizardContext and returns undefined
     * Else, returns a prompt step for a subscription
     */
    public getSubscriptionPromptStep(wizardContext: Partial<ISubscriptionActionContext>): Promise<AzureWizardPromptStep<ISubscriptionActionContext> | undefined>;

    public hasMoreChildrenImpl(): boolean;
    public loadMoreChildrenImpl(clearCache: boolean, context: IActionContext): Promise<AzExtTreeItem[]>;
    public pickTreeItemImpl(expectedContextValues: (string | RegExp)[]): Promise<AzExtTreeItem | undefined>;
    public getIsLoggedIn(): Promise<boolean>;
}

/**
* Combines the root.environment.portalLink and id to open the resource in the portal.
*
* NOTE: If root is a tree item, it will find the subscription ancestor and get environment.portalLink from there
*/
export declare function openInPortal(root: ISubscriptionContext | AzExtTreeItem, id: string, options?: OpenInPortalOptions): Promise<void>;

export type AzExtLocation = Location & {
    id: string;
    name: string;
    displayName: string;
}

/**
 * Currently no location-specific properties on the wizard context, but keeping this interface for backwards compatibility and ease of use
 * Instead, use static methods on `LocationListStep` like `getLocation` and `setLocationSubset`
 */
export interface ILocationWizardContext extends ISubscriptionActionContext {
    includeExtendedLocations?: boolean;
}

export declare class LocationListStep<T extends ILocationWizardContext> extends AzureWizardPromptStep<T> {
    protected constructor();

    /**
     * Adds a LocationListStep to the wizard.  This function will ensure there is only one LocationListStep per wizard context.
     * @param wizardContext The context of the wizard
     * @param promptSteps The array of steps to include the LocationListStep to
     * @param options Options to pass to ui.showQuickPick. Options are spread onto the defaults.
     */
    public static addStep<T extends ILocationWizardContext>(wizardContext: IActionContext & Partial<ILocationWizardContext>, promptSteps: AzureWizardPromptStep<T>[], options?: IAzureQuickPickOptions): void;

    /**
     * This will set the wizard context's location (in which case the user will _not_ be prompted for location)
     * For example, if the user selects an existing resource, you might want to use that location as the default for the wizard's other resources
     * This _will_ set the location even if not all providers support it - in the hopes that a related location can be found during `getLocation`
     * @param wizardContext The context of the wizard
     * @param name The name or display name of the location
     */
    public static setLocation<T extends ILocationWizardContext>(wizardContext: T, name: string): Promise<void>;

    /**
     * Sets a location to auto-select during prompting, if available.
     * Use this instead of `setLocation` when you want to automatically select a location
     * that respects all future resource providers.
     * @param wizardContext The context of the wizard
     * @param name The name or display name of the suggested location
     */
    public static setAutoSelectLocation<T extends ILocationWizardContext>(wizardContext: T, name: string): Promise<void>;

    /**
     * Resets all location and location-related metadata on the wizard context back to its uninitialized state.
     * This includes clearing the selected location, cached location tasks, provider location maps, and any step-tracking flags.
     * Use this to ensure the wizard context is fully reset before starting a new location selection process.
     * @param wizardContext The context of the wizard
     */
    public static resetLocation<T extends ILocationWizardContext>(wizardContext: T): void;

    /**
     * Specify a task that will be used to filter locations
     * @param wizardContext The context of the wizard
     * @param task A task evaluating to the locations supported by this provider
     * @param provider The relevant provider (i.e. 'Microsoft.Web')
     */
    public static setLocationSubset<T extends ILocationWizardContext>(wizardContext: T, task: Promise<string[]>, provider: string): void;

    /**
     * Adds default location filtering for a provider
     * If more granular filtering is needed, use `setLocationSubset` instead (i.e. if the provider further filters locations based on features)
     * @param wizardContext The context of the wizard
     * @param provider The provider (i.e. 'Microsoft.Storage')
     * @param resourceType The resource type (i.e. 'storageAccounts')
     */
    public static addProviderForFiltering<T extends ILocationWizardContext>(wizardContext: T, provider: string, resourceType: string): void;

    /**
     * Used to convert a location into a home location and an extended location if the location passed in is an extended location.
     * If the location passed in is not extended, then extendedLocation will be `undefined`.
     * @param location location or extended location
     */
    public static getExtendedLocation(location: AzExtLocation): { location: string, extendedLocation?: ExtendedLocation };

    /**
     * Gets the `autoSelectLocation` for this wizard.  This location will be automatically selected during prompting, if available.
     * @param wizardContext The context of the wizard
     */
    public static getAutoSelectLocation<T extends ILocationWizardContext>(wizardContext: T): AzExtLocation | undefined;

    /**
     * Gets the selected location for this wizard.
     * @param wizardContext The context of the wizard
     * @param provider If specified, this will check against that provider's supported locations and attempt to find a "related" location if the selected location is not supported.
     * @param supportsExtendedLocations If set to true, the location returned may be an extended location, in which case the `extendedLocation` property should be added when creating a resource
     */
    public static getLocation<T extends ILocationWizardContext>(wizardContext: T, provider?: string, supportsExtendedLocations?: boolean): Promise<AzExtLocation>;

    /**
     * Returns true if a location has been set on the context
     */
    public static hasLocation<T extends ILocationWizardContext>(wizardContext: T): boolean;

    /**
     * Used to get locations. By passing in the context, we can ensure that Azure is only queried once for the entire wizard
     * @param wizardContext The context of the wizard.
     */
    public static getLocations<T extends ILocationWizardContext>(wizardContext: T): Promise<AzExtLocation[]>;

    /**
     * Returns true if the given location matches the name
     */
    public static locationMatchesName(location: AzExtLocation, name: string): boolean;

    public prompt(wizardContext: T): Promise<void>;
    public shouldPrompt(wizardContext: T): boolean;

    protected getQuickPicks(wizardContext: T): Promise<IAzureQuickPickItem<AzExtLocation>[]>;

    public static generalizeLocationName(name: string | undefined): string;

    /**
     * Implement this to set descriptions on location quick pick items.
     */
    public static getQuickPickDescription?: (location: AzExtLocation) => string | undefined;
}

/**
 * Checks to see if providers (i.e. 'Microsoft.Web') are registered and registers them if they're not
 */
export declare class VerifyProvidersStep<T extends ISubscriptionActionContext> extends AzureWizardExecuteStep<T> {
    /**
     * 90
     */
    public priority: number;

    /**
     * @param providers List of providers to verify
     */
    public constructor(providers: string[]);

    public execute(wizardContext: T, progress: Progress<{ message?: string; increment?: number }>): Promise<void>;
    public shouldExecute(wizardContext: T): boolean;
}

export interface IResourceGroupWizardContext extends ILocationWizardContext, IRelatedNameWizardContext {
    /**
     * Internal value indicating the last resource group name checked with `ResourceGroupVerifyStep`.
     * This name does not indicate a successful outcome from the verification step, it only indicates that the check has taken place.
     */
    _lastResourceGroupNameVerified?: string;

    /**
     * The resource group to use for new resources.
     * If an existing resource group is picked, this value will be defined after `ResourceGroupListStep.prompt` occurs
     * If a new resource group is picked, this value will be defined after the `execute` phase of the 'create' subwizard
     */
    resourceGroup?: ResourceGroup;

    /**
     * The task used to get existing resource groups.
     * By specifying this in the context, we can ensure that Azure is only queried once for the entire wizard
     */
    resourceGroupsTask?: Promise<ResourceGroup[]>;

    newResourceGroupName?: string;

    /**
     * By default, users will be prompted to select an existing resource group if creating one fails with a 403 error. Set this to `true` to prevent that behavior
     */
    suppress403Handling?: boolean;

    /**
     * Will automatically be generated by UserAssignedIdentityCreateStep if not specified by the user
     */
    newManagedIdentityName?: string;

    /**
     * The managed identity that will be assigned to the resource such as a function app or container app
     * If you need to grant access to a resource, such as a storage account or SQL database, you can use this managed identity to create a role assignment
     * with the RoleAssignmentExecuteStep
     */
    managedIdentity?: Identity;

    ui: IAzureUserInput;
}

export declare const resourceGroupNamingRules: IAzureNamingRules;

export declare class ResourceGroupListStep<T extends IResourceGroupWizardContext> extends AzureWizardPromptStep<T> {
    /**
     * Used to get existing resource groups. By passing in the context, we can ensure that Azure is only queried once for the entire wizard
     * @param wizardContext The context of the wizard.
     */
    public static getResourceGroups<T extends IResourceGroupWizardContext>(wizardContext: T): Promise<ResourceGroup[]>;

    /**
     * Checks existing resource groups in the wizard's subscription to see if the name is available.
     * @param wizardContext The context of the wizard.
     */
    public static isNameAvailable<T extends IResourceGroupWizardContext>(wizardContext: T, name: string): Promise<boolean>;

    public prompt(wizardContext: T): Promise<void>;
    public getSubWizard(wizardContext: T): Promise<IWizardOptions<T> | undefined>;
    public shouldPrompt(wizardContext: T): boolean;
}

export declare class ResourceGroupNameStep<T extends IResourceGroupWizardContext> extends AzureWizardPromptStep<T> {
    public prompt(wizardContext: T): Promise<void>;
    public shouldPrompt(wizardContext: T): boolean;
}

export declare class ResourceGroupVerifyStep<T extends IResourceGroupWizardContext> extends AzureWizardExecuteStepWithActivityOutput<T> {
    public stepName: string;
    protected getOutputLogSuccess(context: T): string;
    protected getOutputLogFail(context: T): string;
    protected getTreeItemLabel(context: T): string;

    /**
     * 95
     */
    public priority: number;
    public configureBeforeExecute(wizardContext: T): void | Promise<void>;
    public execute(wizardContext: T, progress: Progress<{ message?: string; increment?: number }>): Promise<void>;
    public shouldExecute(wizardContext: T): boolean;
}

export declare class ResourceGroupCreateStep<T extends IResourceGroupWizardContext> extends AzureWizardExecuteStepWithActivityOutput<T> {
    public stepName: string;
    protected getOutputLogSuccess(context: T): string;
    protected getOutputLogFail(context: T): string;
    protected getTreeItemLabel(context: T): string;

    /**
     * 100
     */
    public priority: number;
    public configureBeforeExecute(wizardContext: T): void | Promise<void>;
    public execute(wizardContext: T, progress: Progress<{ message?: string; increment?: number }>): Promise<void>;
    public shouldExecute(wizardContext: T): boolean;
}

export interface IStorageAccountWizardContext extends IResourceGroupWizardContext {
    /**
     * The storage account to use.
     * If an existing storage account is picked, this value will be defined after `StorageAccountListStep.prompt` occurs
     * If a new storage account is picked, this value will be defined after the `execute` phase of the 'create' subwizard
     */
    storageAccount?: StorageAccount;

    newStorageAccountName?: string;
    /**
     * This controls whether the storage account can generate connection strings.
     * This should be disabled for storage accounts that are using managed identity only.
     */
    disableSharedKeyAccess?: boolean;
}

export declare enum StorageAccountKind {
    Storage = "Storage",
    StorageV2 = "StorageV2",
    BlobStorage = "BlobStorage",
    BlockBlobStorage = "BlockBlobStorage",
}

export declare enum StorageAccountPerformance {
    Standard = "Standard",
    Premium = "Premium",
}

export declare enum StorageAccountReplication {
    /**
     * Locally redundant storage
     */
    LRS = "LRS",
    /**
     * Zone-redundant storage
     */
    ZRS = "ZRS",
    /**
     * Geo-redundant storage
     */
    GRS = "GRS",
    /**
     * Read-access geo-redundant storage
     */
    RAGRS = "RAGRS",
}

export interface INewStorageAccountDefaults {
    kind: StorageAccountKind;
    performance: StorageAccountPerformance;
    replication: StorageAccountReplication;
}

export interface IStorageAccountFilters {
    kind?: StorageAccountKind[];
    performance?: StorageAccountPerformance[];
    replication?: StorageAccountReplication[];

    /**
     * If specified, a 'learn more' option will be displayed to explain why some storage accounts were filtered
     */
    learnMoreLink?: string;
}

export declare const storageAccountNamingRules: IAzureNamingRules;
export declare class StorageAccountListStep<T extends IStorageAccountWizardContext> extends AzureWizardPromptStep<T> {
    /**
     * @param createOptions Default options to use when creating a Storage Account
     * @param filterOptions Optional filters used when listing Storage Accounts
     */
    public constructor(createOptions: INewStorageAccountDefaults, filterOptions?: IStorageAccountFilters);

    public static isNameAvailable<T extends IStorageAccountWizardContext>(wizardContext: T, name: string): Promise<boolean>;

    public prompt(wizardContext: T): Promise<void>;
    public getSubWizard(wizardContext: T): Promise<IWizardOptions<T> | undefined>;
    public shouldPrompt(wizardContext: T): boolean;
}

export declare class StorageAccountNameStep<T extends IStorageAccountWizardContext> extends AzureNameStep<T> {
    public constructor();

    public prompt(wizardContext: T): Promise<void>;
    public shouldPrompt(wizardContext: T): boolean;

    protected isRelatedNameAvailable(wizardContext: T, name: string): Promise<boolean>;
}

export declare class StorageAccountCreateStep<T extends IStorageAccountWizardContext> extends AzureWizardExecuteStep<T> {
    /**
     * 130
     */
    public priority: number;
    public constructor(defaults: INewStorageAccountDefaults);

    public execute(wizardContext: T, progress: Progress<{ message?: string; increment?: number }>): Promise<void>;
    public shouldExecute(wizardContext: T): boolean;
}

export declare class UserAssignedIdentityListStep<T extends IResourceGroupWizardContext> extends AzureWizardPromptStep<T> {
    public constructor(suppressCreate?: boolean);

    public prompt(wizardContext: T): Promise<void>;
    public shouldPrompt(wizardContext: T): boolean;
}

export declare class UserAssignedIdentityNameStep<T extends IResourceGroupWizardContext> extends AzureWizardPromptStep<T> {
    public constructor();

    public prompt(wizardContext: T): Promise<void>;
    public shouldPrompt(wizardContext: T): boolean;

    static isNameAvailable(wizardContext: IResourceGroupWizardContext, rgName: string, identityName: string): Promise<boolean>;
    static tryGenerateRelatedName(wizardContext: IResourceGroupWizardContext, rgName: string): Promise<string | undefined>;
}

export declare class UserAssignedIdentityCreateStep<T extends IResourceGroupWizardContext> extends AzureWizardExecuteStep<T> {
    /**
     * 140
     */
    public priority: number;
    public constructor();

    public execute(wizardContext: T, progress: Progress<{ message?: string; increment?: number }>): Promise<void>;
    public shouldExecute(wizardContext: T): boolean;
}

export declare class RoleAssignmentExecuteStep<T extends IResourceGroupWizardContext, TKey extends keyof T> extends AzureWizardExecuteStep<T> {
    /**
     * 900
     */
    public priority: number;
    /**
    * @param getScopeId A function that returns the scope id for the role assignment.
    * The scope ID is the Azure ID of the resource that we are granting access to such as a storage account.
    * Example: `/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/rgName/providers/Microsoft.Storage/storageAccounts/resourceName`
    * This typically won't exist until _after_ the wizard executes and the resource is created, so we need to pass in a function that returns the ID.
    * If the scope ID is undefined, the step will throw an error.
    * @param roles An array of roles. Each role is an object and include the ARM role definition id and name of the role definition.
    * */
    public constructor(roles: () => (Role[] | Promise<Role[]> | undefined), options?: { priority?: number });

    public execute(wizardContext: T, progress: Progress<{ message?: string; increment?: number }>): Promise<void>;
    public shouldExecute(wizardContext: T): boolean;
}

export interface Role {
    /**
     * The scope of the operation or resource. Valid scopes are: subscription (format:
     *    '/subscriptions/{subscriptionId}'), resource group (format:
     *    '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format:
     *    '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
     */
    scopeId: string | undefined;
    /**
     * The role definition id of the role to assign. This can be created using `createRoleId`
     */
    roleDefinitionId: string;
    /**
     *  The name of the role definition to assign
     */
    roleDefinitionName: string;
}

export interface IAzureUtilsExtensionVariables extends UIExtensionVariables {
    prefix: string;
}

/**
 * Call this to register common variables used throughout the UI package.
 */
export declare function registerAzureUtilsExtensionVariables(extVars: IAzureUtilsExtensionVariables): void;

/**
 * Credential type to be used for creating generic http rest clients
 */
export type AzExtGenericCredentials = AzExtServiceClientCredentialsT2 | AzExtServiceClientCredentials;
export type AzExtGenericClientInfo = AzExtGenericCredentials | { credentials: AzExtGenericCredentials; environment: Environment; } | undefined;

/**
 * Creates a generic http rest client (i.e. for non-Azure calls or for Azure calls that the available sdks don't support), ensuring best practices are followed. For example:
 * 1. Adds extension-specific user agent
 * 2. Uses resourceManagerEndpointUrl to support sovereigns (if clientInfo corresponds to an Azure environment)
 * @param clientInfo The client/credentials info or `undefined` if no credentials are needed
 */
export declare function createGenericClient(context: IActionContext, clientInfo: AzExtGenericClientInfo | undefined, options?: IGenericClientOptions): Promise<ServiceClient>;
export interface IGenericClientOptions {
    noRetryPolicy?: boolean;
    addStatusCodePolicy?: boolean;
    endpoint?: string;
}

/**
 * Used to create Azure clients for managed identity without having to install the sdk into client extension package.json
 */
export function createManagedServiceIdentityClient(context: AzExtClientContext): Promise<ManagedServiceIdentityClient>
export function createAuthorizationManagementClient(context: AzExtClientContext): Promise<AuthorizationManagementClient>

export type AzExtRequestPrepareOptions = PipelineRequestOptions & { rejectUnauthorized?: boolean }
export type AzExtPipelineResponse = PipelineResponse & { parsedBody?: any }

/**
 * Send request with a timeout specified and turn off retry policy (because retrying could take a lot longer)
 * @param timeout The timeout in milliseconds
 * @param clientInfo The client/credentials info or `undefined` if no credentials are needed
 */
export declare function sendRequestWithTimeout(context: IActionContext, options: AzExtRequestPrepareOptions, timeout: number, clientInfo: AzExtGenericClientInfo): Promise<AzExtPipelineResponse>;

export type AzExtClientType<T extends ServiceClient> = new (credentials: AzExtServiceClientCredentials, subscriptionId: string, options?: ServiceClientOptions) => T;

/**
 * Convenience type to give us multiple ways to specify subscription info and action context depending on the scenario
 */
export type AzExtClientContext = ISubscriptionActionContext | [IActionContext, ISubscriptionContext | AzExtTreeItem];

/**
 * Converts `AzExtClientContext` into a single object: `ISubscriptionActionContext`
 */
export declare function parseClientContext(clientContext: AzExtClientContext): ISubscriptionActionContext;

/**
 * Creates an Azure client, ensuring best practices are followed. For example:
 * 1. Adds extension-specific user agent
 * 2. Uses resourceManagerEndpointUrl to support sovereigns
 */
export declare function createAzureClient<T extends ServiceClient>(context: AzExtClientContext, clientType: AzExtClientType<T>): T;

export type AzExtSubscriptionClientType<T> = new (credentials: AzExtServiceClientCredentials, options?: ServiceClientOptions) => T;

/**
 * Creates an Azure subscription client, ensuring best practices are followed. For example:
 * 1. Adds extension-specific user agent
 * 2. Uses resourceManagerEndpointUrl to support sovereigns
 */
export declare function createAzureSubscriptionClient<T>(context: AzExtClientContext, clientType: AzExtSubscriptionClientType<T>): T;

export declare function createStorageClient(context: AzExtClientContext): Promise<StorageManagementClient>;

export declare namespace uiUtils {
    export function listAllIterator<T>(iterator: PagedAsyncIterableIterator<T>): Promise<T[]>
}

interface ParsedAzureResourceId {
    rawId: string;
    subscriptionId: string;
    resourceGroup: string;
    provider: string;
    resourceName: string;
}

interface ParsedAzureResourceGroupId {
    rawId: string;
    subscriptionId: string;
    resourceGroup: string;
}

export function parseAzureResourceId(id: string): ParsedAzureResourceId;
export function parseAzureResourceGroupId(id: string): ParsedAzureResourceGroupId;
export function getResourceGroupFromId(id: string): string;

export declare function createPortalUri(subscription: AzureSubscription, id: string, options?: OpenInPortalOptions): Uri;

/**
 * Pipe Azure SDK logs into the provided log outptut channel using the @azure/logger package.
 *
 * @param logOutputChannel - log output channel to pipe logs into
 */
export function setupAzureLogger(logOutputChannel: LogOutputChannel): Disposable;

/**
 * Replaces the usage of BasicAuthenticationCredentials for ServiceClients imported from @azure/core-pipelines
 *
 * @param client - The service client. This will typically be a generalClient
 * @param userName - Username to be used with basic authentication login
 * @param password - Password. Gets encoded before being set in the header
 */
export function addBasicAuthenticationCredentialsToClient(client: ServiceClient, userName: string, password: string): void;

/**
 * Common Roles that should be used to assign permissions to resources
 * The role definitions can be found here: https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles
 */
export declare const CommonRoleDefinitions: {
    readonly storageBlobDataContributor: {
        readonly name: "ba92f5b4-2d11-453d-a403-e96b0029c9fe";
        readonly type: "Microsoft.Authorization/roleDefinitions";
        readonly roleName: "Storage Blob Data Contributor";
        readonly description: "Allows for read, write and delete access to Azure Storage blob containers and data";
        readonly roleType: "BuiltInRole";
    };
    readonly storageBlobDataOwner: {
        readonly name: "b7e6dc6d-f1e8-4753-8033-0f276bb0955b",
        readonly type: "Microsoft.Authorization/roleDefinitions",
        readonly roleName: "Storage Blob Data Owner",
        readonly description: "Allows for full access to Azure Storage blob containers and data, including assigning POSIX access control.",
        readonly roleType: "BuiltInRole"
    };
    readonly storageQueueDataContributor: {
        readonly name: "974c5e8b-45b9-4653-ba55-5f855dd0fb88",
        readonly type: "Microsoft.Authorization/roleDefinitions",
        readonly roleName: "Storage Queue Data Contributor",
        readonly description: "Read, write, and delete Azure Storage queues and queue messages.",
        readonly roleType: "BuiltInRole"
    };
    readonly azureServiceBusDataReceiver: {
        readonly name: "4f6d3b9b-027b-4f4c-9142-0e5a2a2247e0",
        readonly type: "Microsoft.Authorization/roleDefinitions",
        readonly roleName: "Azure Service Bus Data Receiver",
        readonly description: "Allows for receive access to Azure Service Bus resources.",
        readonly sroleType: "BuiltInRole"
    };
    readonly azureServiceBusDataOwner: {
        readonly name: "090c5cfd-751d-490a-894a-3ce6f1109419",
        readonly type: "Microsoft.Authorization/roleDefinitions",
        readonly roleName: "Azure Service Bus Data Owner",
        readonly description: "Allows for full access to Azure Service Bus resources.",
        readonly roleType: "BuiltInRole"
    };
    readonly azureEventHubsDataReceiver: {
        readonly name: "a638d3c7-ab3a-418d-83e6-5f17a39d4fde",
        readonly type: "Microsoft.Authorization/roleDefinitions",
        readonly roleName: "Azure Event Hubs Data Receiver",
        readonly description: "Allows receive access to Azure Event Hubs resources.",
        readonly roleType: "BuiltInRole"
    };
    readonly azureEventHubsDataOwner: {
        readonly name: "f526a384-b230-433a-b45c-95f59c4a2dec",
        readonly type: "Microsoft.Authorization/roleDefinitions",
        readonly roleName: "Azure Event Hubs Data Owner",
        readonly description: "Allows for full access to Azure Event Hubs resources.",
        readonly roleType: "BuiltInRole"
    };
    readonly cosmosDBAccountReader: {
        readonly name: "fbdf93bf-df7d-467e-a4d2-9458aa1360c8",
        readonly type: "Microsoft.Authorization/roleDefinitions",
        readonly roleName: "Cosmos DB Account Reader",
        readonly description: "Can read Azure Cosmos DB account data.",
        readonly roleType: "BuiltInRole"
    };
    readonly documentDBAccountContributor: {
        readonly name: "5bd9cd88-fe45-4216-938b-f97437e15450",
        readonly type: "Microsoft.Authorization/roleDefinitions",
        readonly roleName: "DocumentDB Account Contributor",
        readonly description: "Can manage Azure Cosmos DB accounts.",
        readonly roleType: "BuiltInRole"
    },
    readonly durableTaskDataContributor: {
        name: "0ad04412-c4d5-4796-b79c-f76d14c8d402",
        type: "Microsoft.Authorization/roleDefinitions",
        roleName: "Durable Task Data Contributor",
        description: "Durable Task role for all data access operations.",
        roleType: "BuiltInRole"
    },
};
/**
 * Constructs the role id for a given subscription and role name id
 *
 * @param subscriptionId - Id for the subscription
 * @param roleId - Name id for the role to be assigned (i.e CommonRoleDefinitions.storageBlobDataContributor.name)
 */
export function createRoleId(subscriptionId: string, RoleDefinition: RoleDefinition): string;

/**
 * creates all RoleDefinitionsItem for an entire managed identity object
 */
export function createRoleDefinitionsItems(
    context: IActionContext,
    subscription: AzureSubscription | ISubscriptionContext,
    msi: Identity,
    parentResourceId: string,
): Promise<RoleDefinitionsItem[]>

/**
 * should not be created directly; use `createRoleDefinitionsItems` instead
 */
export type RoleDefinitionsItem = {
    getChildren?(): ProviderResult<TreeElementBase[]>;
    getTreeItem(): TreeItem | Thenable<TreeItem>;
    id?: string | undefined;
}

/**
 * Requires a RoleDefinitionsItem as a data model in its constructor. Used for v1.5 API versions of the extensions
 */
export class RoleDefinitionsTreeItem extends AzExtParentTreeItem {
    constructor(parent: AzExtParentTreeItem, roleDefinitionsItem: RoleDefinitionsItem);
    public loadMoreChildrenImpl(clearCache: boolean, context: IActionContext): Promise<AzExtTreeItem[]>;
    public hasMoreChildrenImpl(): boolean;
    public label: string;
    public contextValue: string;
}

export const IdentityProvider: string;
export const UserAssignedIdentityResourceType: string;

Compared to a rollup of the new declarations (provided by @microsoft/api-extractor):

Details
import { AgentQuickPickItem } from '@microsoft/vscode-azext-utils';
import type { AuthorizationManagementClient } from '@azure/arm-authorization';
import { AzExtParentTreeItem } from '@microsoft/vscode-azext-utils';
import { AzExtServiceClientCredentials } from '@microsoft/vscode-azext-utils';
import { AzExtServiceClientCredentialsT2 } from '@microsoft/vscode-azext-utils';
import { AzExtTreeItem } from '@microsoft/vscode-azext-utils';
import { AzureNameStep } from '@microsoft/vscode-azext-utils';
import { AzureSubscription as AzureSubscription_2 } from '@microsoft/vscode-azureresources-api';
import { AzureWizardExecuteStep } from '@microsoft/vscode-azext-utils';
import { AzureWizardExecuteStepWithActivityOutput } from '@microsoft/vscode-azext-utils';
import { AzureWizardPromptStep } from '@microsoft/vscode-azext-utils';
import type { CancellationToken } from 'vscode';
import { Disposable as Disposable_2 } from 'vscode';
import type { Environment } from '@azure/ms-rest-azure-env';
import type { Event as Event_2 } from 'vscode';
import { ExecuteActivityContext } from '@microsoft/vscode-azext-utils';
import { ExecuteActivityOutput } from '@microsoft/vscode-azext-utils';
import type { ExtendedLocation } from '@azure/arm-resources';
import { IActionContext } from '@microsoft/vscode-azext-utils';
import { IAzureNamingRules } from '@microsoft/vscode-azext-utils';
import { IAzureQuickPickItem } from '@microsoft/vscode-azext-utils';
import { IAzureQuickPickOptions } from '@microsoft/vscode-azext-utils';
import type { IAzureUserInput } from '@microsoft/vscode-azext-utils';
import type { Identity } from '@azure/arm-msi';
import type { IRelatedNameWizardContext } from '@microsoft/vscode-azext-utils';
import { ISubscriptionActionContext } from '@microsoft/vscode-azext-utils';
import { ISubscriptionContext } from '@microsoft/vscode-azext-utils';
import { IWizardOptions } from '@microsoft/vscode-azext-utils';
import type { Location } from '@azure/arm-resources-subscriptions';
import type { ManagedServiceIdentityClient } from '@azure/arm-msi';
import type { PagedAsyncIterableIterator } from '@azure/core-paging';
import { PipelineRequestOptions } from '@azure/core-rest-pipeline';
import { PipelineResponse } from '@azure/core-rest-pipeline';
import { Progress } from 'vscode';
import type { ReadStream } from 'fs';
import type { ResourceGroup } from '@azure/arm-resources';
import type { ResourceManagementClient } from '@azure/arm-resources';
import { RoleDefinition } from '@azure/arm-authorization';
import { ServiceClient } from '@azure/core-client';
import { ServiceClientOptions } from '@azure/core-client';
import type { StorageAccount } from '@azure/arm-storage';
import type { StorageManagementClient } from '@azure/arm-storage';
import type { Subscription } from '@azure/arm-resources-subscriptions';
import type { SubscriptionClient } from '@azure/arm-resources-subscriptions';
import type { Terminal } from 'vscode';
import type { TokenCredential } from '@azure/core-auth';
import { TreeElementBase } from '@microsoft/vscode-azext-utils';
import { TreeItem } from 'vscode';
import { TreeItemIconPath } from '@microsoft/vscode-azext-utils';
import { UIExtensionVariables } from '@microsoft/vscode-azext-utils';
import { Uri } from 'vscode';
import * as vscode from 'vscode';

/**
 * Replaces the usage of BasicAuthenticationCredentials for ServiceClients imported from @azure/core-pipelines
 *
 * @param client - The service client. This will typically be a generalClient
 * @param userName - Username to be used with basic authentication login
 * @param password - Password. Gets encoded before being set in the header
 */
export declare function addBasicAuthenticationCredentialsToClient(client: ServiceClient, userName: string, password: string): void;

/**
 * Convenience type to give us multiple ways to specify subscription info and action context depending on the scenario
 */
export declare type AzExtClientContext = ISubscriptionActionContext | [IActionContext, ISubscriptionContext | AzExtTreeItem];

export declare type AzExtClientType<T extends ServiceClient> = new (credentials: AzExtServiceClientCredentials, subscriptionId: string, options?: ServiceClientOptions) => T;

export declare type AzExtGenericClientInfo = AzExtGenericCredentials | {
    credentials: AzExtGenericCredentials;
    environment: Environment;
} | undefined;

/**
 * Credential type to be used for creating generic http rest clients
 */
export declare type AzExtGenericCredentials = AzExtServiceClientCredentials | AzExtServiceClientCredentialsT2;

export declare type AzExtLocation = Location & {
    id: string;
    name: string;
    displayName: string;
};

export declare type AzExtPipelineResponse = PipelineResponse & {
    parsedBody?: any;
};

export declare type AzExtRequestPrepareOptions = PipelineRequestOptions & {
    rejectUnauthorized?: boolean;
};

export declare type AzExtSubscriptionClientType<T> = new (credentials: AzExtServiceClientCredentials, options?: ServiceClientOptions) => T;

/**
 * @deprecated The Azure Account extension is deprecated.
 */
export declare interface AzureAccountExtensionApi {
    readonly apiVersion: string;
    readonly status: AzureLoginStatus;
    readonly filters: AzureResourceFilter[];
    readonly sessions: AzureSession[];
    readonly subscriptions: AzureSubscription[];
    readonly onStatusChanged: Event_2<AzureLoginStatus>;
    readonly onFiltersChanged: Event_2<void>;
    readonly onSessionsChanged: Event_2<void>;
    readonly onSubscriptionsChanged: Event_2<void>;
    readonly waitForFilters: () => Promise<boolean>;
    readonly waitForLogin: () => Promise<boolean>;
    readonly waitForSubscriptions: () => Promise<boolean>;
    createCloudShell(os: 'Linux' | 'Windows'): CloudShell;
}

/**
 * A tree item for an Azure Account, which will display subscriptions. For Azure-centered extensions, this will be at the root of the tree.
 * @deprecated The Azure Account extension is deprecated.
 */
export declare abstract class AzureAccountTreeItemBase extends AzExtParentTreeItem implements Disposable_2 {
    static readonly contextValue: string;
    readonly contextValue: string;
    readonly label: string;
    childTypeLabel: string;
    autoSelectInTreeItemPicker: boolean;
    disposables: Disposable_2[];
    suppressMaskLabel: boolean;
    private _azureAccountTask;
    private _subscriptionTreeItems;
    private _testAccount;
    /**
     * Azure Account Tree Item
     * @param parent The parent of this node or undefined if it's the root of the tree.
     * @param testAccount Unofficial api for testing
     */
    constructor(parent?: AzExtParentTreeItem, testAccount?: AzureAccountExtensionApi);
    /**
     * Implement this to create a subscription tree item under this Azure Account node
     * @param root Contains basic information about the subscription - should be passed in to the constructor of `SubscriptionTreeItemBase`
     */
    abstract createSubscriptionTreeItem(root: ISubscriptionContext): SubscriptionTreeItemBase | Promise<SubscriptionTreeItemBase>;
    get iconPath(): TreeItemIconPath;
    dispose(): void;
    hasMoreChildrenImpl(): boolean;
    loadMoreChildrenImpl(_clearCache: boolean, context: IActionContext): Promise<AzExtTreeItem[]>;
    getIsLoggedIn(): Promise<boolean>;
    /**
     * If user is logged in and only has one subscription selected, adds that to the wizardContext and returns undefined
     * Else, returns a prompt step for a subscription
     */
    getSubscriptionPromptStep(context: Partial<ISubscriptionActionContext> & IActionContext): Promise<AzureWizardPromptStep<ISubscriptionActionContext> | undefined>;
    pickTreeItemImpl(_expectedContextValues: (string | RegExp)[]): Promise<AzExtTreeItem | undefined>;
    compareChildrenImpl(item1: AzExtTreeItem, item2: AzExtTreeItem): number;
    private loadAzureAccount;
    private ensureSubscriptionTreeItems;
}

/**
 * @deprecated The Azure Account extension is deprecated.
 */
export declare type AzureLoginStatus = 'Initializing' | 'LoggingIn' | 'LoggedIn' | 'LoggedOut';

/**
 * @deprecated The Azure Account extension is deprecated.
 */
export declare type AzureResourceFilter = AzureSubscription;

/**
 * @deprecated The Azure Account extension is deprecated.
 */
export declare interface AzureSession {
    readonly environment: Environment;
    readonly userId: string;
    readonly tenantId: string;
    /**
     * The credentials object for azure-sdk-for-js modules https://github.com/azure/azure-sdk-for-js
     */
    readonly credentials2: TokenCredential;
}

/**
 * @deprecated The Azure Account extension is deprecated.
 */
export declare interface AzureSubscription {
    readonly session: AzureSession;
    readonly subscription: Subscription;
}

/**
 * @deprecated The Azure Account extension is deprecated.
 */
export declare interface CloudShell {
    readonly status: CloudShellStatus;
    readonly onStatusChanged: Event_2<CloudShellStatus>;
    readonly waitForConnection: () => Promise<boolean>;
    readonly terminal: Promise<Terminal>;
    readonly session: Promise<AzureSession>;
    readonly uploadFile: (filename: string, stream: ReadStream, options?: UploadOptions) => Promise<void>;
}

/**
 * @deprecated The Azure Account extension is deprecated.
 */
export declare type CloudShellStatus = 'Connecting' | 'Connected' | 'Disconnected';

/**
 * Common Roles that should be used to assign permissions to resources
 * The role definitions can be found here: https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles
 */
export declare const CommonRoleDefinitions: {
    readonly storageBlobDataContributor: {
        readonly name: "ba92f5b4-2d11-453d-a403-e96b0029c9fe";
        readonly type: "Microsoft.Authorization/roleDefinitions";
        readonly roleName: "Storage Blob Data Contributor";
        readonly description: "Allows for read, write and delete access to Azure Storage blob containers and data";
        readonly roleType: "BuiltInRole";
    };
    readonly storageBlobDataOwner: {
        readonly name: "b7e6dc6d-f1e8-4753-8033-0f276bb0955b";
        readonly type: "Microsoft.Authorization/roleDefinitions";
        readonly roleName: "Storage Blob Data Owner";
        readonly description: "Allows for full access to Azure Storage blob containers and data, including assigning POSIX access control.";
        readonly roleType: "BuiltInRole";
    };
    readonly storageQueueDataContributor: {
        readonly name: "974c5e8b-45b9-4653-ba55-5f855dd0fb88";
        readonly type: "Microsoft.Authorization/roleDefinitions";
        readonly roleName: "Storage Queue Data Contributor";
        readonly description: "Read, write, and delete Azure Storage queues and queue messages.";
        readonly roleType: "BuiltInRole";
    };
    readonly azureServiceBusDataReceiver: {
        readonly name: "4f6d3b9b-027b-4f4c-9142-0e5a2a2247e0";
        readonly type: "Microsoft.Authorization/roleDefinitions";
        readonly roleName: "Azure Service Bus Data Receiver";
        readonly description: "Allows for receive access to Azure Service Bus resources.";
        readonly roleType: "BuiltInRole";
    };
    readonly azureServiceBusDataOwner: {
        readonly name: "090c5cfd-751d-490a-894a-3ce6f1109419";
        readonly type: "Microsoft.Authorization/roleDefinitions";
        readonly roleName: "Azure Service Bus Data Owner";
        readonly description: "Allows for full access to Azure Service Bus resources.";
        readonly roleType: "BuiltInRole";
    };
    readonly azureEventHubsDataReceiver: {
        readonly name: "a638d3c7-ab3a-418d-83e6-5f17a39d4fde";
        readonly type: "Microsoft.Authorization/roleDefinitions";
        readonly roleName: "Azure Event Hubs Data Receiver";
        readonly description: "Allows receive access to Azure Event Hubs resources.";
        readonly roleType: "BuiltInRole";
    };
    readonly azureEventHubsDataOwner: {
        readonly name: "f526a384-b230-433a-b45c-95f59c4a2dec";
        readonly type: "Microsoft.Authorization/roleDefinitions";
        readonly roleName: "Azure Event Hubs Data Owner";
        readonly description: "Allows for full access to Azure Event Hubs resources.";
        readonly roleType: "BuiltInRole";
    };
    readonly cosmosDBAccountReader: {
        readonly name: "fbdf93bf-df7d-467e-a4d2-9458aa1360c8";
        readonly type: "Microsoft.Authorization/roleDefinitions";
        readonly roleName: "Cosmos DB Account Reader";
        readonly description: "Can read Azure Cosmos DB account data.";
        readonly roleType: "BuiltInRole";
    };
    readonly documentDBAccountContributor: {
        readonly name: "5bd9cd88-fe45-4216-938b-f97437e15450";
        readonly type: "Microsoft.Authorization/roleDefinitions";
        readonly roleName: "DocumentDB Account Contributor";
        readonly description: "Can manage Azure Cosmos DB accounts.";
        readonly roleType: "BuiltInRole";
    };
    readonly durableTaskDataContributor: {
        readonly name: "0ad04412-c4d5-4796-b79c-f76d14c8d402";
        readonly type: "Microsoft.Authorization/roleDefinitions";
        readonly roleName: "Durable Task Data Contributor";
        readonly description: "Durable Task role for all data access operations.";
        readonly roleType: "BuiltInRole";
    };
};

/**
 * Used to create Azure clients for managed identity without having to install the sdk into client extension package.json
 */
export declare function createAuthorizationManagementClient(context: AzExtClientContext): Promise<AuthorizationManagementClient>;

/**
 * Creates an Azure client, ensuring best practices are followed. For example:
 * 1. Adds extension-specific user agent
 * 2. Uses resourceManagerEndpointUrl to support sovereigns
 */
export declare function createAzureClient<T extends ServiceClient>(clientContext: AzExtClientContext, clientType: AzExtClientType<T>): T;

/**
 * Creates an Azure subscription client, ensuring best practices are followed. For example:
 * 1. Adds extension-specific user agent
 * 2. Uses resourceManagerEndpointUrl to support sovereigns
 */
export declare function createAzureSubscriptionClient<T extends ServiceClient>(clientContext: AzExtClientContext, clientType: AzExtSubscriptionClientType<T>): T;

/**
 * Creates a generic http rest client (i.e. for non-Azure calls or for Azure calls that the available sdks don't support), ensuring best practices are followed. For example:
 * 1. Adds extension-specific user agent
 * 2. Uses resourceManagerEndpointUrl to support sovereigns (if clientInfo corresponds to an Azure environment)
 * @param clientInfo The client/credentials info or `undefined` if no credentials are needed
 */
export declare function createGenericClient(context: IActionContext, clientInfo: AzExtGenericClientInfo | undefined, options?: IGenericClientOptions): Promise<ServiceClient>;

/**
 * Used to create Azure clients for managed identity without having to install the sdk into client extension package.json
 */
export declare function createManagedServiceIdentityClient(context: AzExtClientContext): Promise<ManagedServiceIdentityClient>;

export declare function createPortalUri(subscription: AzureSubscription_2 | ISubscriptionContext, id: string, options?: OpenInPortalOptions): vscode.Uri;

export declare function createResourcesClient(context: AzExtClientContext): Promise<ResourceManagementClient>;

/**
 * creates all RoleDefinitionsItem for an entire managed identity object
 */
export declare function createRoleDefinitionsItems(context: IActionContext, subscription: AzureSubscription_2 | ISubscriptionContext, msi: Identity, parentResourceId: string): Promise<RoleDefinitionsItem[]>;

/**
 * Constructs the role id for a given subscription and role name id
 *
 * @param subscriptionId - Id for the subscription
 * @param roleId - Name id for the role to be assigned (i.e CommonRoleDefinitions.storageBlobDataContributor.name)
 */
export declare function createRoleId(subscriptionId: string, roleDefinition: RoleDefinition): string;

export declare function createStorageClient(context: AzExtClientContext): Promise<StorageManagementClient>;

export declare function createSubscriptionsClient(context: AzExtClientContext): Promise<SubscriptionClient>;

export declare function getResourceGroupFromId(id: string): string;

export declare interface IAzureUtilsExtensionVariables extends UIExtensionVariables {
    prefix: string;
}

export declare const IdentityProvider: string;

export declare interface IGenericClientOptions {
    noRetryPolicy?: boolean;
    addStatusCodePolicy?: boolean;
    endpoint?: string;
}

/**
 * Currently no location-specific properties on the wizard context, but keeping this interface for backwards compatibility and ease of use
 * Instead, use static methods on `LocationListStep` like `getLocation` and `setLocationSubset`
 */
export declare interface ILocationWizardContext extends ISubscriptionActionContext {
    includeExtendedLocations?: boolean;
}

export declare interface INewStorageAccountDefaults {
    kind: StorageAccountKind;
    performance: StorageAccountPerformance;
    replication: StorageAccountReplication;
}

export declare interface IResourceGroupWizardContext extends ILocationWizardContext, IRelatedNameWizardContext {
    /**
     * Internal value indicating the last resource group name checked with `ResourceGroupVerifyStep`.
     * This name does not indicate a successful outcome from the verification step, it only indicates that the check has taken place.
     */
    _lastResourceGroupNameVerified?: string;
    /**
     * The resource group to use for new resources.
     * If an existing resource group is picked, this value will be defined after `ResourceGroupListStep.prompt` occurs
     * If a new resource group is picked, this value will be defined after the `execute` phase of the 'create' subwizard
     */
    resourceGroup?: ResourceGroup;
    /**
     * The task used to get existing resource groups.
     * By specifying this in the context, we can ensure that Azure is only queried once for the entire wizard
     */
    resourceGroupsTask?: Promise<ResourceGroup[]>;
    newResourceGroupName?: string;
    /**
     * By default, users will be prompted to select an existing resource group if creating one fails with a 403 error. Set this to `true` to prevent that behavior
     */
    suppress403Handling?: boolean;
    /**
     * Will automatically be generated by UserAssignedIdentityCreateStep if not specified by the user
     */
    newManagedIdentityName?: string;
    /**
     * The managed identity that will be assigned to the resource such as a function app or container app
     * If you need to grant access to a resource, such as a storage account or SQL database, you can use this managed identity to create a role assignment
     * with the RoleAssignmentExecuteStep
     */
    managedIdentity?: Identity;
    ui: IAzureUserInput;
}

export declare interface IStorageAccountFilters {
    kind?: StorageAccountKind[];
    performance?: StorageAccountPerformance[];
    replication?: StorageAccountReplication[];
    /**
     * If specified, a 'learn more' option will be displayed to explain why some storage accounts were filtered
     */
    learnMoreLink?: string;
}

export declare interface IStorageAccountWizardContext extends IResourceGroupWizardContext {
    /**
     * The storage account to use.
     * If an existing storage account is picked, this value will be defined after `StorageAccountListStep.prompt` occurs
     * If a new storage account is picked, this value will be defined after the `execute` phase of the 'create' subwizard
     */
    storageAccount?: StorageAccount;
    newStorageAccountName?: string;
    /**
     * This controls whether the storage account can generate connection strings.
     * This should be disabled for storage accounts that are using managed identity only.
     */
    disableSharedKeyAccess?: boolean;
}

export declare class LocationListStep<T extends ILocationWizardContext> extends AzureWizardPromptStep<T> {
    private options?;
    protected constructor(options?: IAzureQuickPickOptions | undefined);
    /**
     * Adds a LocationListStep to the wizard.  This function will ensure there is only one LocationListStep per wizard context.
     * @param wizardContext The context of the wizard
     * @param promptSteps The array of steps to include the LocationListStep to
     * @param options Options to pass to ui.showQuickPick. Options are spread onto the defaults.
     */
    static addStep<T extends ILocationWizardContext>(wizardContext: IActionContext & Partial<ILocationWizardContext>, promptSteps: AzureWizardPromptStep<T>[], options?: IAzureQuickPickOptions): void;
    private static getInternalVariables;
    /**
     * This will set the wizard context's location (in which case the user will _not_ be prompted for location)
     * For example, if the user selects an existing resource, you might want to use that location as the default for the wizard's other resources
     * This _will_ set the location even if not all providers support it - in the hopes that a related location can be found during `getLocation`
     * @param wizardContext The context of the wizard
     * @param name The name or display name of the location
     */
    static setLocation<T extends ILocationWizardContext>(wizardContext: T, name: string): Promise<void>;
    /**
     * Specify a task that will be used to filter locations
     * @param wizardContext The context of the wizard
     * @param task A task evaluating to the locations supported by this provider
     * @param provider The relevant provider (i.e. 'Microsoft.Web')
     */
    static setLocationSubset<T extends ILocationWizardContext>(wizardContext: T, task: Promise<string[]>, provider: string): void;
    /**
     * Sets a location to auto-select during prompting, if available.
     * Use this instead of `setLocation` when you want to automatically select a location
     * that respects all future resource providers.
     * @param wizardContext The context of the wizard
     * @param name The name or display name of the suggested location
     */
    static setAutoSelectLocation<T extends ILocationWizardContext>(wizardContext: T, name: string): Promise<void>;
    /**
     * Resets all location and location-related metadata on the wizard context back to its uninitialized state.
     * This includes clearing the selected location, cached location tasks, provider location maps, and any step-tracking flags.
     * Use this to ensure the wizard context is fully reset before starting a new location selection process.
     * @param wizardContext The context of the wizard
     */
    static resetLocation<T extends ILocationWizardContext>(wizardContext: T): void;
    /**
     * Adds default location filtering for a provider
     * If more granular filtering is needed, use `setLocationSubset` instead (i.e. if the provider further filters locations based on features)
     * @param wizardContext The context of the wizard
     * @param provider The provider (i.e. 'Microsoft.Storage')
     * @param resourceType The resource type (i.e. 'storageAccounts')
     */
    static addProviderForFiltering<T extends ILocationWizardContext>(wizardContext: T, provider: string, resourceType: string): void;
    /**
     * Returns true if a location has been set on the context
     */
    static hasLocation<T extends ILocationWizardContext>(wizardContext: T): boolean;
    /**
     * Used to convert a location into a home location and an extended location if the location passed in is an extended location.
     * If the location passed in is not extended, then extendedLocation will be `undefined`.
     * @param location location or extended location
     */
    static getExtendedLocation(location: AzExtLocation): {
        location: string;
        extendedLocation?: ExtendedLocation;
    };
    /**
     * Gets the `autoSelectLocation` for this wizard.  This location will be automatically selected during prompting, if available.
     * @param wizardContext The context of the wizard
     */
    static getAutoSelectLocation<T extends ILocationWizardContext>(wizardContext: T): AzExtLocation | undefined;
    /**
     * Gets the selected location for this wizard.
     * @param wizardContext The context of the wizard
     * @param provider If specified, this will check against that provider's supported locations and attempt to find a "related" location if the selected location is not supported.
     * @param supportsExtendedLocations If set to true, the location returned may be an extended location, in which case the `extendedLocation` property should be added when creating a resource
     */
    static getLocation<T extends ILocationWizardContext>(wizardContext: T, provider?: string, supportsExtendedLocations?: boolean): Promise<AzExtLocation>;
    /**
     * Used to get locations. By passing in the context, we can ensure that Azure is only queried once for the entire wizard
     * @param wizardContext The context of the wizard.
     */
    static getLocations<T extends ILocationWizardContext>(wizardContext: T): Promise<AzExtLocation[]>;
    /**
     * Returns true if the given location matches the name
     */
    static locationMatchesName(location: AzExtLocation, name: string): boolean;
    prompt(wizardContext: T): Promise<void>;
    shouldPrompt(wizardContext: T): boolean;
    protected getQuickPicks(wizardContext: T): Promise<AgentQuickPickItem<IAzureQuickPickItem<AzExtLocation>>[]>;
    static generalizeLocationName(name: string | undefined): string;
    /**
     * Implement this to set descriptions on location quick pick items.
     */
    static getQuickPickDescription?: (location: AzExtLocation) => string | undefined;
}

/**
 * Combines the root.environment.portalLink and id to open the resource in the portal.
 *
 * NOTE: If root is a tree item, it will find the subscription ancestor and get environment.portalLink from there
 */
export declare function openInPortal(root: ISubscriptionContext | AzExtTreeItem, id: string, options?: OpenInPortalOptions): Promise<void>;

export declare type OpenInPortalOptions = {
    /**
     * A query string applied directly to the host URL, e.g. "feature.staticwebsites=true" (turns on a preview feature)
     */
    queryPrefix?: string;
};

/**
 * Parses the `subscriptionId` and `resourceGroup` off of an Azure Resource Group Id
 * (also compatible with generic Azure Resource Ids)
 */
export declare function parseAzureResourceGroupId(id: string): ParsedAzureResourceGroupId;

export declare function parseAzureResourceId(id: string): ParsedAzureResourceId;

/**
 * Converts `AzExtClientContext` into a single object: `ISubscriptionActionContext`
 */
export declare function parseClientContext(clientContext: AzExtClientContext): ISubscriptionActionContext;

export declare interface ParsedAzureResourceGroupId {
    rawId: string;
    subscriptionId: string;
    resourceGroup: string;
}

export declare interface ParsedAzureResourceId {
    rawId: string;
    subscriptionId: string;
    resourceGroup: string;
    provider: string;
    resourceName: string;
}

/**
 * Call this to register common variables used throughout the azureutils package.
 */
export declare function registerAzureUtilsExtensionVariables(extVars: IAzureUtilsExtensionVariables): void;

export declare class ResourceGroupCreateStep<T extends IResourceGroupWizardContext> extends AzureWizardExecuteStepWithActivityOutput<T> {
    /**
     * 100
     */
    priority: number;
    stepName: string;
    protected getOutputLogSuccess: (context: T) => string;
    protected getOutputLogFail: (context: T) => string;
    protected getTreeItemLabel: (context: T) => string;
    private isMissingCreatePermissions;
    configureBeforeExecute(context: T): Promise<void>;
    execute(wizardContext: T, progress: Progress<{
        message?: string;
        increment?: number;
    }>): Promise<void>;
    shouldExecute(wizardContext: T): boolean;
    private _errorItemId;
    createFailOutput(context: T): ExecuteActivityOutput;
}

export declare class ResourceGroupListStep<T extends IResourceGroupWizardContext> extends AzureWizardPromptStep<T> {
    private _suppressCreate;
    constructor(suppressCreate?: boolean);
    /**
     * Used to get existing resource groups. By passing in the context, we can ensure that Azure is only queried once for the entire wizard
     * @param wizardContext The context of the wizard.
     */
    static getResourceGroups<T extends IResourceGroupWizardContext>(wizardContext: T): Promise<ResourceGroup[]>;
    /**
     * Checks existing resource groups in the wizard's subscription to see if the name is available.
     * @param wizardContext The context of the wizard.
     */
    static isNameAvailable<T extends IResourceGroupWizardContext>(wizardContext: T, name: string): Promise<boolean>;
    prompt(wizardContext: T): Promise<void>;
    getSubWizard(wizardContext: T): Promise<IWizardOptions<T> | undefined>;
    shouldPrompt(wizardContext: T): boolean;
    private getQuickPicks;
}

export declare class ResourceGroupNameStep<T extends IResourceGroupWizardContext> extends AzureWizardPromptStep<T> {
    prompt(wizardContext: T): Promise<void>;
    shouldPrompt(wizardContext: T): boolean;
    private validateResourceGroupName;
    private asyncValidateResourceGroupAvailable;
}

export declare const resourceGroupNamingRules: IAzureNamingRules;

export declare class ResourceGroupVerifyStep<T extends IResourceGroupWizardContext> extends AzureWizardExecuteStepWithActivityOutput<T> {
    /**
     * 95
     */
    priority: number;
    stepName: string;
    protected getOutputLogFail: (context: T) => string;
    protected getOutputLogSuccess(context: T): string;
    protected getTreeItemLabel(context: T): string;
    execute(context: T, progress: Progress<{
        message?: string;
        increment?: number;
    }>): Promise<void>;
    shouldExecute(context: T): boolean;
    private _errorItemId;
    createFailOutput(context: T): ExecuteActivityOutput;
}

export declare interface Role {
    /**
     * The scope of the operation or resource. Valid scopes are: subscription (format:
     *    '/subscriptions/{subscriptionId}'), resource group (format:
     *    '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format:
     *    '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
     */
    scopeId: string | undefined;
    /**
     * The role definition id of the role to assign. This can be created using `createRoleId`
     */
    roleDefinitionId: string;
    /**
     *  The name of the role definition to assign
     */
    roleDefinitionName: string;
}

export declare class RoleAssignmentExecuteStep extends AzureWizardExecuteStep<IResourceGroupWizardContext & Partial<ExecuteActivityContext>> {
    /**
     * 900
     */
    priority: number;
    execute(_wiardContext: IResourceGroupWizardContext & Partial<ExecuteActivityContext>, _progress: Progress<{
        message?: string;
        increment?: number;
    }>): Promise<void>;
    shouldExecute(_wizardContext: IResourceGroupWizardContext & Partial<ExecuteActivityContext>): boolean;
    private roles;
    /**
     * @param getScopeId A function that returns the scope id for the role assignment.
     * The scope ID is the Azure ID of the resource that we are granting access to such as a storage account.
     * Example: `/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/rgName/providers/Microsoft.Storage/storageAccounts/resourceName`
     * This typically won't exist until _after_ the wizard executes and the resource is created, so we need to pass in a function that returns the ID.
     * If the scope ID is undefined, the step will throw an error.
     * @param roles An array of roles. Each role is an object and include the ARM role definition id and name of the role definition.
     * */
    constructor(roles: () => (Role[] | Promise<Role[]> | undefined), options?: {
        priority?: number;
    });
    addExecuteSteps(_context: IResourceGroupWizardContext & Partial<ExecuteActivityContext>): Promise<AzureWizardExecuteStep<IResourceGroupWizardContext & Partial<ExecuteActivityContext>>[]>;
}

/**
 * should not be created directly; use `createRoleDefinitionsItems` instead
 */
export declare class RoleDefinitionsItem implements TreeElementBase {
    id: string;
    label: string;
    iconPath: TreeItemIconPath;
    description: string | undefined;
    roleDefintions: RoleDefinition[];
    readonly portalUrl: Uri;
    constructor(options: {
        label: string;
        id: string;
        iconPath: TreeItemIconPath;
        description: string | undefined;
        roleDefinition: RoleDefinition;
        subscription: AzureSubscription_2 | ISubscriptionContext;
        scope: string;
    });
    /**
     * Generates a unique tree item id for a `RoleDefinitionsItem`.
     * Combines the core parent resource id, managed identity id, and scope to ensure uniqueness.
     *
     * @param parentResourceId The fully qualified parent resource id (e.g. resource group, function app, container app, etc.)
     * @param msiId The fully qualified managed identity id
     * @param scope The fully qualified scope for the role assignment
     */
    static getId(parentResourceId?: string, msiId?: string, scope?: string): string;
    static createRoleDefinitionsItem(options: {
        context: IActionContext;
        scope: string;
        roleDefinition: RoleDefinition;
        msiId: string | undefined;
        parentResourceId: string;
        subContext: ISubscriptionContext;
        withDescription?: boolean;
    }): Promise<RoleDefinitionsItem>;
    private static getRoleDefinitionsResourceLabel;
    getTreeItem(): TreeItem;
    getChildren(): TreeElementBase[];
    addRoleDefinition(roleDefinition: RoleDefinition): void;
}

/**
 * Requires a RoleDefinitionsItem as a data model in its constructor. Used for v1.5 API versions of the extensions
 */
export declare class RoleDefinitionsTreeItem extends AzExtParentTreeItem {
    private readonly roleDefinitionsItem;
    label: string;
    static contextValue: string;
    readonly contextValue: string;
    constructor(parent: AzExtParentTreeItem, roleDefinitionsItem: RoleDefinitionsItem);
    loadMoreChildrenImpl(_clearCache: boolean, _context: IActionContext): Promise<AzExtTreeItem[]>;
    hasMoreChildrenImpl(): boolean;
}

/**
 * Send request with a timeout specified and turn off retry policy (because retrying could take a lot longer)
 * @param timeout The timeout in milliseconds
 * @param clientInfo The client/credentials info or `undefined` if no credentials are needed
 */
export declare function sendRequestWithTimeout(context: IActionContext, options: AzExtRequestPrepareOptions, timeout: number, clientInfo: AzExtGenericClientInfo): Promise<AzExtPipelineResponse>;

/**
 * Pipe Azure SDK logs into the provided log output channel using the @azure/logger package.
 *
 * @param logOutputChannel - log output channel to pipe logs into
 */
export declare function setupAzureLogger(logOutputChannel: vscode.LogOutputChannel): vscode.Disposable;

export declare class StorageAccountCreateStep<T extends IStorageAccountWizardContext> extends AzureWizardExecuteStepWithActivityOutput<T> {
    stepName: string;
    /**
     * 130
     */
    priority: number;
    private readonly _defaults;
    constructor(defaults: INewStorageAccountDefaults);
    execute(wizardContext: T, progress: Progress<{
        message?: string;
        increment?: number;
    }>): Promise<void>;
    protected getTreeItemLabel(context: T): string;
    protected getOutputLogSuccess(context: T): string;
    protected getOutputLogFail(context: T): string;
    protected getOutputLogProgress(context: T): string;
    shouldExecute(wizardContext: T): boolean;
}

export declare enum StorageAccountKind {
    Storage = "Storage",
    StorageV2 = "StorageV2",
    BlobStorage = "BlobStorage",
    BlockBlobStorage = "BlockBlobStorage"
}

export declare class StorageAccountListStep<T extends IStorageAccountWizardContext> extends AzureWizardPromptStep<T> {
    private readonly _newAccountDefaults;
    private readonly _filters;
    /**
     * @param createOptions Default options to use when creating a Storage Account
     * @param filterOptions Optional filters used when listing Storage Accounts
     */
    constructor(newAccountDefaults: INewStorageAccountDefaults, filters?: IStorageAccountFilters);
    static isNameAvailable<T extends IStorageAccountWizardContext>(wizardContext: T, name: string): Promise<boolean>;
    prompt(wizardContext: T): Promise<void>;
    getSubWizard(wizardContext: T): Promise<IWizardOptions<T> | undefined>;
    shouldPrompt(wizardContext: T): boolean;
    private getQuickPicks;
}

export declare class StorageAccountNameStep<T extends IStorageAccountWizardContext> extends AzureNameStep<T> {
    prompt(wizardContext: T): Promise<void>;
    shouldPrompt(wizardContext: T): boolean;
    protected isRelatedNameAvailable(wizardContext: T, name: string): Promise<boolean>;
    private validateStorageAccountName;
}

export declare const storageAccountNamingRules: IAzureNamingRules;

export declare enum StorageAccountPerformance {
    Standard = "Standard",
    Premium = "Premium"
}

export declare enum StorageAccountReplication {
    /**
     * Locally redundant storage
     */
    LRS = "LRS",
    /**
     * Zone-redundant storage
     */
    ZRS = "ZRS",
    /**
     * Geo-redundant storage
     */
    GRS = "GRS",
    /**
     * Read-access geo-redundant storage
     */
    RAGRS = "RAGRS"
}

/**
 * Implement this class to display resources under a standard subscription tree item
 */
export declare abstract class SubscriptionTreeItemBase extends AzExtParentTreeItem {
    static readonly contextValue: string;
    readonly contextValue: string;
    readonly label: string;
    constructor(parent: AzExtParentTreeItem | undefined, subscription: ISubscriptionContext);
}

export declare namespace uiUtils {
    export interface IPartialList<T> extends Array<T> {
        nextLink?: string;
    }
    export function listAll<T>(client: {
        listNext(nextPageLink: string): Promise<IPartialList<T>>;
    }, first: Promise<IPartialList<T>>): Promise<T[]>;
    export function listAllIterator<T>(iterator: PagedAsyncIterableIterator<T>): Promise<T[]>;
}

/**
 * @deprecated The Azure Account extension is deprecated.
 */
export declare interface UploadOptions {
    contentLength?: number;
    progress?: Progress<{
        message?: string;
        increment?: number;
    }>;
    token?: CancellationToken;
}

/**
 * Naming constraints:
 * The resource name must start with a letter or number,
 * have a length between 3 and 128 characters and
 * can only contain a combination of alphanumeric characters, hyphens and underscores
 * But since we are appending "-identities" to the resource group name and that has the same constraints and a 90 character limit,
 * we don't need to do any verification
 **/
export declare class UserAssignedIdentityCreateStep<T extends IResourceGroupWizardContext> extends AzureWizardExecuteStepWithActivityOutput<T> {
    /**
     * We should create this immediately after the resource group is created
     * 101
     */
    priority: number;
    stepName: string;
    execute(wizardContext: T, _progress: Progress<{
        message?: string;
        increment?: number;
    }>): Promise<void>;
    shouldExecute(wizardContext: T): boolean;
    configureBeforeExecute(wizardContext: T): Promise<void>;
    protected getTreeItemLabel(context: T): string;
    protected getOutputLogSuccess(context: T): string;
    protected getOutputLogFail(context: T): string;
    protected getOutputLogProgress(context: T): string;
}

export declare class UserAssignedIdentityListStep<T extends IResourceGroupWizardContext> extends AzureWizardPromptStep<T> {
    private _suppressCreate;
    constructor(suppressCreate?: boolean);
    prompt(wizardContext: T): Promise<void>;
    shouldPrompt(wizardContext: T): boolean;
    getSubWizard(wizardContext: T): Promise<IWizardOptions<T> | undefined>;
    private getQuickPicks;
}

export declare class UserAssignedIdentityNameStep<T extends IResourceGroupWizardContext> extends AzureWizardPromptStep<T> {
    prompt(context: T): Promise<void>;
    shouldPrompt(context: T): boolean;
    private validateInput;
    private asyncValidateUserAssignedIdentityAvailable;
    static isNameAvailable(context: IResourceGroupWizardContext, rgName: string, identityName: string): Promise<boolean>;
    static tryGenerateRelatedName(context: IResourceGroupWizardContext, rgName: string): Promise<string | undefined>;
}

export declare const UserAssignedIdentityResourceType: string;

/**
 * Checks to see if providers (i.e. 'Microsoft.Web') are registered and registers them if they're not
 */
export declare class VerifyProvidersStep<T extends ISubscriptionActionContext> extends AzureWizardExecuteStep<T> {
    /**
     * 90
     */
    priority: number;
    private _providers;
    /**
     * @param providers List of providers to verify
     */
    constructor(providers: string[]);
    execute(context: T, progress: Progress<{
        message?: string;
        increment?: number;
    }>): Promise<void>;
    shouldExecute(_context: T): boolean;
}

export { }

Copilot assures me that there are only a couple of maybe breaking changes.

Breaking Signature Changes

1. RoleAssignmentExecuteStep — type parameters removed

  • index.d.ts: RoleAssignmentExecuteStep<T extends IResourceGroupWizardContext, TKey extends keyof T>
  • Generated: RoleAssignmentExecuteStep (no type parameters; uses concrete IResourceGroupWizardContext & Partial<ExecuteActivityContext>)
  • Any consumer specifying <T, TKey> will get a compile error.

2. AzureAccountTreeItemBase.getSubscriptionPromptStep — stricter parameter

  • index.d.ts: wizardContext: Partial<ISubscriptionActionContext>
  • Generated: context: Partial<ISubscriptionActionContext> & IActionContext
  • Callers not passing an IActionContext-compatible object will break.

3. AzureAccountTreeItemBase constructor — narrower testAccount type

  • index.d.ts: testAccount?: {}
  • Generated: testAccount?: AzureAccountExtensionApi
  • Callers passing a plain object will break (though this is an unofficial testing API, so lower risk).

4. createAzureSubscriptionClient — generic constraint added

  • index.d.ts: <T>
  • Generated: <T extends ServiceClient>
  • Breaks if anyone instantiates with a type that doesn't extend ServiceClient.

Base Class Changes

5. StorageAccountCreateStep — base class widened

  • index.d.ts: extends AzureWizardExecuteStep
  • Generated: extends AzureWizardExecuteStepWithActivityOutput
  • Safe if AzureWizardExecuteStepWithActivityOutput extends AzureWizardExecuteStep, but subclasses may now need to implement additional abstract methods.

6. UserAssignedIdentityCreateStep — same base class change as above

Structural Changes

7. RoleDefinitionsItem — changed from type alias to class

  • index.d.ts: Simple type with getChildren, getTreeItem, id
  • Generated: Full class with a specific constructor and many more properties
  • Code creating RoleDefinitionsItem objects as plain objects will break (though the docs say to use createRoleDefinitionsItems instead).

Additions in Generated (non-breaking but notable)

  • createResourcesClient, createSubscriptionsClient — new functions
  • uiUtils.listAll, uiUtils.IPartialList — present in generated, missing from index.d.ts
  • UserAssignedIdentityListStep.getSubWizard — new public method
  • ResourceGroupListStep constructor (suppressCreate?: boolean) now visible
  • ResourceGroupVerifyStep.createFailOutput, ResourceGroupCreateStep.createFailOutput — new public methods
  • RoleAssignmentExecuteStep.addExecuteSteps — new public method
  • RoleDefinitionsTreeItem.contextValue (static + instance) — now declared
  • Deprecated Azure Account types (AzureAccountExtensionApi, AzureSession, AzureSubscription, CloudShell, UploadOptions, etc.) — newly exported

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Probably version this as an alpha

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert changes to this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this file

description: "Allows for read, write and delete access to Azure Storage blob containers and data",
roleType: "BuiltInRole"
} as RoleDefinition,
} as const,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes make it so the full values and everything show up in the declarations. Otherwise it just does export declare const ....

export * from './wizard/StorageAccountNameStep';
export * from './wizard/UserAssignedIdentityCreateStep';
export * from './wizard/UserAssignedIdentityListStep';
export * from './wizard/UserAssignedIdentityNameStep';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this was never actually exported? Need to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant