Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure App service Manage & Deploy Task Spec changes #4125

Merged
merged 18 commits into from
May 4, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"loc.messages.ScriptStatusTimeout": "Unable to fetch script status due to timeout.",
"loc.messages.PollingForFileTimeOut": "Unable to fetch script status due to timeout. You can increase the timeout limit by setting 'appservicedeploy.retrytimeout' variable to number of minutes required.",
"loc.messages.InvalidPollOption": "Invalid polling option provided: %s.",
"loc.messages.MissingWebConfigParameters": "Some web.config parameters are missing",
"loc.messages.MissingAppTypeWebConfigParameters": "-appType attribute is missing in Web.config parameters.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is apptype the only config param that can be missing? Should we also report if other required parameters are not present?

Copy link
Contributor Author

@vincent1173 vincent1173 Apr 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can override with default values. I ll update it in this PR.

"loc.messages.AutoDetectDjangoSettingsFailed": "Unable to detect DJANGO_SETTINGS_MODULE (settings.py). Please ensure that the file exists or provide the correct path in Web.config parameters input in the following format '<folder_name>.settings'",
"loc.messages.FailedToApplyTransformation": "Unable to apply transformation for the given package. Please follow below steps to debug the issue. \n1. Transformation is applied for MSBuild generated packge during build time. Remove <DependentUpon> Tag for each config file. \n2. Ensure that the config file and transformation file are present in the same folder inside the package.",
"loc.messages.AutoParameterizationMessage": "ConnectionString attributes in Web.config is parameterized by default. Please be aware that transformation has no effect on connectioString attributes as the same value is overridden during deployment. You can disable the auto parameterization by setting /p:AutoParameterizationWebConfigConnectionStrings=False during MSBuild package generation."
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureRmWebAppDeployment/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@
"ScriptStatusTimeout": "Unable to fetch script status due to timeout.",
"PollingForFileTimeOut": "Unable to fetch script status due to timeout. You can increase the timeout limit by setting 'appservicedeploy.retrytimeout' variable to number of minutes required.",
"InvalidPollOption": "Invalid polling option provided: %s.",
"MissingWebConfigParameters": "Some web.config parameters are missing",
"MissingAppTypeWebConfigParameters": "-appType attribute is missing in Web.config parameters.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attribute '-appType' is missing in the Web.config parameters. Valid values for '-appType' are: 'python_Bottle', 'python_Django', 'python_Flask' and 'node'.

For example, '-appType python_Bottle' (sans-quotes) in case of Python Bottle framework.

"AutoDetectDjangoSettingsFailed": "Unable to detect DJANGO_SETTINGS_MODULE (settings.py). Please ensure that the file exists or provide the correct path in Web.config parameters input in the following format '<folder_name>.settings'",
Copy link
Member

@RoopeshNair RoopeshNair May 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Unable to detect DJANGO_SETTINGS_MODULE 'settings.py' file path. Ensure that the 'settings.py' file exists or provide the correct path in Web.config parameter input in the following format '-DJANGO_SETTINGS_MODULE <folder_name>.settings'",

"FailedToApplyTransformation": "Unable to apply transformation for the given package. Please follow below steps to debug the issue. \n1. Transformation is applied for MSBuild generated packge during build time. Remove <DependentUpon> Tag for each config file. \n2. Ensure that the config file and transformation file are present in the same folder inside the package.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Unable to apply transformation for the given package. Verify the following. \n1. Whether the Transformation is already applied for the MSBuild generated package during build. If yes, remove the tag for each config in the csproj file and rebuild. \n2. Ensure that the config file and transformation files are present in the same folder inside the package.",

"AutoParameterizationMessage": "ConnectionString attributes in Web.config is parameterized by default. Please be aware that transformation has no effect on connectioString attributes as the same value is overridden during deployment. You can disable the auto parameterization by setting /p:AutoParameterizationWebConfigConnectionStrings=False during MSBuild package generation."
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureRmWebAppDeployment/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@
"ScriptStatusTimeout": "ms-resource:loc.messages.ScriptStatusTimeout",
"PollingForFileTimeOut": "ms-resource:loc.messages.PollingForFileTimeOut",
"InvalidPollOption": "ms-resource:loc.messages.InvalidPollOption",
"MissingWebConfigParameters": "ms-resource:loc.messages.MissingWebConfigParameters",
"MissingAppTypeWebConfigParameters": "ms-resource:loc.messages.MissingAppTypeWebConfigParameters",
"AutoDetectDjangoSettingsFailed": "ms-resource:loc.messages.AutoDetectDjangoSettingsFailed",
"FailedToApplyTransformation": "ms-resource:loc.messages.FailedToApplyTransformation",
"AutoParameterizationMessage": "ms-resource:loc.messages.AutoParameterizationMessage"
Expand Down
38 changes: 19 additions & 19 deletions Tasks/Common/webdeployment-common/webconfigutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@ export function addWebConfigFile(folderPath: any, webConfigParameters, rootDirec
//Generate the web.config file if it does not already exist.
var webConfigPath = path.join(folderPath, "web.config");
if (!tl.exist(webConfigPath)) {
tl.debug('web.config file does not exist. Generating.');
if(!webConfigParameters || !webConfigParameters['appType']) {
throw new Error(tl.loc("FailedToGenerateWebConfig", tl.loc("MissingWebConfigParameters")));
}
var appType: string = webConfigParameters['appType'].value;
delete webConfigParameters['appType'];
if(appType != "node") {
rootDirectoryPath = "D:\\home\\" + (rootDirectoryPath ? rootDirectoryPath : "site\\wwwroot");
tl.debug('Root Directory path to be set on web.config: ' + rootDirectoryPath);
webConfigParameters['KUDU_WORKING_DIRECTORY'] = {
value: rootDirectoryPath
};
}
if(appType === 'python_Django' && webConfigParameters['DJANGO_SETTINGS_MODULE'].value === '') {
tl.debug('Auto detecting settings.py to set DJANGO_SETTINGS_MODULE...');
webConfigParameters['DJANGO_SETTINGS_MODULE'] = {
value: getDjangoSettingsFile(folderPath)
};
}
try {
// Create web.config
tl.debug('web.config file does not exist. Generating.');
if(!webConfigParameters['appType']) {
throw new Error(tl.loc("MissingAppTypeWebConfigParameters"));
}
var appType: string = webConfigParameters['appType'].value;
delete webConfigParameters['appType'];
if(appType != "node") {
rootDirectoryPath = "D:\\home\\" + (rootDirectoryPath ? rootDirectoryPath : "site\\wwwroot");
tl.debug('Root Directory path to be set on web.config: ' + rootDirectoryPath);
webConfigParameters['KUDU_WORKING_DIRECTORY'] = {
value: rootDirectoryPath
};
}
if(appType === 'python_Django' && webConfigParameters['DJANGO_SETTINGS_MODULE'].value === '') {
tl.debug('Auto detecting settings.py to set DJANGO_SETTINGS_MODULE...');
webConfigParameters['DJANGO_SETTINGS_MODULE'] = {
value: getDjangoSettingsFile(folderPath)
};
}
generateWebConfigFile(webConfigPath, appType, webConfigParameters);
console.log(tl.loc("SuccessfullyGeneratedWebConfig"));
}
Expand Down