Skip to content

Commit

Permalink
fix(core.gbapp): Self-replication on Azure
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed May 27, 2019
1 parent 2509157 commit 5f0fb3b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
25 changes: 10 additions & 15 deletions packages/azuredeployer.gbapp/services/AzureDeployerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,18 +404,9 @@ export class AzureDeployerService implements IGBInstallationDeployer {
instance.botEndpoint = this.defaultEndPoint;

instance = await this.internalDeployBot(
instance,
this.accessToken,
name,
name,
name,
'General BootBot',
`${proxyAddress}/api/messages/${name}`,
'global',
instance.nlpAppId,
instance.nlpKey,
instance.marketplaceId,
instance.marketplacePassword,
instance, this.accessToken, name, name, name, 'General BootBot',
`${proxyAddress}/api/messages/${name}`, 'global',
instance.nlpAppId, instance.nlpKey, instance.marketplaceId, instance.marketplacePassword,
instance.cloudSubscriptionId
);

Expand All @@ -424,6 +415,10 @@ export class AzureDeployerService implements IGBInstallationDeployer {

spinner.stop();

GBLog.info('Opening your browser with default.gbui...');
const opn = require('opn');
opn(`https://${serverName}.azurewebsites.net`);

return instance;
}

Expand Down Expand Up @@ -451,7 +446,7 @@ export class AzureDeployerService implements IGBInstallationDeployer {

const credentials = await GBAdminService.getADALCredentialsFromUsername(username, password);
// tslint:disable-next-line:no-http-string
const url = `http://${instance.botId}.azurewebsites.net`;
const url = `https://${instance.botId}.azurewebsites.net`;
this.deployFarm(url, instance, credentials, subscriptionId);
}

Expand Down Expand Up @@ -713,7 +708,6 @@ export class AzureDeployerService implements IGBInstallationDeployer {
};

await this.webSiteClient.webApps.createOrUpdateSourceControl(group, name, souceControlConfig);
// await this.webSiteClient.webApps.syncRepository(name, name);

return server;
}
Expand All @@ -725,10 +719,11 @@ export class AzureDeployerService implements IGBInstallationDeployer {
serverFarmId: serverFarmId,
siteConfig: {
appSettings: [
{ name: 'WEBSITES_CONTAINER_START_TIME_LIMIT', value: webSiteResponseTimeout },
{ name: 'WEBSITES_CONTAINER_START_TIME_LIMIT', value: WebSiteResponseTimeout },
{ name: 'WEBSITE_NODE_DEFAULT_VERSION', value: GBAdminService.getNodeVersion() },
{ name: 'ADDITIONAL_DEPLOY_PATH', value: `` },
{ name: 'ADMIN_PASS', value: `${instance.adminPass}` },
{ name: 'BOT_ID', value: `${instance.botId}` },
{ name: 'CLOUD_SUBSCRIPTIONID', value: `${instance.cloudSubscriptionId}` },
{ name: 'CLOUD_LOCATION', value: `${instance.cloudLocation}` },
{ name: 'CLOUD_GROUP', value: `${instance.botId}` },
Expand Down
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class GBServer {
GBLog.info(`Establishing a development local proxy (ngrok)...`);
GBServer.globals.publicAddress = await core.ensureProxy(port);
} else {
const serverAddress = `http://${process.env.WEBSITE_SITE_NAME}.azurewebsites.net`;
const serverAddress = `https://${process.env.WEBSITE_SITE_NAME}.azurewebsites.net`;
GBLog.info(`Defining server address at ${serverAddress}...`);
GBServer.globals.publicAddress = serverAddress;
}
Expand Down

0 comments on commit 5f0fb3b

Please sign in to comment.