in src/tree/StorageAccountTreeItem.ts [295:327]
public async browseStaticWebsite(context: IActionContext): Promise<void> {
const configure: MessageItem = {
title: "Configure website hosting"
};
const hostingStatus = await this.getActualWebsiteHostingStatus();
await this.ensureHostingCapable(context, hostingStatus);
if (!hostingStatus.enabled) {
const msg = "Static website hosting is not enabled for this storage account.";
const result = await window.showErrorMessage(msg, configure);
if (result === configure) {
await commands.executeCommand('azureStorage.configureStaticWebsite', this);
}
throw new UserCancelledError(msg);
}
if (!hostingStatus.indexDocument) {
const msg = "No index document has been set for this website.";
const result = await window.showErrorMessage(msg, configure);
if (result === configure) {
await commands.executeCommand('azureStorage.configureStaticWebsite', this);
}
throw new UserCancelledError(msg);
}
const endpoint = this.getPrimaryWebEndpoint();
if (endpoint) {
await openUrl(endpoint);
} else {
throw new Error(`Could not retrieve the primary web endpoint for ${this.label}`);
}
}