Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'upstream/dev' into dev

Conflicts:
	WindowsAzurePowershell/setup/azurecmd.wxs
	WindowsAzurePowershell/src/Management.WebSites/Services/GithubClient.cs
  • Loading branch information...
commit 3acdaed7fe3978f9c26a58a5a4151ec7e6a5dc19 2 parents 6b08e8f + b48e5c6
@andrerod andrerod authored
Showing with 19,071 additions and 3,229 deletions.
  1. +3 −3 WindowsAzurePowershell/setup/azurecmd.wxs
  2. +167 −631 WindowsAzurePowershell/setup/azurecmdfiles.wxi
  3. +1 −1  WindowsAzurePowershell/src/Management.CloudService.Test/Management.CloudService.Test.csproj
  4. +11 −7 WindowsAzurePowershell/src/Management.CloudService.Test/Tests/Cmdlet/AddAzureCacheWorkerRoleTests.cs
  5. +217 −0 WindowsAzurePowershell/src/Management.CloudService.Test/Tests/Cmdlet/EnableAzureMemcacheRoleTests.cs
  6. +0 −61 WindowsAzurePowershell/src/Management.CloudService.Test/Tests/Cmdlet/EnableAzureMemcacheTests.cs
  7. +2 −2 WindowsAzurePowershell/src/Management.CloudService.Test/Tests/Cmdlet/PublishAzureServiceCommandTests.cs
  8. +20 −0 WindowsAzurePowershell/src/Management.CloudService.Test/Tests/Model/ServiceSettingsTests.cs
  9. +10 −6 WindowsAzurePowershell/src/Management.CloudService.Test/Utilities/AzureAssert.cs
  10. +47 −20 WindowsAzurePowershell/src/Management.CloudService/Cmdlet/AddAzureCacheWorkerRole.cs
  11. +0 −161 WindowsAzurePowershell/src/Management.CloudService/Cmdlet/EnableAzureMemcache.cs
  12. +287 −0 WindowsAzurePowershell/src/Management.CloudService/Cmdlet/EnableAzureMemcacheRole.cs
  13. +2 −2 WindowsAzurePowershell/src/Management.CloudService/Cmdlet/PublishAzureServiceProject.cs
  14. +5 −1 WindowsAzurePowershell/src/Management.CloudService/Management.CloudService.csproj
  15. +1,471 −1,118 WindowsAzurePowershell/src/Management.CloudService/Microsoft.WindowsAzure.Management.CloudService.dll-Help.xml
  16. +10 −2 WindowsAzurePowershell/src/Management.CloudService/Model/CloudRuntime.cs
  17. +5 −0 WindowsAzurePowershell/src/Management.CloudService/Model/Constants.cs
  18. +1 −1  WindowsAzurePowershell/src/Management.CloudService/Model/ServiceSettings.cs
  19. +102 −30 WindowsAzurePowershell/src/Management.CloudService/Properties/Resources.Designer.cs
  20. +32 −8 WindowsAzurePowershell/src/Management.CloudService/Properties/Resources.resx
  21. +2 −3 WindowsAzurePowershell/src/Management.CloudService/Resources/Scaffolding/Cache/WebRole/bin/setup_cache.cmd
  22. +8 −8 WindowsAzurePowershell/src/Management.CloudService/Resources/Scaffolding/PHP/WebRole/bin/setup_web.cmd
  23. +291 −16 WindowsAzurePowershell/src/Management.CloudService/XmlSchema/ServiceConfigurationSchema.cs
  24. +582 −225 WindowsAzurePowershell/src/Management.CloudService/XmlSchema/ServiceDefinitionSchema.cs
  25. +127 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/FunctionalTests/DatabaseTest.cs
  26. +47 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/FunctionalTests/OutputFormatValidator.cs
  27. +19 −39 ...owsAzurePowershell/src/Management.SqlDatabase.Test/FunctionalTests/{FunctionalTest.cs → ServerTest.cs}
  28. +33 −7 WindowsAzurePowershell/src/Management.SqlDatabase.Test/Management.SqlDatabase.Test.csproj
  29. +3,046 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/Resources/MockSessions.xml
  30. +3 −0  WindowsAzurePowershell/src/Management.SqlDatabase.Test/Resources/SqlDatabaseSettings.xml
  31. +163 −23 WindowsAzurePowershell/src/Management.SqlDatabase.Test/TestScripts/CommonFunctions.ps1
  32. +104 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/TestScripts/Database/CreateAndGetDatabase.ps1
  33. +75 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/TestScripts/Database/CreateContext.ps1
  34. +75 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/TestScripts/Database/DeleteDatabase.ps1
  35. +29 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/TestScripts/Database/ExpectedFormat.txt
  36. +102 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/TestScripts/Database/FormatValidation.ps1
  37. +102 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/TestScripts/Database/UpdateDatabase.ps1
  38. +2 −1  WindowsAzurePowershell/src/Management.SqlDatabase.Test/TestScripts/{ → Server}/CreateGetDeleteServer.ps1
  39. +2 −1  WindowsAzurePowershell/src/Management.SqlDatabase.Test/TestScripts/{ → Server}/CreateGetDropFirewall.ps1
  40. +47 −47 WindowsAzurePowershell/src/Management.SqlDatabase.Test/TestScripts/{ → Server}/ExpectedFormat.txt
  41. +7 −4 WindowsAzurePowershell/src/Management.SqlDatabase.Test/TestScripts/{ → Server}/FormatValidation.ps1
  42. +2 −1  WindowsAzurePowershell/src/Management.SqlDatabase.Test/TestScripts/{ → Server}/ResetPassword.ps1
  43. +90 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/AsyncExceptionManager.cs
  44. +74 −0 ...AzurePowershell/src/Management.SqlDatabase.Test/UnitTests/Database/Cmdlet/DatabaseCmdletAttributionTests.cs
  45. +193 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/Database/Cmdlet/DatabaseTestHelper.cs
  46. +284 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/Database/Cmdlet/GetAzureSqlDatabaseTests.cs
  47. +298 −0 ...wershell/src/Management.SqlDatabase.Test/UnitTests/Database/Cmdlet/NewAzureSqlDatabaseServerContextTests.cs
  48. +217 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/Database/Cmdlet/NewAzureSqlDatabaseTests.cs
  49. +111 −0 ...owsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/Database/Cmdlet/RemoveAzureSqlDatabaseTests.cs
  50. +186 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/Database/Cmdlet/SetAzureSqlDatabaseTests.cs
  51. +29 −92 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/ExceptionHandlerTests.cs
  52. +8 −8 ...AzurePowershell/src/Management.SqlDatabase.Test/UnitTests/Firewall/Cmdlet/FirewallCmdletAttributionTests.cs
  53. +9 −9 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/Firewall/Cmdlet/FirewallCmdletTests.cs
  54. +200 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/MockServer/HttpMessage.cs
  55. +133 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/MockServer/HttpMessageCollection.cs
  56. +55 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/MockServer/HttpSession.cs
  57. +117 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/MockServer/HttpSessionCollection.cs
  58. +560 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/MockServer/MockHttpServer.cs
  59. +9 −9 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/Server/Cmdlet/ServerCmdletAttributionTests.cs
  60. +11 −11 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/Server/Cmdlet/ServerCmdletTests.cs
  61. +201 −0 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/UnitTestHelper.cs
  62. +0 −61 WindowsAzurePowershell/src/Management.SqlDatabase.Test/UnitTests/UnitTestHelpers.cs
  63. +97 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Database/Cmdlet/GetAzureSqlDatabase.cs
  64. +113 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Database/Cmdlet/NewAzureSqlDatabase.cs
  65. +267 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Database/Cmdlet/NewAzureSqlDatabaseServerContext.cs
  66. +117 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Database/Cmdlet/RemoveAzureSqlDatabase.cs
  67. +156 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Database/Cmdlet/SetAzureSqlDatabase.cs
  68. +24 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Management.SqlDatabase.csproj
  69. +40 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Microsoft.WindowsAzure.Management.SqlDatabase.Types.ps1xml
  70. +1,673 −281 WindowsAzurePowershell/src/Management.SqlDatabase/Microsoft.WindowsAzure.Management.SqlDatabase.dll-Help.xml
  71. +144 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Properties/Resources.Designer.cs
  72. +80 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Properties/Resources.resx
  73. +2 −1  WindowsAzurePowershell/src/Management.SqlDatabase/Server/Cmdlet/NewAzureSqlDatabaseServer.cs
  74. +2 −1  WindowsAzurePowershell/src/Management.SqlDatabase/Server/Cmdlet/RemoveAzureSqlDatabaseServer.cs
  75. +2 −1  WindowsAzurePowershell/src/Management.SqlDatabase/Server/Cmdlet/SetAzureSqlDatabaseServer.cs
  76. +87 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Common/AccessTokenResult.cs
  77. +186 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Common/DataConnectionUtility.cs
  78. +132 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Common/DataServiceAccess.cs
  79. +103 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Common/DataServiceBasicCredentials.cs
  80. +120 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Common/DataServiceConnectionType.cs
  81. +73 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Common/DataServiceConstants.cs
  82. +60 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Common/DataServiceExtensions.cs
  83. +313 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Common/ManagementServiceExceptionInfo.cs
  84. +326 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Common/SqlDatabaseExceptionHandler.cs
  85. +1 −0  WindowsAzurePowershell/src/Management.SqlDatabase/Services/Constants.cs
  86. +40 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Server/DatabaseExtensions.cs
  87. +90 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Server/IServerDataServiceContext.cs
  88. +3,279 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Server/ServerContextInternal.cs
  89. +109 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Server/ServerDataService.cs
  90. +249 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Server/ServerDataService.csdl
  91. +38 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Server/ServerDataServiceEnums.cs
  92. +505 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Server/ServerDataServiceSqlAuth.cs
  93. +73 −0 WindowsAzurePowershell/src/Management.SqlDatabase/Services/Server/UpdateServerDataServiceMetadata.ps1
  94. +10 −6 WindowsAzurePowershell/src/Management.SqlDatabase/Services/ServiceResourceError.cs
  95. +10 −6 WindowsAzurePowershell/src/Management.SqlDatabase/Services/SqlDatabaseManagementError.cs
  96. +0 −85 WindowsAzurePowershell/src/Management.SqlDatabase/Services/SqlDatabaseManagementHelper.cs
  97. +5 −24 WindowsAzurePowershell/src/Management.SqlDatabase/SqlDatabaseManagementCmdletBase.cs
  98. +1 −1  WindowsAzurePowershell/src/Management.WebSites/Cmdlets/NewAzureWebSite.cs
  99. +8 −4 WindowsAzurePowershell/src/Management.WebSites/Management.WebSites.csproj
  100. +288 −69 WindowsAzurePowershell/src/Management.WebSites/Microsoft.WindowsAzure.Management.Websites.dll-Help.xml
  101. +10 −10 WindowsAzurePowershell/src/Management.WebSites/Services/Git.cs
  102. +1 −1  WindowsAzurePowershell/src/Management.WebSites/Services/LinkedRevisionControl.cs
  103. +191 −120 WindowsAzurePowershell/src/WindowsAzurePowershell.vsmdi
