Skip to content

Commit

Permalink
[DC] Set default auth type to publish profile for containers, save sc…
Browse files Browse the repository at this point in the history
…m settings (#7523)
  • Loading branch information
yoonaoh committed Jan 8, 2024
1 parent b03bd21 commit 30f2ac4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
getTelemetryInfo,
isSettingsDirty,
isFtpsDirty,
isScmTypeValidForContainers,
} from '../utility/DeploymentCenterUtility';
import { ACRWebhookPayload } from '../../../../models/acr';
import { ScmType, SiteConfig } from '../../../../models/site/config';
Expand Down Expand Up @@ -324,6 +325,7 @@ const DeploymentCenterContainerForm: React.FC<DeploymentCenterContainerFormProps
siteConfigResponse.data.properties.acrUserManagedIdentityID = '';
}

siteConfigResponse.data.properties.scmType = values.scmType;
if (values.scmType !== ScmType.GitHubAction) {
if (siteContext.isLinuxApp) {
siteConfigResponse.data.properties.linuxFxVersion = getFxVersion(values);
Expand Down Expand Up @@ -752,11 +754,12 @@ const DeploymentCenterContainerForm: React.FC<DeploymentCenterContainerFormProps
};
portalContext.log(getTelemetryInfo('info', 'saveDeploymentSettings', 'start', deploymentProperties));

// Only do the save if scmType in the config is set to none.
// Only do the save if scmType in the config is set to none, or if the scmType was invalid for containers.
// If the scmType in the config is not none, the user should be doing a disconnect operation first.
// This check is in place, because the use could set the form props ina dirty state by just modifying the
// This check is in place, because the use could set the form props in a dirty state by just modifying the
// publishing user information.
if (deploymentCenterContext.siteConfig && deploymentCenterContext.siteConfig.properties.scmType === ScmType.None) {
const initialScmType = deploymentCenterContext.siteConfig?.properties.scmType;
if (initialScmType && (initialScmType === ScmType.None || !isScmTypeValidForContainers(initialScmType))) {
if (values.scmType === ScmType.GitHubAction) {
await saveGithubActionContainerSettings(values, deploymentProperties);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
PrivateRegistryFormData,
ACRCredentialType,
ManagedIdentityType,
AuthType,
} from '../DeploymentCenter.types';
import * as Yup from 'yup';
import { DeploymentCenterFormBuilder } from '../DeploymentCenterFormBuilder';
Expand Down Expand Up @@ -51,6 +52,7 @@ export class DeploymentCenterContainerFormBuilder extends DeploymentCenterFormBu
...this._getDockerHubFormData(serverUrl, username, password, fxVersionParts),
...this._getPrivateRegistryFormData(serverUrl, username, password, fxVersionParts),
...this.generateCommonFormData(),
authType: AuthType.PublishProfile, // NOTE(yoonaoh): We will eventually remove this once ANT101 is deployed and we add OIDC support for Containers
};
}

Expand Down

0 comments on commit 30f2ac4

Please sign in to comment.