Skip to content

Commit

Permalink
SlotSetting Bug (#12413)
Browse files Browse the repository at this point in the history
* SlotSetting Bug

* Comments reviewed
  • Loading branch information
eaarora-ms authored Mar 4, 2020
1 parent a650892 commit 2f764c0
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Tasks/AzureAppServiceSettingsV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 1,
"Minor": 163,
"Patch": 2
"Patch": 3
},
"preview": "true",
"minimumAgentVersion": "2.104.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureAppServiceSettingsV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 1,
"Minor": 163,
"Patch": 2
"Patch": 3
},
"preview": "true",
"minimumAgentVersion": "2.104.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFunctionAppContainerV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 1,
"Minor": 163,
"Patch": 3
"Patch": 4
},
"minimumAgentVersion": "2.104.1",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFunctionAppContainerV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 1,
"Minor": 163,
"Patch": 3
"Patch": 4
},
"minimumAgentVersion": "2.104.1",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFunctionAppV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 1,
"Minor": 163,
"Patch": 3
"Patch": 4
},
"minimumAgentVersion": "2.104.1",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFunctionAppV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 1,
"Minor": 163,
"Patch": 3
"Patch": 4
},
"minimumAgentVersion": "2.104.1",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureWebAppContainerV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 1,
"Minor": 163,
"Patch": 3
"Patch": 4
},
"minimumAgentVersion": "2.104.1",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureWebAppContainerV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 1,
"Minor": 163,
"Patch": 3
"Patch": 4
},
"minimumAgentVersion": "2.104.1",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureWebAppV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 1,
"Minor": 163,
"Patch": 3
"Patch": 4
},
"minimumAgentVersion": "2.104.1",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureWebAppV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 1,
"Minor": 163,
"Patch": 3
"Patch": 4
},
"minimumAgentVersion": "2.104.1",
"groups": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,17 @@ export class AzureAppService {
var appSettingsSlotSettings = await this.getSlotConfigurationNames();
let appSettingNames = appSettingsSlotSettings.properties.appSettingNames;
var isNewValueUpdated: boolean = false;
if(appSettingNames) {
for(var key in addProperties) {
if(addProperties[key].slotSetting == true) {
if((appSettingNames.length == 0) || (!appSettingNames.includes(addProperties[key].name))) {
appSettingNames.push(addProperties[key].name);
}
tl.debug(`Slot setting updated for key : ${addProperties[key].name}`);
isNewValueUpdated = true;
for(var key in addProperties) {
if(!appSettingNames) {
appSettingsSlotSettings.properties.appSettingNames = [];
appSettingNames = appSettingsSlotSettings.properties.appSettingNames;
}
if(addProperties[key].slotSetting == true) {
if((appSettingNames.length == 0) || (!appSettingNames.includes(addProperties[key].name))) {
appSettingNames.push(addProperties[key].name);
}
tl.debug(`Slot setting updated for key : ${addProperties[key].name}`);
isNewValueUpdated = true;
}
}

Expand Down Expand Up @@ -435,15 +437,17 @@ export class AzureAppService {
var connectionStringSlotSettings = await this.getSlotConfigurationNames();
let connectionStringNames = connectionStringSlotSettings.properties.connectionStringNames;
var isNewValueUpdated: boolean = false;
if(connectionStringNames) {
for(var key in addProperties) {
if(addProperties[key].slotSetting == true) {
if((connectionStringNames.length == 0) || (!connectionStringNames.includes(key))) {
connectionStringNames.push(key);
}
tl.debug(`Slot setting updated for key : ${key}`);
isNewValueUpdated = true;
for(var key in addProperties) {
if(!connectionStringNames) {
connectionStringSlotSettings.properties.connectionStringNames = [];
connectionStringNames = connectionStringSlotSettings.properties.connectionStringNames;
}
if(addProperties[key].slotSetting == true) {
if((connectionStringNames.length == 0) || (!connectionStringNames.includes(key))) {
connectionStringNames.push(key);
}
tl.debug(`Slot setting updated for key : ${key}`);
isNewValueUpdated = true;
}
}

Expand Down

0 comments on commit 2f764c0

Please sign in to comment.