Skip to content

Commit

Permalink
update settings (#7757)
Browse files Browse the repository at this point in the history
  • Loading branch information
spellegrino021 authored Aug 1, 2024
1 parent b48303f commit c3e1a0d
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 3 deletions.
1 change: 1 addition & 0 deletions client-react/src/models/site/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export interface Site {
sshEnabled?: boolean | null;
endToEndEncryptionEnabled?: boolean;
functionAppConfig?: FunctionAppConfig;
functionsRuntimeAdminIsolationEnabled?: boolean;
}

export interface HostNameSslState {
Expand Down
13 changes: 11 additions & 2 deletions client-react/src/pages/app/app-settings/AppSettingsDataLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ const AppSettingsDataLoader: React.FC<AppSettingsDataLoaderProps> = props => {
if (isFunctionApp(site.data)) {
const os = isLinux ? AppStackOs.linux : AppStackOs.windows;
const stack = site.data.properties.functionAppConfig?.runtime?.name;
const stackValueForStacksAPI = (stack === RuntimeStacks.dotnetIsolated || stack === RuntimeStacks.dotnet) ? RuntimeStacks.dotnet : stack;
const stackValueForStacksAPI =
stack === RuntimeStacks.dotnetIsolated || stack === RuntimeStacks.dotnet ? RuntimeStacks.dotnet : stack;
const stacksResponse =
isFlexConsumption(site.data) && stackValueForStacksAPI
? await RuntimeStackService.getFunctionAppConfigurationStackForLocation(os, site.data.location, stackValueForStacksAPI)
Expand Down Expand Up @@ -246,11 +247,19 @@ const AppSettingsDataLoader: React.FC<AppSettingsDataLoaderProps> = props => {
}

const sshEnabled = site.data.properties.sshEnabled;
const functionsRuntimeAdminIsolationEnabled: boolean = !!site.data.properties.functionsRuntimeAdminIsolationEnabled;

setInitialValues({
...convertStateToForm({
// @note(krmitta): Manually over-writing since the api returns null when sshEnabled property is not set in the database but the default is true
site: { ...site.data, properties: { ...site.data.properties, sshEnabled: isLinux && sshEnabled === null ? true : sshEnabled } },
site: {
...site.data,
properties: {
...site.data.properties,
sshEnabled: isLinux && sshEnabled === null ? true : sshEnabled,
functionsRuntimeAdminIsolationEnabled: functionsRuntimeAdminIsolationEnabled,
},
},
config: webConfig.data,
metadata: metadata.metadata.success ? metadata.data : null,
connectionStrings: connectionStrings.metadata.success ? connectionStrings.data : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,31 @@ const Platform: React.FC<FormikProps<AppSettingsFormValues>> = props => {
infoBubbleMessage={t('portCountRange').format(VnetPrivatePortsCount.min, VnetPrivatePortsCount.max)}
/>
)}
{scenarioChecker.checkScenario(ScenarioIds.functionsAdminIsolationSupported, { site }).status !== 'disabled' && (
<Field
name="site.properties.functionsRuntimeAdminIsolationEnabled"
id="app-settings-functionsRuntimeAdminIsolationEnabled"
label={t('functionsAdminIsolation')}
infoBubbleMessage={t('functionsAdminIsolationInfoBubble')}
learnMoreLink={Links.functionsRuntimeAdminIsolationEnabled}
component={RadioButton}
dirty={
values.site.properties.functionsRuntimeAdminIsolationEnabled !==
initialValues.site.properties.functionsRuntimeAdminIsolationEnabled
}
disabled={disableAllControls}
options={[
{
key: true,
text: t('on'),
},
{
key: false,
text: t('off'),
},
]}
/>
)}
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ const platformDirty = (values: AppSettingsFormValues, initialValues: AppSettings
!isEqual(values.site.properties.clientAffinityEnabled, initialValues.site.properties.clientAffinityEnabled) ||
!isEqual(values.config.properties.webSocketsEnabled, initialValues.config.properties.webSocketsEnabled) ||
!isEqual(values.config.properties.minTlsCipherSuite, initialValues.config.properties.minTlsCipherSuite) ||
!isEqual(!!values.site.properties.endToEndEncryptionEnabled, !!initialValues.site.properties.endToEndEncryptionEnabled)
!isEqual(!!values.site.properties.endToEndEncryptionEnabled, !!initialValues.site.properties.endToEndEncryptionEnabled) ||
!isEqual(
!!values.site.properties.functionsRuntimeAdminIsolationEnabled,
!!initialValues.site.properties.functionsRuntimeAdminIsolationEnabled
)
);
};

Expand Down
1 change: 1 addition & 0 deletions client-react/src/utils/FwLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const Links = {
customErrorPagesLearnMore: 'https://go.microsoft.com/fwlink/?linkid=2245451',
endToEndEncryptionLearnMore: 'https://go.microsoft.com/fwlink/?linkid=2252411',
disableBasicAuthLearnMore: 'https://go.microsoft.com/fwlink/?linkid=2260316',
functionsRuntimeAdminIsolationEnabled: 'https://go.microsoft.com/fwlink/?linkid=2281478',
};

export const DeploymentCenterLinks = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ export class DynamicLinuxEnvironment extends Environment {
return { status: 'disabled' };
},
};

this.scenarioChecks[ScenarioIds.functionsAdminIsolationSupported] = {
id: ScenarioIds.functionsAdminIsolationSupported,
runCheck: () => {
return { status: 'disabled' };
},
};
}

public isCurrentEnvironment(input?: ScenarioCheckInput): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ export class FlexConsumptionEnvironment extends Environment {
return { status: 'disabled' };
},
};

this.scenarioChecks[ScenarioIds.functionsAdminIsolationSupported] = {
id: ScenarioIds.functionsAdminIsolationSupported,
runCheck: () => {
return { status: 'disabled' };
},
};
}

public isCurrentEnvironment(input?: ScenarioCheckInput): boolean {
Expand Down
1 change: 1 addition & 0 deletions client-react/src/utils/scenario-checker/scenario-ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,5 @@ export class ScenarioIds {
public static readonly enableE2ETlsEncryption = 'enableE2ETlsEncryption';
public static readonly ftpBasicAuthSupported = 'ftpBasicAuthSupported';
public static readonly ipModeSupported = 'ipModeSupported';
public static readonly functionsAdminIsolationSupported = 'functionsAdminIsolationSupported';
}
2 changes: 2 additions & 0 deletions client/src/app/shared/models/portal-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,8 @@ export class PortalResources {
public static diagnoseAndSolveProblems = 'diagnoseAndSolveProblems';
public static stackSettings = 'stackSettings';
public static platformSettings = 'platformSettings';
public static functionsAdminIsolation = 'functionsAdminIsolation';
public static functionsAdminIsolationInfoBubble = 'functionsAdminIsolationInfoBubble';
public static debugging = 'debugging';
public static modifiedTag = 'modifiedTag';
public static directToEnvironmentVariablesInfoMessage = 'directToEnvironmentVariablesInfoMessage';
Expand Down
6 changes: 6 additions & 0 deletions server/Resources/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4589,6 +4589,12 @@ Set to "External URL" to use an API definition that is hosted elsewhere.</value>
<data name="platformSettings" xml:space="preserve">
<value>Platform settings</value>
</data>
<data name="functionsAdminIsolation" xml:space="preserve">
<value>Functions admin isolation</value>
</data>
<data name="functionsAdminIsolationInfoBubble" xml:space="preserve">
<value>Enable this feature to require Function App administrative actions to go through Azure Resource Manager.</value>
</data>
<data name="debugging" xml:space="preserve">
<value>Debugging</value>
</data>
Expand Down

0 comments on commit c3e1a0d

Please sign in to comment.