View
6 WindowsAzurePowershell/setup/azurecmd.wxs
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
- <?define productName="Windows Azure PowerShell - August 2012" ?>
+ <?define productName="Windows Azure PowerShell - October 2012" ?>
<?define sourceDir="$(var.SolutionDir)..\..\Package\$(var.Configuration)" ?>
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
- <?define version="0.6.5" ?>
- <?define azureSdkVersion="1.8" ?>
+ <?define version="0.6.7" ?>
+ <?define azureSdkVersion="1.7" ?>
<?define versionedStartMenuFolder="Windows Azure" ?>
<Product Id="*"
View
798 WindowsAzurePowershell/setup/azurecmdfiles.wxi
167 additions, 631 deletions not shown
View
2  WindowsAzurePowershell/src/Management.CloudService.Test/Management.CloudService.Test.csproj
@@ -112,7 +112,7 @@
<Compile Include="Tests\AzureTools\CsRunTests.cs" />
<Compile Include="Tests\Cmdlet\AddAzureCacheWorkerRoleTests.cs" />
<Compile Include="Tests\Cmdlet\CmdletBaseTests.cs" />
- <Compile Include="Tests\Cmdlet\EnableAzureMemcacheTests.cs" />
+ <Compile Include="Tests\Cmdlet\EnableAzureMemcacheRoleTests.cs" />
<Compile Include="Tests\Cmdlet\GetAzureServiceProjectRuntimesTest.cs" />
<Compile Include="Tests\Cmdlet\SetAzureRuntimeTests.cs" />
<Compile Include="Tests\Cmdlet\SetAzureServiceProjectTests.cs" />
View
18 WindowsAzurePowershell/src/Management.CloudService.Test/Tests/Cmdlet/AddAzureCacheWorkerRoleTests.cs
@@ -40,14 +40,18 @@ public void AddAzureCacheWorkerRoleProcess()
RoleSettings cacheRoleSettings = Testing.GetRole(servicePath, roleName);
AzureAssert.ScaffoldingExists(Path.Combine(files.RootPath, "AzureService", "WorkerRole"), Path.Combine(Resources.NodeScaffolding, Resources.WorkerRole));
+
AzureAssert.WorkerRoleImportsExists(new Import { moduleName = Resources.CachingModuleName }, cacheWorkerRole);
- AzureAssert.WorkerRoleLocalResourcesLocalStoreExists(
- new LocalStore { name = Resources.CachingFileStoreName, sizeInMB = int.Parse(Resources.DefaultRoleCachingInMB), cleanOnRoleRecycle = false },
- cacheWorkerRole);
- AzureAssert.RoleSettingsExist(new ConfigConfigurationSetting { name = Resources.CachingNamedCacheSettingName, value = string.Empty }, cacheRoleSettings);
- AzureAssert.RoleSettingsExist(new ConfigConfigurationSetting { name = Resources.CachingLogLevelSettingName, value = string.Empty }, cacheRoleSettings);
- AzureAssert.RoleSettingsExist(new ConfigConfigurationSetting { name = Resources.CachingCacheSizePercentageSettingName, value = string.Empty }, cacheRoleSettings);
- AzureAssert.RoleSettingsExist(new ConfigConfigurationSetting { name = Resources.CachingConfigStoreConnectionStringSettingName, value = string.Empty }, cacheRoleSettings);
+
+ AzureAssert.LocalResourcesLocalStoreExists(new LocalStore { name = Resources.CacheDiagnosticStoreName, cleanOnRoleRecycle = false },
+ cacheWorkerRole.LocalResources);
+
+ Assert.IsNull(cacheWorkerRole.Endpoints.InputEndpoint);
+
+ AzureAssert.ConfigurationSettingExist(new ConfigConfigurationSetting { name = Resources.NamedCacheSettingName, value = Resources.NamedCacheSettingValue }, cacheRoleSettings.ConfigurationSettings);
+ AzureAssert.ConfigurationSettingExist(new ConfigConfigurationSetting { name = Resources.DiagnosticLevelName, value = Resources.DiagnosticLevelValue }, cacheRoleSettings.ConfigurationSettings);
+ AzureAssert.ConfigurationSettingExist(new ConfigConfigurationSetting { name = Resources.CachingCacheSizePercentageSettingName, value = string.Empty }, cacheRoleSettings.ConfigurationSettings);
+ AzureAssert.ConfigurationSettingExist(new ConfigConfigurationSetting { name = Resources.CachingConfigStoreConnectionStringSettingName, value = string.Empty }, cacheRoleSettings.ConfigurationSettings);
}
}
}
View
217 WindowsAzurePowershell/src/Management.CloudService.Test/Tests/Cmdlet/EnableAzureMemcacheRoleTests.cs
@@ -0,0 +1,217 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright 2011 Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ----------------------------------------------------------------------------------
+
+namespace Microsoft.WindowsAzure.Management.CloudService.Test.Tests
+{
+ using System.IO;
+ using CloudService.Cmdlet;
+ using CloudService.Properties;
+ using Microsoft.WindowsAzure.Management.CloudService.Node.Cmdlet;
+ using Microsoft.WindowsAzure.Management.CloudService.ServiceConfigurationSchema;
+ using Microsoft.WindowsAzure.Management.CloudService.ServiceDefinitionSchema;
+ using Utilities;
+ using VisualStudio.TestTools.UnitTesting;
+ using ConfigConfigurationSetting = Microsoft.WindowsAzure.Management.CloudService.ServiceConfigurationSchema.ConfigurationSetting;
+ using DefConfigurationSetting = Microsoft.WindowsAzure.Management.CloudService.ServiceDefinitionSchema.ConfigurationSetting;
+
+ [TestClass]
+ public class EnableAzureMemcacheRoleTests : TestBase
+ {
+ [TestMethod]
+ public void EnableAzureMemcacheRoleProcess()
+ {
+ using (FileSystemHelper files = new FileSystemHelper(this))
+ {
+ string serviceName = "AzureService";
+ string servicePath = Path.Combine(files.RootPath, serviceName);
+ string cacheRoleName = "WorkerRole";
+ string webRoleName = "WebRole";
+ new NewAzureServiceProjectCommand().NewAzureServiceProcess(files.RootPath, "AzureService");
+ new AddAzureNodeWebRoleCommand().AddAzureNodeWebRoleProcess(webRoleName, 1, servicePath);
+ new AddAzureCacheWorkerRoleCommand().AddAzureCacheWorkerRoleProcess(cacheRoleName, 1, servicePath);
+ new EnableAzureMemcacheRoleCommand().EnableAzureMemcacheRoleProcess(webRoleName, cacheRoleName, servicePath);
+
+ WebRole webRole = Testing.GetWebRole(servicePath, webRoleName);
+ RoleSettings roleSettings = Testing.GetRole(servicePath, webRoleName);
+
+ AzureAssert.RuntimeExists(webRole.Startup.Task, Resources.CacheRuntimeValue);
+
+ AzureAssert.ScaffoldingExists(Path.Combine(files.RootPath, serviceName, webRoleName), Path.Combine(Resources.CacheScaffolding, Resources.WebRole));
+ AzureAssert.StartupTaskExists(webRole.Startup.Task, Resources.CacheStartupCommand);
+
+ AzureAssert.InternalEndpointExists(webRole.Endpoints.InternalEndpoint,
+ new InternalEndpoint { name = Resources.MemcacheEndpointName, protocol = InternalProtocol.tcp, port = Resources.MemcacheEndpointPort});
+
+ LocalStore localStore = new LocalStore
+ {
+ name = Resources.CacheDiagnosticStoreName,
+ cleanOnRoleRecycle = false
+ };
+
+ AzureAssert.LocalResourcesLocalStoreExists(localStore, webRole.LocalResources);
+
+ DefConfigurationSetting diagnosticLevel = new DefConfigurationSetting { name = Resources.CacheClientDiagnosticLevelAssemblyName };
+ AzureAssert.ConfigurationSettingExist(diagnosticLevel, webRole.ConfigurationSettings);
+
+ ConfigConfigurationSetting clientDiagnosticLevel = new ConfigConfigurationSetting { name = Resources.ClientDiagnosticLevelName, value = Resources.ClientDiagnosticLevelValue };
+ AzureAssert.ConfigurationSettingExist(clientDiagnosticLevel, roleSettings.ConfigurationSettings);
+
+ string webConfigPath = string.Format(@"{0}\{1}\{2}", servicePath, webRoleName, Resources.WebCloudConfig);
+ string webCloudConfig = File.ReadAllText(webConfigPath);
+ Assert.IsTrue(webCloudConfig.Contains("configSections"));
+ Assert.IsTrue(webCloudConfig.Contains("dataCacheClients"));
+ }
+ }
+
+ /// <summary>
+ /// Verify that enabling cache with non-existing cache worker role will fail.
+ /// </summary>
+ [TestMethod]
+ public void EnableAzureMemcacheRoleProcessCacheRoleDoesNotExistFail()
+ {
+ using (FileSystemHelper files = new FileSystemHelper(this))
+ {
+ string serviceName = "AzureService";
+ string servicePath = Path.Combine(files.RootPath, serviceName);
+ string cacheRoleName = "WorkerRole";
+ string webRoleName = "WebRole";
+ string expected = string.Format(Resources.RoleNotFoundMessage, cacheRoleName);
+ new NewAzureServiceProjectCommand().NewAzureServiceProcess(files.RootPath, "AzureService");
+ new AddAzureNodeWebRoleCommand().AddAzureNodeWebRoleProcess(webRoleName, 1, servicePath);
+
+ string actual = new EnableAzureMemcacheRoleCommand().EnableAzureMemcacheRoleProcess(webRoleName, cacheRoleName, servicePath);
+
+ Assert.AreEqual<string>(expected, actual);
+ }
+ }
+
+ /// <summary>
+ /// Verify that enabling cache with non-existing role to enable on will fail.
+ /// </summary>
+ [TestMethod]
+ public void EnableAzureMemcacheRoleProcessRoleDoesNotExistFail()
+ {
+ using (FileSystemHelper files = new FileSystemHelper(this))
+ {
+ string serviceName = "AzureService";
+ string servicePath = Path.Combine(files.RootPath, serviceName);
+ string cacheRoleName = "WorkerRole";
+ string webRoleName = "WebRole";
+ string expected = string.Format(Resources.RoleNotFoundMessage, webRoleName);
+ new NewAzureServiceProjectCommand().NewAzureServiceProcess(files.RootPath, "AzureService");
+ new AddAzureCacheWorkerRoleCommand().AddAzureCacheWorkerRoleProcess(cacheRoleName, 1, servicePath);
+
+ string actual = new EnableAzureMemcacheRoleCommand().EnableAzureMemcacheRoleProcess(webRoleName, cacheRoleName, servicePath);
+
+ Assert.AreEqual<string>(expected, actual);
+ }
+ }
+
+ /// <summary>
+ /// Verify that enabling cache using same cache worker role on role with cache will fail.
+ /// </summary>
+ [TestMethod]
+ public void EnableAzureMemcacheRoleProcessAlreadyEnabledFail()
+ {
+ using (FileSystemHelper files = new FileSystemHelper(this))
+ {
+ string serviceName = "AzureService";
+ string servicePath = Path.Combine(files.RootPath, serviceName);
+ string cacheRoleName = "WorkerRole";
+ string webRoleName = "WebRole";
+ string expected = string.Format(Resources.CacheAlreadyEnabledMsg, webRoleName);
+ new NewAzureServiceProjectCommand().NewAzureServiceProcess(files.RootPath, "AzureService");
+ new AddAzureNodeWebRoleCommand().AddAzureNodeWebRoleProcess(webRoleName, 1, servicePath);
+ new AddAzureCacheWorkerRoleCommand().AddAzureCacheWorkerRoleProcess(cacheRoleName, 1, servicePath);
+ new EnableAzureMemcacheRoleCommand().EnableAzureMemcacheRoleProcess(webRoleName, cacheRoleName, servicePath);
+
+ string actual = new EnableAzureMemcacheRoleCommand().EnableAzureMemcacheRoleProcess(webRoleName, cacheRoleName, servicePath);
+
+ Assert.AreEqual<string>(expected, actual);
+ }
+ }
+
+ /// <summary>
+ /// Verify that enabling cache using different cache worker role on role with cache will fail.
+ /// </summary>
+ [TestMethod]
+ public void EnableAzureMemcacheRoleProcessAlreadyEnabledNewCacheRoleFail()
+ {
+ using (FileSystemHelper files = new FileSystemHelper(this))
+ {
+ string serviceName = "AzureService";
+ string servicePath = Path.Combine(files.RootPath, serviceName);
+ string cacheRoleName = "WorkerRole";
+ string newCacheRoleName = "NewCacheWorkerRole";
+ string webRoleName = "WebRole";
+ string expected = string.Format(Resources.CacheAlreadyEnabledMsg, webRoleName);
+ new NewAzureServiceProjectCommand().NewAzureServiceProcess(files.RootPath, "AzureService");
+ new AddAzureNodeWebRoleCommand().AddAzureNodeWebRoleProcess(webRoleName, 1, servicePath);
+ new AddAzureCacheWorkerRoleCommand().AddAzureCacheWorkerRoleProcess(cacheRoleName, 1, servicePath);
+ new EnableAzureMemcacheRoleCommand().EnableAzureMemcacheRoleProcess(webRoleName, cacheRoleName, servicePath);
+ new AddAzureCacheWorkerRoleCommand().AddAzureCacheWorkerRoleProcess(newCacheRoleName, 1, servicePath);
+
+ string actual = new EnableAzureMemcacheRoleCommand().EnableAzureMemcacheRoleProcess(webRoleName, cacheRoleName, servicePath);
+
+ Assert.AreEqual<string>(expected, actual);
+ }
+ }
+
+ /// <summary>
+ /// Verify that enabling cache on worker role will fail.
+ /// </summary>
+ [TestMethod]
+ public void EnableAzureMemcacheRoleProcessOnWorkerRoleWillFail()
+ {
+ using (FileSystemHelper files = new FileSystemHelper(this))
+ {
+ string serviceName = "AzureService";
+ string servicePath = Path.Combine(files.RootPath, serviceName);
+ string cacheRoleName = "WorkerRole";
+ string workerRoleName = "WebRole";
+ string expected = string.Format(Resources.EnableMemcacheOnWorkerRoleErrorMsg, workerRoleName);
+ new NewAzureServiceProjectCommand().NewAzureServiceProcess(files.RootPath, "AzureService");
+ new AddAzureNodeWorkerRoleCommand().AddAzureNodeWorkerRoleProcess(workerRoleName, 1, servicePath);
+ new AddAzureCacheWorkerRoleCommand().AddAzureCacheWorkerRoleProcess(cacheRoleName, 1, servicePath);
+
+ string actual = new EnableAzureMemcacheRoleCommand().EnableAzureMemcacheRoleProcess(workerRoleName, cacheRoleName, servicePath);
+
+ Assert.AreEqual<string>(expected, actual);
+ }
+ }
+
+ /// <summary>
+ /// Verify that enabling cache using non-cache worker role will fail.
+ /// </summary>
+ [TestMethod]
+ public void EnableAzureMemcacheRoleProcessUsingNonCacheWorkerRole()
+ {
+ using (FileSystemHelper files = new FileSystemHelper(this))
+ {
+ string serviceName = "AzureService";
+ string servicePath = Path.Combine(files.RootPath, serviceName);
+ string workerRoleName = "WorkerRole";
+ string webRoleName = "WebRole";
+ string expected = string.Format(Resources.NotCacheWorkerRole, workerRoleName);
+ new NewAzureServiceProjectCommand().NewAzureServiceProcess(files.RootPath, "AzureService");
+ new AddAzureNodeWebRoleCommand().AddAzureNodeWebRoleProcess(webRoleName, 1, servicePath);
+ new AddAzureNodeWorkerRoleCommand().AddAzureNodeWorkerRoleProcess(workerRoleName, 1, servicePath);
+
+ string actual = new EnableAzureMemcacheRoleCommand().EnableAzureMemcacheRoleProcess(webRoleName, workerRoleName, servicePath);
+
+ Assert.AreEqual<string>(expected, actual);
+ }
+ }
+ }
+}
View
61 WindowsAzurePowershell/src/Management.CloudService.Test/Tests/Cmdlet/EnableAzureMemcacheTests.cs
@@ -1,61 +0,0 @@
-// ----------------------------------------------------------------------------------
-//
-// Copyright 2011 Microsoft Corporation
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ----------------------------------------------------------------------------------
-
-namespace Microsoft.WindowsAzure.Management.CloudService.Test.Tests
-{
- using System.IO;
- using CloudService.Cmdlet;
- using CloudService.Properties;
- using Utilities;
- using VisualStudio.TestTools.UnitTesting;
- using Microsoft.WindowsAzure.Management.CloudService.ServiceDefinitionSchema;
- using Microsoft.WindowsAzure.Management.CloudService.ServiceConfigurationSchema;
- using ConfigConfigurationSetting = Microsoft.WindowsAzure.Management.CloudService.ServiceConfigurationSchema.ConfigurationSetting;
- using Microsoft.WindowsAzure.Management.CloudService.Node.Cmdlet;
-
- [TestClass]
- public class EnableAzureMemcacheTests : TestBase
- {
- [TestMethod]
- public void EnableAzureMemcacheProcess()
- {
- using (FileSystemHelper files = new FileSystemHelper(this))
- {
- string serviceName = "AzureService";
- string servicePath = Path.Combine(files.RootPath, serviceName);
- string cacheRoleName = "WorkerRole";
- string webRoleName = "WebRole";
- new NewAzureServiceProjectCommand().NewAzureServiceProcess(files.RootPath, "AzureService");
- new AddAzureNodeWebRoleCommand().AddAzureNodeWebRoleProcess(webRoleName, 1, servicePath);
- new AddAzureCacheWorkerRoleCommand().AddAzureCacheWorkerRoleProcess(cacheRoleName, 1, servicePath);
- new EnableAzureMemcacheCommand().EnableAzureMemcacheProcess(webRoleName, cacheRoleName, servicePath);
-
- WebRole webRole = Testing.GetWebRole(servicePath, webRoleName);
-
- AzureAssert.RuntimeExists(webRole.Startup.Task, Resources.CacheRuntimeValue);
-
- AzureAssert.ScaffoldingExists(Path.Combine(files.RootPath, serviceName, webRoleName), Path.Combine(Resources.CacheScaffolding, Resources.WebRole));
- AzureAssert.StartupTaskExists(webRole.Startup.Task, Resources.CacheStartupCommand);
-
- AzureAssert.InternalEndpointExists(webRole.Endpoints.InternalEndpoint, new InternalEndpoint { name = Resources.MemcacheEndpointName, protocol = InternalProtocol.tcp,
- FixedPort = new Port[] { new Port { port = ushort.Parse(Resources.MemcacheEndpointPort) } } });
-
- string webConfigPath = string.Format(@"{0}\{1}\{2}", servicePath, webRoleName, Resources.WebCloudConfig);
- string webCloudConfig = File.ReadAllText(webConfigPath);
- Assert.IsTrue(webCloudConfig.Contains("configSections"));
- Assert.IsTrue(webCloudConfig.Contains("dataCacheClients"));
- }
- }
- }
-}
View
4 WindowsAzurePowershell/src/Management.CloudService.Test/Tests/Cmdlet/PublishAzureServiceCommandTests.cs
@@ -142,9 +142,9 @@ public void PublishAzureServiceWithCacheWorkerRoleTest()
AzureService azureService = new AzureService(servicePath, null);
RoleSettings cacheRole = azureService.Components.GetCloudConfigRole(cacheRoleName);
- AzureAssert.RoleSettingsExist(new ConfigConfigurationSetting {
+ AzureAssert.ConfigurationSettingExist(new ConfigConfigurationSetting {
name = Resources.CachingConfigStoreConnectionStringSettingName,
- value = string.Format(Resources.CachingConfigStoreConnectionStringSettingValue, storageName, storageKey) }, cacheRole);
+ value = string.Format(Resources.CachingConfigStoreConnectionStringSettingValue, storageName, storageKey) }, cacheRole.ConfigurationSettings);
}
}
View
20 WindowsAzurePowershell/src/Management.CloudService.Test/Tests/Model/ServiceSettingsTests.cs
@@ -84,5 +84,25 @@ public void SanitizeServiceNameForStorageAccountName()
Assert.AreEqual("mycustomserviceiswaytooo", settings.StorageAccountName);
}
}
+
+ /// <summary>
+ /// Verify if the location of the storage account is West US or East US in case that no user provided locations.
+ /// </summary>
+ [TestMethod]
+ public void GetDefaultLocationWithWithRandomLocation()
+ {
+ // Create a temp directory that we'll use to "publish" our service
+ using (FileSystemHelper files = new FileSystemHelper(this) { EnableMonitoring = true })
+ {
+ // Import our default publish settings
+ files.CreateAzureSdkDirectoryAndImportPublishSettings();
+ string serviceName = null;
+
+ ServiceSettings settings = ServiceSettings.LoadDefault(null, null, null, null, null, "My-Custom-Service!", null, out serviceName);
+ Assert.IsTrue(settings.Location.Equals(ArgumentConstants.Locations[Location.WestUS]) ||
+ settings.Location.Equals(ArgumentConstants.Locations[Location.EastUS]));
+
+ }
+ }
}
}
View
16 WindowsAzurePowershell/src/Management.CloudService.Test/Utilities/AzureAssert.cs
@@ -15,7 +15,6 @@
namespace Microsoft.WindowsAzure.Management.CloudService.Test.Utilities
{
using System;
- using System.Collections.Generic;
using System.IO;
using CloudService.Model;
using CloudService.Properties;
@@ -25,6 +24,7 @@ namespace Microsoft.WindowsAzure.Management.CloudService.Test.Utilities
using TestData;
using VisualStudio.TestTools.UnitTesting;
using ConfigConfigurationSetting = Microsoft.WindowsAzure.Management.CloudService.ServiceConfigurationSchema.ConfigurationSetting;
+ using DefConfigurationSetting = Microsoft.WindowsAzure.Management.CloudService.ServiceDefinitionSchema.ConfigurationSetting;
internal static class AzureAssert
{
@@ -231,16 +231,20 @@ public static void WorkerRoleImportsExists(Import expected, WorkerRole actual)
Assert.IsTrue(Array.Exists<Import>(actual.Imports, i => i.moduleName.Equals(expected.moduleName)));
}
- public static void WorkerRoleLocalResourcesLocalStoreExists(LocalStore expected, WorkerRole actual)
+ public static void LocalResourcesLocalStoreExists(LocalStore expected, LocalResources actual)
{
- Assert.IsTrue(Array.Exists<LocalStore>(actual.LocalResources.LocalStorage, l => l.name.Equals(expected.name) &&
+ Assert.IsTrue(Array.Exists<LocalStore>(actual.LocalStorage, l => l.name.Equals(expected.name) &&
l.cleanOnRoleRecycle.Equals(expected.cleanOnRoleRecycle) && l.sizeInMB.Equals(expected.sizeInMB)));
}
- public static void RoleSettingsExist(ConfigConfigurationSetting expected, RoleSettings actual)
+ public static void ConfigurationSettingExist(DefConfigurationSetting expected, DefConfigurationSetting[] actual)
{
- Assert.IsTrue(Array.Exists<ConfigConfigurationSetting>(actual.ConfigurationSettings,
- c => c.name == expected.name && c.value == expected.value));
+ Assert.IsTrue(Array.Exists<DefConfigurationSetting>(actual, c => c.name == expected.name));
+ }
+
+ public static void ConfigurationSettingExist(ConfigConfigurationSetting expected, ConfigConfigurationSetting[] actual)
+ {
+ Assert.IsTrue(Array.Exists<ConfigConfigurationSetting>(actual, c => c.name == expected.name));
}
public static void RuntimeExists(Task[] tasks, string runtimeValue)
View
67 WindowsAzurePowershell/src/Management.CloudService/Cmdlet/AddAzureCacheWorkerRole.cs
@@ -54,13 +54,26 @@ protected override void ProcessRecord()
}
}
+ private AzureService CachingConfigurationFactoryMethod(string rootPath, RoleInfo cacheWorkerRole, string sdkVersion)
+ {
+ switch (sdkVersion)
+ {
+ case SDKVersion.Version180:
+ return Version180Configuration(rootPath, cacheWorkerRole);
+
+ default:
+ throw new Exception(string.Format(Resources.AzureSdkVersionNotSupported,
+ Resources.MinSupportAzureSdkVersion, Resources.MaxSupportAzureSdkVersion));
+ }
+ }
+
/// <summary>
- /// Creates a dedicated caching node worker role by:
- /// * Create node worker role.
- /// * Add caching module to the role imports
- /// * Enable caching on the role by adding LocalResources with LocalStorage element in the role definition.
- /// * Add caching configuration settings
+ /// Process for creating caching worker role.
/// </summary>
+ /// <param name="workerRoleName">The cache worker role name</param>
+ /// <param name="instances">The instance count</param>
+ /// <param name="rootPath">The service root path</param>
+ /// <returns>The resulted message</returns>
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
public string AddAzureCacheWorkerRoleProcess(string workerRoleName, int instances, string rootPath)
{
@@ -69,6 +82,26 @@ public string AddAzureCacheWorkerRoleProcess(string workerRoleName, int instance
// Create node worker role.
string message = new AddAzureNodeWorkerRoleCommand().AddAzureNodeWorkerRoleProcess(workerRoleName, instances, rootPath, out nodeWorkerRole);
+ AzureService azureService = CachingConfigurationFactoryMethod(rootPath, nodeWorkerRole, new AzureTool().AzureSdkVersion);
+
+ // Save changes
+ azureService.Components.Save(azureService.Paths);
+
+ return message;
+ }
+
+ /// <summary>
+ /// Configure the worker role for caching by:
+ /// * Add caching module to the role imports.
+ /// * Enable caching Diagnostic store.
+ /// * Remove input endpoints.
+ /// * Add caching configuration settings.
+ /// </summary>
+ /// <param name="rootPath"></param>
+ /// <param name="nodeWorkerRole"></param>
+ /// <returns></returns>
+ private AzureService Version180Configuration(string rootPath, RoleInfo nodeWorkerRole)
+ {
// Fetch cache role information from service definition and service configuration files.
AzureService azureService = new AzureService(rootPath, null);
WorkerRole cacheWorkerRole = azureService.Components.GetWorkerRole(nodeWorkerRole.Name);
@@ -77,28 +110,22 @@ public string AddAzureCacheWorkerRoleProcess(string workerRoleName, int instance
// Add caching module to the role imports
cacheWorkerRole.Imports = General.ExtendArray<Import>(cacheWorkerRole.Imports, new Import { moduleName = Resources.CachingModuleName });
- // Enable role caching
- LocalStore localStore = new LocalStore
- {
- name = Resources.CachingFileStoreName,
- sizeInMB = int.Parse(Resources.DefaultRoleCachingInMB),
- cleanOnRoleRecycle = false
- };
+ // Enable caching Diagnostic store.
+ LocalStore diagnosticStore = new LocalStore { name = Resources.CacheDiagnosticStoreName, cleanOnRoleRecycle = false };
cacheWorkerRole.LocalResources = General.InitializeIfNull<LocalResources>(cacheWorkerRole.LocalResources);
- cacheWorkerRole.LocalResources.LocalStorage = General.ExtendArray<LocalStore>(cacheWorkerRole.LocalResources.LocalStorage, localStore);
+ cacheWorkerRole.LocalResources.LocalStorage = General.ExtendArray<LocalStore>(cacheWorkerRole.LocalResources.LocalStorage, diagnosticStore);
+
+ // Remove input endpoints.
+ cacheWorkerRole.Endpoints.InputEndpoint = null;
// Add caching configuration settings
List<ConfigConfigurationSetting> cachingConfigSettings = new List<ConfigConfigurationSetting>();
- cachingConfigSettings.Add(new ConfigConfigurationSetting { name = Resources.CachingNamedCacheSettingName, value = string.Empty});
- cachingConfigSettings.Add(new ConfigConfigurationSetting { name = Resources.CachingLogLevelSettingName, value = string.Empty });
+ cachingConfigSettings.Add(new ConfigConfigurationSetting { name = Resources.NamedCacheSettingName, value = Resources.NamedCacheSettingValue });
+ cachingConfigSettings.Add(new ConfigConfigurationSetting { name = Resources.DiagnosticLevelName, value = Resources.DiagnosticLevelValue});
cachingConfigSettings.Add(new ConfigConfigurationSetting { name = Resources.CachingCacheSizePercentageSettingName, value = string.Empty });
cachingConfigSettings.Add(new ConfigConfigurationSetting { name = Resources.CachingConfigStoreConnectionStringSettingName, value = string.Empty });
cacheRoleSettings.ConfigurationSettings = General.ExtendArray<ConfigConfigurationSetting>(cacheRoleSettings.ConfigurationSettings, cachingConfigSettings);
-
- // Save changes
- azureService.Components.Save(azureService.Paths);
-
- return message;
+ return azureService;
}
}
}
View
161 WindowsAzurePowershell/src/Management.CloudService/Cmdlet/EnableAzureMemcache.cs
@@ -1,161 +0,0 @@
-// ----------------------------------------------------------------------------------
-//
-// Copyright 2011 Microsoft Corporation
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ----------------------------------------------------------------------------------
-
-namespace Microsoft.WindowsAzure.Management.CloudService.Cmdlet
-{
- using System;
- using System.Collections.Generic;
- using System.Management.Automation;
- using System.Security;
- using System.Security.Permissions;
- using Microsoft.Samples.WindowsAzure.ServiceManagement;
- using Microsoft.WindowsAzure.Management.CloudService.Cmdlet.Common;
- using Microsoft.WindowsAzure.Management.CloudService.Node.Cmdlet;
- using Microsoft.WindowsAzure.Management.CloudService.Properties;
- using Model;
- using ServiceConfigurationSchema;
- using ServiceDefinitionSchema;
- using Utilities;
- using ConfigConfigurationSetting = Microsoft.WindowsAzure.Management.CloudService.ServiceConfigurationSchema.ConfigurationSetting;
- using System.Web.Configuration;
- using System.Configuration;
- using System.Xml;
- using System.Xml.Linq;
- using Microsoft.WindowsAzure.Management.CloudService.Scaffolding;
- using Microsoft.WindowsAzure.Management.CloudService.AzureTools;
- using System.Diagnostics;
- using System.IO;
-
- /// <summary>
- /// Enables memcache for specific role.
- /// </summary>
- [Cmdlet(VerbsLifecycle.Enable, "AzureMemcache")]
- public class EnableAzureMemcacheCommand : CloudCmdlet<IServiceManagement>
- {
- /// <summary>
- /// The role name to edit.
- /// </summary>
- [Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true)]
- [Alias("rn")]
- public string RoleName { get; set; }
-
- /// <summary>
- /// The dedicated caching worker role name.
- /// </summary>
- [Parameter(Position = 1, Mandatory = true, ValueFromPipelineByPropertyName = true)]
- [Alias("cn")]
- public string CacheWorkerRoleName { get; set; }
-
- [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
- protected override void ProcessRecord()
- {
- try
- {
- base.ProcessRecord();
- string result = EnableAzureMemcacheProcess(this.RoleName, this.CacheWorkerRoleName, base.GetServiceRootPath());
- SafeWriteObject(result);
- }
- catch (Exception ex)
- {
- SafeWriteError(ex);
- }
- }
-
- /// <summary>
- /// Enables Memcached for roles by:
- /// * Add MemcacheShim runtime installation.
- /// * Add startup task to install memcache shim on the client side.
- /// * Add default memcache internal endpoint.
- /// * Adjust web.config to enable auto discovery for the caching role.
- /// </summary>
- [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
- public string EnableAzureMemcacheProcess(string roleName, string cacheWorkerRoleName, string rootPath)
- {
- string message = string.Empty;
- AzureService azureService = new AzureService(rootPath, null);
-
- // Verify caching worker role exists
- if (!azureService.Components.RoleExists(cacheWorkerRoleName))
- {
- return string.Format(Resources.RoleNotFoundMessage, cacheWorkerRoleName);
- }
-
- if (azureService.Components.RoleExists(roleName))
- {
- // Add MemcacheShim runtime installation.
- new SetAzureServiceProjectRoleCommand().SetAzureRuntimesProcess(roleName, Resources.CacheRuntimeValue,
- new AzureTool().AzureSdkVersion, rootPath);
-
- // Fetch web role information.
- azureService = new AzureService(rootPath, null);
- WebRole webRole = azureService.Components.GetWebRole(roleName);
-
- // Assert that cache runtime is added to the runtime startup.
- Debug.Assert(Array.Exists<Variable>(CloudRuntime.GetRuntimeStartupTask(webRole.Startup).Environment,
- v => v.name.Equals(Resources.RuntimeTypeKey) && v.value.Contains(Resources.CacheRuntimeValue)));
-
- // Generate cache caffolding for web role
- azureService.GenerateScaffolding(Path.Combine(Resources.CacheScaffolding, RoleType.WebRole.ToString()), roleName, new Dictionary<string, object>());
-
- // Add startup task to install memcache shim on the client side.
- Task shimStartupTask = new Task { commandLine = Resources.CacheStartupCommand, executionContext = ExecutionContext.elevated };
- webRole.Startup.Task = General.ExtendArray<Task>(webRole.Startup.Task, shimStartupTask);
-
- // Add default memcache internal endpoint.
- InternalEndpoint memcacheEndpoint = new InternalEndpoint { name = Resources.MemcacheEndpointName, protocol = InternalProtocol.tcp,
- FixedPort = new Port[] { new Port { port = ushort.Parse(Resources.MemcacheEndpointPort) } } };
- webRole.Endpoints.InternalEndpoint = General.ExtendArray<InternalEndpoint>(webRole.Endpoints.InternalEndpoint, memcacheEndpoint);
-
- // Adjust web.config to enable auto discovery for the caching role.
- UpdateWebCloudConfig(roleName, cacheWorkerRoleName, azureService);
-
- message = string.Format(Resources.EnableMemcacheMessage, roleName, cacheWorkerRoleName, Resources.MemcacheEndpointPort);
- }
- else
- {
- message = string.Format(Resources.RoleNotFoundMessage, roleName);
- }
-
- // Save changes
- azureService.Components.Save(azureService.Paths);
-
- return message;
- }
-
- /// <summary>
- /// Updates the web.cloud.config with to auto-discover the cache role.
- /// </summary>
- /// <param name="roleName">The role name</param>
- /// <param name="cacheWorkerRoleName">The cache worker role name</param>
- /// <param name="azureService">The azure service instance for the role</param>
- private static void UpdateWebCloudConfig(string roleName, string cacheWorkerRoleName, AzureService azureService)
- {
- string webConfigPath = string.Format(@"{0}\{1}\{2}", azureService.Paths.RootPath, roleName, Resources.WebCloudConfig);
- XDocument webConfig = XDocument.Load(webConfigPath);
-
- Dictionary<string, object> parameters = new Dictionary<string, object>();
- parameters[ScaffoldParams.RoleName] = cacheWorkerRoleName;
- string autoDiscoveryConfig = Scaffold.ReplaceParameter(Resources.CacheAutoDiscoveryConfig, parameters);
-
- // Adding the auto-discovery is sensetive to the placement of the nodes. The first node which is <configSections>
- // must be added at the first and the last node which is dataCacheClients must be added as last element.
- XElement autoDiscoverXElement = XElement.Parse(autoDiscoveryConfig);
- webConfig.Element("configuration").AddFirst(autoDiscoverXElement.FirstNode);
- webConfig.Element("configuration").Add(autoDiscoverXElement.LastNode);
- Debug.Assert(webConfig.Element("configuration").FirstNode.Ancestors("section").Attributes("name") != null);
- Debug.Assert(webConfig.Element("configuration").LastNode.Ancestors("tracing").Attributes("sinkType") != null);
- webConfig.Save(webConfigPath);
- }
- }
-}
View
287 WindowsAzurePowershell/src/Management.CloudService/Cmdlet/EnableAzureMemcacheRole.cs
@@ -0,0 +1,287 @@
+// ----------------------------------------------------------------------------------
+//
+// Copyright 2011 Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ----------------------------------------------------------------------------------
+
+namespace Microsoft.WindowsAzure.Management.CloudService.Cmdlet
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Diagnostics;
+ using System.IO;
+ using System.Management.Automation;
+ using System.Security;
+ using System.Security.Permissions;
+ using System.Xml.Linq;
+ using Microsoft.Samples.WindowsAzure.ServiceManagement;
+ using Microsoft.WindowsAzure.Management.CloudService.AzureTools;
+ using Microsoft.WindowsAzure.Management.CloudService.Cmdlet.Common;
+ using Microsoft.WindowsAzure.Management.CloudService.Properties;
+ using Microsoft.WindowsAzure.Management.CloudService.Scaffolding;
+ using Model;
+ using ServiceDefinitionSchema;
+ using Utilities;
+ using DefConfigurationSetting = Microsoft.WindowsAzure.Management.CloudService.ServiceDefinitionSchema.ConfigurationSetting;
+ using ConfigConfigurationSetting = Microsoft.WindowsAzure.Management.CloudService.ServiceConfigurationSchema.ConfigurationSetting;
+ using Microsoft.WindowsAzure.Management.CloudService.ServiceConfigurationSchema;
+
+ /// <summary>
+ /// Enables memcache for specific role.
+ /// </summary>
+ [Cmdlet(VerbsLifecycle.Enable, "AzureMemcacheRole")]
+ public class EnableAzureMemcacheRoleCommand : CloudCmdlet<IServiceManagement>
+ {
+ /// <summary>
+ /// The role name to edit.
+ /// </summary>
+ [Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true)]
+ [Alias("rn")]
+ public string RoleName { get; set; }
+
+ /// <summary>
+ /// The dedicated caching worker role name.
+ /// </summary>
+ [Parameter(Position = 1, Mandatory = true, ValueFromPipelineByPropertyName = true)]
+ [Alias("cn")]
+ public string CacheWorkerRoleName { get; set; }
+
+ [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
+ protected override void ProcessRecord()
+ {
+ try
+ {
+ base.ProcessRecord();
+ string result = EnableAzureMemcacheRoleProcess(this.RoleName, this.CacheWorkerRoleName, base.GetServiceRootPath());
+ SafeWriteObject(result);
+ }
+ catch (Exception ex)
+ {
+ SafeWriteError(ex);
+ }
+ }
+
+ /// <summary>
+ /// Process for enabling memcache for web roles.
+ /// </summary>
+ /// <param name="roleName">The web role name</param>
+ /// <param name="cacheWorkerRoleName">The cache worker role name</param>
+ /// <param name="rootPath">The root path of the services</param>
+ /// <returns>The resulted message</returns>
+ [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
+ public string EnableAzureMemcacheRoleProcess(string roleName, string cacheWorkerRoleName, string rootPath)
+ {
+ string message = string.Empty;
+ AzureService azureService = new AzureService(rootPath, null);
+
+ // Verify cache worker role exists
+ if (!azureService.Components.RoleExists(cacheWorkerRoleName))
+ {
+ return string.Format(Resources.RoleNotFoundMessage, cacheWorkerRoleName);
+ }
+
+ WorkerRole cacheWorkerRole = azureService.Components.GetWorkerRole(cacheWorkerRoleName);
+
+ // Verify that the cache worker role has proper caching configuration.
+ if (!IsCacheWorkerRole(cacheWorkerRole))
+ {
+ return string.Format(Resources.NotCacheWorkerRole, cacheWorkerRoleName);
+ }
+
+ // Verify role to enable cache on exists
+ if (!azureService.Components.RoleExists(roleName))
+ {
+ return string.Format(Resources.RoleNotFoundMessage, roleName);
+ }
+
+ WebRole webRole = azureService.Components.GetWebRole(roleName);
+
+ // Verift role to enable cache is web role
+ if (webRole == null)
+ {
+ return string.Format(Resources.EnableMemcacheOnWorkerRoleErrorMsg, roleName);
+ }
+
+ // Verify that caching is not enabled for the role
+ if (IsCacheEnabled(webRole))
+ {
+ return string.Format(Resources.CacheAlreadyEnabledMsg, roleName);
+ }
+
+ // All validations passed, enable caching.
+ EnableMemcacheForWebRole(roleName, cacheWorkerRoleName, ref message, ref azureService);
+
+ return message;
+ }
+
+ /// <summary>
+ /// Main entry for enabling memcache.
+ /// </summary>
+ /// <param name="roleName">The web role name</param>
+ /// <param name="cacheWorkerRoleName">The cache worker role name</param>
+ /// <param name="rootPath">The service root path</param>
+ /// <param name="message">The resulted message</param>
+ /// <param name="azureService">The azure service instance</param>
+ /// <param name="webRole">The web role to enable caching one</param>
+ private void EnableMemcacheForWebRole(string roleName, string cacheWorkerRoleName, ref string message, ref AzureService azureService)
+ {
+ string currentVersion = new AzureTool().AzureSdkVersion;
+
+ // Add MemcacheShim runtime installation.
+ new SetAzureServiceProjectRoleCommand().SetAzureRuntimesProcess(roleName, Resources.CacheRuntimeValue, currentVersion, azureService.Paths.RootPath);
+
+ // Fetch web role information.
+ azureService = new AzureService(azureService.Paths.RootPath, null);
+ WebRole webRole = azureService.Components.GetWebRole(roleName);
+
+ // Assert that cache runtime is added to the runtime startup.
+ Debug.Assert(Array.Exists<Variable>(CloudRuntime.GetRuntimeStartupTask(webRole.Startup).Environment,
+ v => v.name.Equals(Resources.RuntimeTypeKey) && v.value.Contains(Resources.CacheRuntimeValue)));
+
+ CachingConfigurationFactoryMethod(azureService, webRole, cacheWorkerRoleName, currentVersion);
+
+ // Save changes
+ azureService.Components.Save(azureService.Paths);
+
+ message = string.Format(Resources.EnableMemcacheMessage, roleName, cacheWorkerRoleName, Resources.MemcacheEndpointPort);
+ }
+
+ /// <summary>
+ /// Factory method to apply memcache required configuration based on the installed SDK version.
+ /// </summary>
+ /// <param name="azureService">The azure service instance</param>
+ /// <param name="webRole">The web role to enable caching on</param>
+ /// <param name="cacheWorkerRole">The memcache worker role name</param>
+ /// <param name="sdkVersion">The current SDK version</param>
+ private void CachingConfigurationFactoryMethod(AzureService azureService, WebRole webRole, string cacheWorkerRole, string sdkVersion)
+ {
+ switch (sdkVersion)
+ {
+ case SDKVersion.Version180:
+ Version180Configuration(azureService, webRole, cacheWorkerRole);
+ break;
+
+ default:
+ throw new Exception(string.Format(Resources.AzureSdkVersionNotSupported,
+ Resources.MinSupportAzureSdkVersion, Resources.MaxSupportAzureSdkVersion));
+ }
+ }
+
+ /// <summary>
+ /// Applies required configuration for enabling cache in SDK 1.8.0 version by:
+ /// * Add MemcacheShim runtime installation.
+ /// * Add startup task to install memcache shim on the client side.
+ /// * Add default memcache internal endpoint.
+ /// * Add cache diagnostic to local resources.
+ /// * Add ClientDiagnosticLevel setting to service configuration.
+ /// * Adjust web.config to enable auto discovery for the caching role.
+ /// </summary>
+ /// <param name="azureService">The azure service instance</param>
+ /// <param name="webRole">The web role to enable caching on</param>
+ /// <param name="cacheWorkerRole">The memcache worker role name</param>
+ private void Version180Configuration(AzureService azureService, WebRole webRole, string cacheWorkerRole)
+ {
+ string roleName = webRole.name;
+
+ // Generate cache caffolding for web role
+ azureService.GenerateScaffolding(Path.Combine(Resources.CacheScaffolding, RoleType.WebRole.ToString()),
+ roleName, new Dictionary<string, object>());
+
+ // Add startup task to install memcache shim on the client side.
+ Task shimStartupTask = new Task { commandLine = Resources.CacheStartupCommand, executionContext = ExecutionContext.elevated };
+ webRole.Startup.Task = General.ExtendArray<Task>(webRole.Startup.Task, shimStartupTask);
+
+ // Add default memcache internal endpoint.
+ InternalEndpoint memcacheEndpoint = new InternalEndpoint
+ {
+ name = Resources.MemcacheEndpointName,
+ protocol = InternalProtocol.tcp,
+ port = Resources.MemcacheEndpointPort
+ };
+ webRole.Endpoints.InternalEndpoint = General.ExtendArray<InternalEndpoint>(webRole.Endpoints.InternalEndpoint, memcacheEndpoint);
+
+ // Enable cache diagnostic
+ LocalStore localStore = new LocalStore
+ {
+ name = Resources.CacheDiagnosticStoreName,
+ cleanOnRoleRecycle = false
+ };
+ webRole.LocalResources = General.InitializeIfNull<LocalResources>(webRole.LocalResources);
+ webRole.LocalResources.LocalStorage = General.ExtendArray<LocalStore>(webRole.LocalResources.LocalStorage, localStore);
+
+ DefConfigurationSetting diagnosticLevel = new DefConfigurationSetting { name = Resources.CacheClientDiagnosticLevelAssemblyName };
+ webRole.ConfigurationSettings = General.ExtendArray<DefConfigurationSetting>(webRole.ConfigurationSettings, diagnosticLevel);
+
+ // Add ClientDiagnosticLevel setting to service configuration.
+ RoleSettings roleSettings = azureService.Components.GetCloudConfigRole(roleName);
+ ConfigConfigurationSetting clientDiagnosticLevel = new ConfigConfigurationSetting { name = Resources.ClientDiagnosticLevelName, value = Resources.ClientDiagnosticLevelValue };
+ roleSettings.ConfigurationSettings = General.ExtendArray<ConfigConfigurationSetting>(roleSettings.ConfigurationSettings, clientDiagnosticLevel);
+
+ // Adjust web.config to enable auto discovery for the caching role.
+ UpdateWebCloudConfig(roleName, cacheWorkerRole, azureService);
+ }
+
+ /// <summary>
+ /// Updates the web.cloud.config with to auto-discover the cache role.
+ /// </summary>
+ /// <param name="roleName">The role name</param>
+ /// <param name="cacheWorkerRoleName">The cache worker role name</param>
+ /// <param name="azureService">The azure service instance for the role</param>
+ private void UpdateWebCloudConfig(string roleName, string cacheWorkerRoleName, AzureService azureService)
+ {
+ string webConfigPath = string.Format(@"{0}\{1}\{2}", azureService.Paths.RootPath, roleName, Resources.WebCloudConfig);
+ XDocument webConfig = XDocument.Load(webConfigPath);
+
+ Dictionary<string, object> parameters = new Dictionary<string, object>();
+ parameters[ScaffoldParams.RoleName] = cacheWorkerRoleName;
+ string autoDiscoveryConfig = Scaffold.ReplaceParameter(Resources.CacheAutoDiscoveryConfig, parameters);
+
+ // Adding the auto-discovery is sensetive to the placement of the nodes. The first node which is <configSections>
+ // must be added at the first and the last node which is dataCacheClients must be added as last element.
+ XElement autoDiscoverXElement = XElement.Parse(autoDiscoveryConfig);
+ webConfig.Element("configuration").AddFirst(autoDiscoverXElement.FirstNode);
+ webConfig.Element("configuration").Add(autoDiscoverXElement.LastNode);
+ Debug.Assert(webConfig.Element("configuration").FirstNode.Ancestors("section").Attributes("name") != null);
+ Debug.Assert(webConfig.Element("configuration").LastNode.Ancestors("tracing").Attributes("sinkType") != null);
+ webConfig.Save(webConfigPath);
+ }
+
+ /// <summary>
+ /// Checks if memcache is already enabled or not for the web role. It does the check by looking for the memcache internal endpoint.
+ /// </summary>
+ /// <param name="webRole">Web role to check</param>
+ /// <returns>Either enabled or not</returns>
+ private bool IsCacheEnabled(WebRole webRole)
+ {
+ if (webRole.Endpoints.InternalEndpoint != null)
+ {
+ return Array.Exists<InternalEndpoint>(webRole.Endpoints.InternalEndpoint, i => i.name == Resources.MemcacheEndpointName);
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// Checks if the worker role is configured as caching worker role.
+ /// </summary>
+ /// <param name="workerRole">The worker role object</param>
+ /// <returns>True if its caching worker role, false if not</returns>
+ private bool IsCacheWorkerRole(WorkerRole workerRole)
+ {
+ if (workerRole.Imports != null)
+ {
+ return Array.Exists<Import>(workerRole.Imports, i => i.moduleName == Resources.CachingModuleName);
+ }
+
+ return false;
+ }
+ }
+}
View
4 WindowsAzurePowershell/src/Management.CloudService/Cmdlet/PublishAzureServiceProject.cs
@@ -331,7 +331,7 @@ private void CreatePackage()
List<CloudRuntimeApplicator> applicators = new List<CloudRuntimeApplicator>();
if (definition.WebRole != null)
{
- foreach (ServiceDefinitionSchema.WebRole role in definition.WebRole.Where(role => role.Startup != null))
+ foreach (ServiceDefinitionSchema.WebRole role in definition.WebRole.Where(role => role.Startup != null && CloudRuntime.GetRuntimeStartupTask(role.Startup) != null))
{
CloudRuntime.ClearRuntime(role);
string rolePath = Path.Combine(service.Paths.RootPath, role.name);
@@ -356,7 +356,7 @@ private void CreatePackage()
if (definition.WorkerRole != null)
{
- foreach (ServiceDefinitionSchema.WorkerRole role in definition.WorkerRole.Where(role => role.Startup != null))
+ foreach (ServiceDefinitionSchema.WorkerRole role in definition.WorkerRole.Where(role => role.Startup != null && CloudRuntime.GetRuntimeStartupTask(role.Startup) != null))
{
string rolePath = Path.Combine(service.Paths.RootPath, role.name);
CloudRuntime.ClearRuntime(role);
View
6 WindowsAzurePowershell/src/Management.CloudService/Management.CloudService.csproj
@@ -108,6 +108,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\Microsoft.Samples.WindowsAzure.ServiceManagement.dll</HintPath>
</Reference>
+ <Reference Include="Microsoft.WindowsAzure.Management.ServiceManagement">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\lib\Microsoft.WindowsAzure.Management.ServiceManagement.dll</HintPath>
+ </Reference>
<Reference Include="Microsoft.WindowsAzure.StorageClient, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\Microsoft.WindowsAzure.StorageClient.dll</HintPath>
@@ -132,7 +136,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Cmdlet\AddAzureCacheWorkerRole.cs" />
- <Compile Include="Cmdlet\EnableAzureMemcache.cs" />
+ <Compile Include="Cmdlet\EnableAzureMemcacheRole.cs" />
<Compile Include="Cmdlet\GetAzureServiceProjectRoleRuntime.cs" />
<Compile Include="Cmdlet\SetAzureServiceProject.cs" />
<Compile Include="Microsoft.WindowsAzure.Management.CloudServiceSnapIn.cs">
View
2,589 ...sAzurePowershell/src/Management.CloudService/Microsoft.WindowsAzure.Management.CloudService.dll-Help.xml
1,471 additions, 1,118 deletions not shown
View
12 WindowsAzurePowershell/src/Management.CloudService/Model/CloudRuntime.cs
@@ -287,12 +287,20 @@ private static void ApplyRoleXmlChanges(Dictionary<string, string> changes, Work
public static void ClearRuntime(WebRole role)
{
- ClearEnvironmentValue(GetRuntimeStartupTask(role.Startup).Environment, Resources.RuntimeUrlKey);
+ Task startupTask = GetRuntimeStartupTask(role.Startup);
+ if (startupTask != null)
+ {
+ ClearEnvironmentValue(startupTask.Environment, Resources.RuntimeUrlKey);
+ }
}
public static void ClearRuntime(WorkerRole role)
{
- ClearEnvironmentValue(GetRuntimeStartupTask(role.Startup).Environment, Resources.RuntimeUrlKey);
+ Task startupTask = GetRuntimeStartupTask(role.Startup);
+ if (startupTask != null)
+ {
+ ClearEnvironmentValue(startupTask.Environment, Resources.RuntimeUrlKey);
+ }
}
static void ClearEnvironmentValue(Variable[] environment, string key)
View
5 WindowsAzurePowershell/src/Management.CloudService/Model/Constants.cs
@@ -61,6 +61,11 @@ static ArgumentConstants()
}
}
+ public class SDKVersion
+ {
+ public const string Version180 = "1.8.0";
+ }
+
public enum Location
{
NorthCentralUS,
View
2  WindowsAzurePowershell/src/Management.CloudService/Model/ServiceSettings.cs
@@ -295,7 +295,7 @@ private static string GetDefaultLocation(string localLocation, string location)
// If none of previous succeed, get random location from "North Central US" or "South Central US"
//
- int randomLocation = General.GetRandomFromTwo((int)Model.Location.NorthCentralUS, (int)Model.Location.SouthCentralUS);
+ int randomLocation = General.GetRandomFromTwo((int)Model.Location.WestUS, (int)Model.Location.EastUS);
return ArgumentConstants.Locations[(Location)randomLocation];
}
View
132 WindowsAzurePowershell/src/Management.CloudService/Properties/Resources.Designer.cs
@@ -187,6 +187,15 @@ internal class Resources {
}
/// <summary>
+ /// Looks up a localized string similar to Memcache is already enabled for web role &apos;{0}&apos;..
+ /// </summary>
+ internal static string CacheAlreadyEnabledMsg {
+ get {
+ return ResourceManager.GetString("CacheAlreadyEnabledMsg", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to &lt;configuration&gt;
/// &lt;configSections&gt;
/// &lt;section name=&quot;dataCacheClients&quot; type=&quot;Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core&quot; allowLocation=&quot;true&quot; allowDefinition=&quot;Everywhere&quot; /&gt;
@@ -196,7 +205,7 @@ internal class Resources {
/// &lt;dataCacheClient name=&quot;DefaultShimConfig&quot; useLegacyProtocol=&quot;false&quot;&gt;
/// &lt;autoDiscover isEnabled=&quot;true&quot; identifier=&quot;$RoleName$&quot; /&gt;
/// &lt;/dataCacheClient&gt;
- /// &lt;/dataCacheCl [rest of string was truncated]&quot;;.
+ /// &lt;/da [rest of string was truncated]&quot;;.
/// </summary>
internal static string CacheAutoDiscoveryConfig {
get {
@@ -205,6 +214,24 @@ internal class Resources {
}
/// <summary>
+ /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel.
+ /// </summary>
+ internal static string CacheClientDiagnosticLevelAssemblyName {
+ get {
+ return ResourceManager.GetString("CacheClientDiagnosticLevelAssemblyName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to DiagnosticStore.
+ /// </summary>
+ internal static string CacheDiagnosticStoreName {
+ get {
+ return ResourceManager.GetString("CacheDiagnosticStoreName", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to cache.
/// </summary>
internal static string CacheRuntimeValue {
@@ -268,24 +295,6 @@ internal class Resources {
}
/// <summary>
- /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.FileStore.
- /// </summary>
- internal static string CachingFileStoreName {
- get {
- return ResourceManager.GetString("CachingFileStoreName", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.Loglevel.
- /// </summary>
- internal static string CachingLogLevelSettingName {
- get {
- return ResourceManager.GetString("CachingLogLevelSettingName", resourceCulture);
- }
- }
-
- /// <summary>
/// Looks up a localized string similar to Caching.
/// </summary>
internal static string CachingModuleName {
@@ -295,15 +304,6 @@ internal class Resources {
}
/// <summary>
- /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.NamedCaches.
- /// </summary>
- internal static string CachingNamedCacheSettingName {
- get {
- return ResourceManager.GetString("CachingNamedCacheSettingName", resourceCulture);
- }
- }
-
- /// <summary>
/// Looks up a localized string similar to Deployment for service {0} with {1} slot doesn&apos;t exist.
/// </summary>
internal static string CannotFindDeployment {
@@ -394,6 +394,24 @@ internal class Resources {
}
/// <summary>
+ /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel.
+ /// </summary>
+ internal static string ClientDiagnosticLevelName {
+ get {
+ return ResourceManager.GetString("ClientDiagnosticLevelName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to 1.
+ /// </summary>
+ internal static string ClientDiagnosticLevelValue {
+ get {
+ return ResourceManager.GetString("ClientDiagnosticLevelValue", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to cloud_package.cspkg.
/// </summary>
internal static string CloudPackageFileName {
@@ -647,6 +665,24 @@ internal class Resources {
}
/// <summary>
+ /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel.
+ /// </summary>
+ internal static string DiagnosticLevelName {
+ get {
+ return ResourceManager.GetString("DiagnosticLevelName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to 1.
+ /// </summary>
+ internal static string DiagnosticLevelValue {
+ get {
+ return ResourceManager.GetString("DiagnosticLevelValue", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to The provided dns {0} doesn&apos;t exist.
/// </summary>
internal static string DnsDoesNotExist {
@@ -701,6 +737,15 @@ internal class Resources {
}
/// <summary>
+ /// Looks up a localized string similar to Enable-AzureMemcacheRole is supported for web roles only. Verify that &apos;{0}&apos; is a web role..
+ /// </summary>
+ internal static string EnableMemcacheOnWorkerRoleErrorMsg {
+ get {
+ return ResourceManager.GetString("EnableMemcacheOnWorkerRoleErrorMsg", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Windows Azure Certificate.
/// </summary>
internal static string EnableRemoteDesktop_FriendlyCertificateName {
@@ -1070,7 +1115,7 @@ internal class Resources {
}
/// <summary>
- /// Looks up a localized string similar to v1.7.
+ /// Looks up a localized string similar to v1.8.
/// </summary>
internal static string MinSupportAzureSdkVersion {
get {
@@ -1088,6 +1133,24 @@ internal class Resources {
}
/// <summary>
+ /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.NamedCaches.
+ /// </summary>
+ internal static string NamedCacheSettingName {
+ get {
+ return ResourceManager.GetString("NamedCacheSettingName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to {&quot;caches&quot;:[{&quot;name&quot;:&quot;default&quot;,&quot;policy&quot;:{&quot;eviction&quot;:{&quot;type&quot;:0},&quot;expiration&quot;:{&quot;defaultTTL&quot;:10,&quot;isExpirable&quot;:true,&quot;type&quot;:1},&quot;serverNotification&quot;:{&quot;isEnabled&quot;:false}},&quot;secondaries&quot;:0}]}.
+ /// </summary>
+ internal static string NamedCacheSettingValue {
+ get {
+ return ResourceManager.GetString("NamedCacheSettingValue", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Service has been created at {0}.
/// </summary>
internal static string NewServiceCreatedMessage {
@@ -1187,6 +1250,15 @@ internal class Resources {
}
/// <summary>
+ /// Looks up a localized string similar to &apos;{0}&apos; must be a cache worker role. Verify that it has proper cache worker role configuration..
+ /// </summary>
+ internal static string NotCacheWorkerRole {
+ get {
+ return ResourceManager.GetString("NotCacheWorkerRole", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to {0} could not be null or empty.
/// </summary>
internal static string NullObjectMessage {
@@ -1291,7 +1363,7 @@ internal class Resources {
}
/// <summary>
- /// Looks up a localized string similar to Scaffolding/PHP.
+ /// Looks up a localized string similar to Scaffolding\PHP.
/// </summary>
internal static string PHPScaffolding {
get {
View
40 WindowsAzurePowershell/src/Management.CloudService/Properties/Resources.resx
@@ -356,7 +356,7 @@
<value>v1.8</value>
</data>
<data name="MinSupportAzureSdkVersion" xml:space="preserve">
- <value>v1.7</value>
+ <value>v1.8</value>
</data>
<data name="NewServiceCreatedMessage" xml:space="preserve">
<value>Service has been created at {0}</value>
@@ -632,7 +632,7 @@
<value> (x86)</value>
</data>
<data name="PHPScaffolding" xml:space="preserve">
- <value>Scaffolding/PHP</value>
+ <value>Scaffolding\PHP</value>
</data>
<data name="PHPScaffoldingResources" xml:space="preserve">
<value>Microsoft.WindowsAzure.Management.CloudService.ScaffoldingResources.PHP</value>
@@ -774,8 +774,8 @@
<data name="WorkerRoleStartupTaskCommandLine" xml:space="preserve">
<value>setup_worker.cmd &gt; log.txt</value>
</data>
- <data name="CachingFileStoreName" xml:space="preserve">
- <value>Microsoft.WindowsAzure.Plugins.Caching.FileStore</value>
+ <data name="CacheDiagnosticStoreName" xml:space="preserve">
+ <value>DiagnosticStore</value>
</data>
<data name="CachingModuleName" xml:space="preserve">
<value>Caching</value>
@@ -792,10 +792,7 @@
<data name="CachingConfigStoreConnectionStringSettingValue" xml:space="preserve">
<value>DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}</value>
</data>
- <data name="CachingLogLevelSettingName" xml:space="preserve">
- <value>Microsoft.WindowsAzure.Plugins.Caching.Loglevel</value>
- </data>
- <data name="CachingNamedCacheSettingName" xml:space="preserve">
+ <data name="NamedCacheSettingName" xml:space="preserve">
<value>Microsoft.WindowsAzure.Plugins.Caching.NamedCaches</value>
</data>
<data name="CacheRuntimeValue" xml:space="preserve">
@@ -841,4 +838,31 @@
<data name="SettingsFileEmptyContent" xml:space="preserve">
<value>{"Slot":"","Location":"","Subscription":"","StorageAccountName":""}</value>
</data>
+ <data name="CacheAlreadyEnabledMsg" xml:space="preserve">
+ <value>Memcache is already enabled for web role '{0}'.</value>
+ </data>
+ <data name="CacheClientDiagnosticLevelAssemblyName" xml:space="preserve">
+ <value>Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel</value>
+ </data>
+ <data name="ClientDiagnosticLevelName" xml:space="preserve">
+ <value>Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel</value>
+ </data>
+ <data name="ClientDiagnosticLevelValue" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <data name="DiagnosticLevelName" xml:space="preserve">
+ <value>Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel</value>
+ </data>
+ <data name="DiagnosticLevelValue" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <data name="NamedCacheSettingValue" xml:space="preserve">
+ <value>{"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}</value>
+ </data>
+ <data name="EnableMemcacheOnWorkerRoleErrorMsg" xml:space="preserve">
+ <value>Enable-AzureMemcacheRole is supported for web roles only. Verify that '{0}' is a web role.</value>
+ </data>
+ <data name="NotCacheWorkerRole" xml:space="preserve">
+ <value>'{0}' must be a cache worker role. Verify that it has proper cache worker role configuration.</value>
+ </data>
</root>
View
5 WindowsAzurePowershell/src/Management.CloudService/Resources/Scaffolding/Cache/WebRole/bin/setup_cache.cmd
@@ -1,6 +1,5 @@
@echo on
cd /d "%~dp0"
-WindowsAzure.Caching.MemcacheShim\MemcacheShimInstaller.exe
-
-exit /b 0
+WindowsAzure.Caching.MemcacheShim\ClientPerfCountersInstaller.exe install
+WindowsAzure.Caching.MemcacheShim\MemcacheShimInstaller.exe
View
16 WindowsAzurePowershell/src/Management.CloudService/Resources/Scaffolding/PHP/WebRole/bin/setup_web.cmd
@@ -28,16 +28,16 @@ exit /b 0
icacls %RoleRoot%\approot /grant "Everyone":F /T
:: Detect PHP Runtime Path
-:: where php-cgi.exe > tmpFile
-:: set /p phprt= < tmpFile
-:: del tmpFile
-:: if DEFINED phprt goto setup_iis
-:: SET phprt=%ProgramFiles%\PHP\v5.3\php-cgi.exe
-:: if DEFINED ProgramFiles(x86) SET phprt=%ProgramFiles(x86)%\PHP\v5.3\php-cgi.exe
+where php-cgi.exe > tmpFile
+set /p phprt= < tmpFile
+del tmpFile
+if DEFINED phprt goto setup_iis
+SET phprt=%ProgramFiles%\PHP\v5.3\php-cgi.exe
+if DEFINED ProgramFiles(x86) SET phprt=%ProgramFiles(x86)%\PHP\v5.3\php-cgi.exe
:setup_iis
-:: %appcmd% set config -section:system.webServer/fastCgi /+"[fullPath='%phprt%',arguments='',maxInstances='4',idleTimeout='300',activityTimeout='30',requestTimeout='90',queueLength='1000',instanceMaxRequests='200',protocol='NamedPipe',flushNamedPipe='False',rapidFailsPerMinute='10']" /commit:apphost
-:: %appcmd% set config -section:system.webServer/handlers /+"[name='PHP-FastCGI',path='*.php',modules='FastCgiModule',verb='*', scriptProcessor='%phprt%']" /commit:apphost
+%appcmd% set config -section:system.webServer/fastCgi /+"[fullPath='%phprt%',arguments='',maxInstances='4',idleTimeout='300',activityTimeout='30',requestTimeout='90',queueLength='1000',instanceMaxRequests='200',protocol='NamedPipe',flushNamedPipe='False',rapidFailsPerMinute='10']" /commit:apphost
+%appcmd% set config -section:system.webServer/handlers /+"[name='PHP-FastCGI',path='*.php',modules='FastCgiModule',verb='*', scriptProcessor='%phprt%']" /commit:apphost
exit /b 0
View
307 WindowsAzurePowershell/src/Management.CloudService/XmlSchema/ServiceConfigurationSchema.cs
@@ -1,21 +1,7 @@
-// ----------------------------------------------------------------------------------
-//
-// Copyright 2011 Microsoft Corporation
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ----------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.239
+// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -24,6 +10,9 @@
namespace Microsoft.WindowsAzure.Management.CloudService.ServiceConfigurationSchema
{
+
+ using System.Xml.Serialization;
+
//
// This source code was auto-generated by xsd, Version=4.0.30319.1.
//
@@ -41,12 +30,21 @@ public partial class ServiceConfiguration
private RoleSettings[] roleField;
+ private NetworkConfigurationElement networkConfigurationField;
+
private string serviceNameField;
private string osFamilyField;
private string osVersionField;
+ private SchemaVersion schemaVersionField;
+
+ public ServiceConfiguration()
+ {
+ this.schemaVersionField = SchemaVersion.unspecified;
+ }
+
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Role")]
public RoleSettings[] Role
@@ -62,6 +60,19 @@ public RoleSettings[] Role
}
/// <remarks/>
+ public NetworkConfigurationElement NetworkConfiguration
+ {
+ get
+ {
+ return this.networkConfigurationField;
+ }
+ set
+ {
+ this.networkConfigurationField = value;
+ }
+ }
+
+ /// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string serviceName
{
@@ -102,6 +113,21 @@ public string osVersion
this.osVersionField = value;
}
}
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ [System.ComponentModel.DefaultValueAttribute(SchemaVersion.unspecified)]
+ public SchemaVersion schemaVersion
+ {
+ get
+ {
+ return this.schemaVersionField;
+ }
+ set
+ {
+ this.schemaVersionField = value;
+ }
+ }
}
/// <remarks/>
@@ -123,6 +149,8 @@ public partial class RoleSettings
private string nameField;
+ private string vmNameField;
+
/// <remarks/>
public OsImageSetting OsImage
{
@@ -190,6 +218,20 @@ public string name
this.nameField = value;
}
}
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string vmName
+ {
+ get
+ {
+ return this.vmNameField;
+ }
+ set
+ {
+ this.vmNameField = value;
+ }
+ }
}
/// <remarks/>
@@ -224,6 +266,224 @@ public string href
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration")]
+ public partial class SubnetElement
+ {
+
+ private string nameField;
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string name
+ {
+ get
+ {
+ return this.nameField;
+ }
+ set
+ {
+ this.nameField = value;
+ }
+ }
+ }
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
+ [System.SerializableAttribute()]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration")]
+ public partial class InstanceAddressElement
+ {
+
+ private SubnetElement[] subnetsField;
+
+ private string roleNameField;
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlArrayItemAttribute("Subnet", IsNullable = false)]
+ public SubnetElement[] Subnets
+ {
+ get
+ {
+ return this.subnetsField;
+ }
+ set
+ {
+ this.subnetsField = value;
+ }
+ }
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string roleName
+ {
+ get
+ {
+ return this.roleNameField;
+ }
+ set
+ {
+ this.roleNameField = value;
+ }
+ }
+ }
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
+ [System.SerializableAttribute()]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration")]
+ public partial class VirtualNetworkSiteElement
+ {
+
+ private string nameField;
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string name
+ {
+ get
+ {
+ return this.nameField;
+ }
+ set
+ {
+ this.nameField = value;
+ }
+ }
+ }
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
+ [System.SerializableAttribute()]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration")]
+ public partial class DnsServerElement
+ {
+
+ private string nameField;
+
+ private string iPAddressField;
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string name
+ {
+ get
+ {
+ return this.nameField;
+ }
+ set
+ {
+ this.nameField = value;
+ }
+ }
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string IPAddress
+ {
+ get
+ {
+ return this.iPAddressField;
+ }
+ set
+ {
+ this.iPAddressField = value;
+ }
+ }
+ }
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
+ [System.SerializableAttribute()]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration")]
+ public partial class DnsElement
+ {
+
+ private DnsServerElement[] dnsServersField;
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlArrayItemAttribute("DnsServer", IsNullable = false)]
+ public DnsServerElement[] DnsServers
+ {
+ get
+ {
+ return this.dnsServersField;
+ }
+ set
+ {
+ this.dnsServersField = value;
+ }
+ }
+ }
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
+ [System.SerializableAttribute()]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration")]
+ public partial class NetworkConfigurationElement
+ {
+
+ private DnsElement dnsField;
+
+ private VirtualNetworkSiteElement virtualNetworkSiteField;
+
+ private InstanceAddressElement[] addressAssignmentsField;
+
+ /// <remarks/>
+ public DnsElement Dns
+ {
+ get
+ {
+ return this.dnsField;
+ }
+ set
+ {
+ this.dnsField = value;
+ }
+ }
+
+ /// <remarks/>
+ public VirtualNetworkSiteElement VirtualNetworkSite
+ {
+ get
+ {
+ return this.virtualNetworkSiteField;
+ }
+ set
+ {
+ this.virtualNetworkSiteField = value;
+ }
+ }
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlArrayItemAttribute("InstanceAddress", IsNullable = false)]
+ public InstanceAddressElement[] AddressAssignments
+ {
+ get
+ {
+ return this.addressAssignmentsField;
+ }
+ set
+ {
+ this.addressAssignmentsField = value;
+ }
+ }
+ }
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
+ [System.SerializableAttribute()]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration")]
public partial class Certificate
{
@@ -370,4 +630,19 @@ public override int GetHashCode()
return this.name.GetHashCode();
}
}
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
+ [System.SerializableAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration")]
+ public enum SchemaVersion
+ {
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlEnumAttribute("2012-10.1.8")]
+ Item20121018,
+
+ /// <remarks/>
+ unspecified,
+ }
}
View
807 WindowsAzurePowershell/src/Management.CloudService/XmlSchema/ServiceDefinitionSchema.cs
@@ -1,21 +1,7 @@
-// ----------------------------------------------------------------------------------
-//
-// Copyright 2011 Microsoft Corporation
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ----------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.239
+// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -24,6 +10,8 @@
namespace Microsoft.WindowsAzure.Management.CloudService.ServiceDefinitionSchema
{
+ using System.Xml.Serialization;
+
//
// This source code was auto-generated by xsd, Version=4.0.30319.1.
//
@@ -51,6 +39,8 @@ public partial class RoleModule
private Certificate[] certificatesField;
+ private Sites sitesField;
+
private string namespaceField;
/// <remarks/>
@@ -134,6 +124,19 @@ public Certificate[] Certificates
}
/// <remarks/>
+ public Sites Sites
+ {
+ get
+ {
+ return this.sitesField;
+ }
+ set
+ {
+ this.sitesField = value;
+ }
+ }
+
+ /// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string @namespace
{
@@ -751,6 +754,8 @@ public partial class Endpoints
private InternalEndpoint[] internalEndpointField;
+ private InstanceInputEndpointElement[] instanceInputEndpointField;
+
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("InputEndpoint")]
public InputEndpoint[] InputEndpoint
@@ -778,6 +783,20 @@ public InternalEndpoint[] InternalEndpoint
this.internalEndpointField = value;
}
}
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlElementAttribute("InstanceInputEndpoint")]
+ public InstanceInputEndpointElement[] InstanceInputEndpoint
+ {
+ get
+ {
+ return this.instanceInputEndpointField;
+ }
+ set
+ {
+ this.instanceInputEndpointField = value;
+ }
+ }
}
/// <remarks/>
@@ -801,6 +820,8 @@ public partial class InputEndpoint
private bool ignoreRoleInstanceStatusField;
+ private string loadBalancerProbeField;
+
public InputEndpoint()
{
this.ignoreRoleInstanceStatusField = false;
@@ -890,6 +911,20 @@ public bool ignoreRoleInstanceStatus
this.ignoreRoleInstanceStatusField = value;
}
}
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string loadBalancerProbe
+ {
+ get
+ {
+ return this.loadBalancerProbeField;
+ }
+ set
+ {
+ this.loadBalancerProbeField = value;
+ }
+ }
}
/// <remarks/>
@@ -907,6 +942,9 @@ public enum Protocol
/// <remarks/>
tcp,
+
+ /// <remarks/>
+ udp,
}
/// <remarks/>
@@ -1008,11 +1046,11 @@ public InternalProtocol protocol
public partial class Port
{
- private ushort portField;
+ private int portField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
- public ushort port
+ public int port
{
get
{
@@ -1034,13 +1072,13 @@ public ushort port
public partial class PortRange
{
- private ushort minField;
+ private int minField;
- private ushort maxField;
+ private int maxField;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
- public ushort min
+ public int min
{
get
{
@@ -1054,7 +1092,7 @@ public ushort min
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
- public ushort max
+ public int max
{
get
{
@@ -1079,6 +1117,124 @@ public enum InternalProtocol
/// <remarks/>
tcp,
+
+ /// <remarks/>
+ udp,
+
+ /// <remarks/>
+ any,
+ }
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
+ [System.SerializableAttribute()]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition")]
+ public partial class InstanceInputEndpointElement
+ {
+
+ private AllocatePublicPortFromElement allocatePublicPortFromField;
+
+ private string nameField;
+
+ private int localPortField;
+
+ private TransportProtocol protocolField;
+
+ /// <remarks/>
+ public AllocatePublicPortFromElement AllocatePublicPortFrom
+ {
+ get
+ {
+ return this.allocatePublicPortFromField;
+ }
+ set
+ {
+ this.allocatePublicPortFromField = value;
+ }
+ }
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string name
+ {
+ get
+ {
+ return this.nameField;
+ }
+ set
+ {
+ this.nameField = value;
+ }
+ }
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public int localPort
+ {
+ get
+ {
+ return this.localPortField;
+ }
+ set
+ {
+ this.localPortField = value;
+ }
+ }
+
+ /// <remarks/>
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public TransportProtocol protocol
+ {
+ get
+ {
+ return this.protocolField;
+ }
+ set
+ {
+ this.protocolField = value;
+ }
+ }
+ }
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
+ [System.SerializableAttribute()]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition")]
+ public partial class AllocatePublicPortFromElement
+ {
+
+ private PortRange fixedPortRangeField;
+
+ /// <remarks/>
+ public PortRange FixedPortRange
+ {
+ get
+ {
+ return this.fixedPortRangeField;
+ }
+ set
+ {
+ this.fixedPortRangeField = value;
+ }
+ }
+ }
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
+ [System.SerializableAttribute()]
+ [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition")]
+ public enum TransportProtocol
+ {
+
+ /// <remarks/>