diff --git a/ChangeLog.txt b/ChangeLog.txt index de13e504ae51..99ce69022689 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -4,7 +4,6 @@ * Select-AzureSubscription: fixed output types in default and PassThru mode * Compute * Get-AzureVMSqlServerExtension - * New-AzureVMSqlServerExtension * Set-AzureVMSqlServerExtension * Remove-AzureVMSqlServerExtension * HDInsight diff --git a/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj b/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj index 43a11a618f7c..b1b8cc0d7dab 100644 --- a/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj +++ b/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj @@ -71,11 +71,11 @@ False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/Common/Commands.Common.Storage/packages.config b/src/Common/Commands.Common.Storage/packages.config index a594630f2a52..1b2aa2e6cb32 100644 --- a/src/Common/Commands.Common.Storage/packages.config +++ b/src/Common/Commands.Common.Storage/packages.config @@ -7,8 +7,8 @@ - - + + diff --git a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj index 733f8dc7bd88..c37950663c02 100644 --- a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj +++ b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj @@ -89,11 +89,11 @@ False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/Common/Commands.Common.Test/Common/ProfileClientTests.cs b/src/Common/Commands.Common.Test/Common/ProfileClientTests.cs index f16bd866e80b..850e66b46cc2 100644 --- a/src/Common/Commands.Common.Test/Common/ProfileClientTests.cs +++ b/src/Common/Commands.Common.Test/Common/ProfileClientTests.cs @@ -109,7 +109,7 @@ public void ProfileMigratesAccountsAndDefaultSubscriptions() Assert.Equal("https://api-dogfood.resources.windows-int.net", client.Profile.Environments["Dogfood"].Endpoints[AzureEnvironment.Endpoint.ResourceManager]); Assert.Equal("https://management-preview.core.windows-int.net/", client.Profile.Environments["Dogfood"].Endpoints[AzureEnvironment.Endpoint.ServiceManagement]); Assert.Equal(".database.windows.net", client.Profile.Environments["Dogfood"].Endpoints[AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix]); - + // Verify subscriptions Assert.Equal(3, client.Profile.Subscriptions.Count); Assert.False(client.Profile.Subscriptions.ContainsKey(new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1E"))); @@ -157,7 +157,7 @@ public void ProfileMigratesAccountsSkipsBadOnesAndBacksUpFile() // Verify Environment migration Assert.Equal(2, client.Profile.Environments.Count); - + // Verify subscriptions Assert.Equal(3, client.Profile.Subscriptions.Count); Assert.True(client.Profile.Subscriptions.ContainsKey(new Guid("06E3F6FD-A3AA-439A-8FC4-1F5C41D2AD1F"))); @@ -168,7 +168,7 @@ public void ProfileMigratesAccountsSkipsBadOnesAndBacksUpFile() Assert.True(client.Profile.Subscriptions.ContainsKey(new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f"))); Assert.Equal("Test Bad Cert", client.Profile.Subscriptions[new Guid("d1e52cbc-b073-42e2-a0a0-c2f547118a6f")].Name); - + // Verify accounts Assert.Equal(2, client.Profile.Accounts.Count); Assert.Equal("test@mail.com", client.Profile.Accounts["test@mail.com"].Id); @@ -204,10 +204,10 @@ public void ProfileMigratesCorruptedFileAndCreatedBackup() // Verify Environment migration Assert.Equal(2, client.Profile.Environments.Count); - + // Verify subscriptions Assert.Equal(0, client.Profile.Subscriptions.Count); - + // Verify accounts Assert.Equal(0, client.Profile.Accounts.Count); @@ -258,7 +258,7 @@ public void AddAzureAccountReturnsAccountWithAllSubscriptionsInRdfeMode() ProfileClient.DataStore = dataStore; ProfileClient client = new ProfileClient(); - var account = client.AddAccountAndLoadSubscriptions(new AzureAccount { Id = "test", Type = AzureAccount.AccountType.User }, AzureEnvironment.PublicEnvironments[ EnvironmentName.AzureCloud], null); + var account = client.AddAccountAndLoadSubscriptions(new AzureAccount { Id = "test", Type = AzureAccount.AccountType.User }, AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud], null); Assert.Equal("test", account.Id); Assert.Equal(3, account.GetSubscriptions(client.Profile).Count); @@ -603,7 +603,7 @@ public void SetAzureEnvironmentUpdatesEnvironment() Assert.Equal(2, client.Profile.Environments.Count); Assert.Throws(() => client.AddOrSetEnvironment(null)); - + var env2 = client.AddOrSetEnvironment(azureEnvironment); Assert.Equal(env2.Name, azureEnvironment.Name); Assert.NotNull(env2.Endpoints[AzureEnvironment.Endpoint.ServiceManagement]); @@ -672,7 +672,7 @@ public void AddOrSetAzureSubscriptionChecksAndUpdates() Assert.Equal(subscription, azureSubscription1); Assert.Throws(() => client.AddOrSetSubscription(null)); Assert.Throws(() => client.AddOrSetSubscription( - new AzureSubscription { Id = new Guid(), Environment = null, Name = "foo"})); + new AzureSubscription { Id = new Guid(), Environment = null, Name = "foo" })); } [Fact] @@ -792,7 +792,7 @@ public void RefreshSubscriptionsWorksWithMooncake() MockDataStore dataStore = new MockDataStore(); ProfileClient.DataStore = dataStore; ProfileClient client = new ProfileClient(); - + client.Profile.Accounts[azureAccount.Id] = azureAccount; var subscriptions = client.RefreshSubscriptions(client.Profile.Environments[EnvironmentName.AzureChinaCloud]); @@ -878,7 +878,7 @@ public void SetAzureSubscriptionAsDefaultSetsDefaultAndCurrent() Assert.Equal(azureSubscription2.Id, client.Profile.DefaultSubscription.Id); Assert.Equal(azureSubscription2.Id, AzureSession.CurrentContext.Subscription.Id); Assert.Throws(() => client.SetSubscriptionAsDefault("bad", null)); - Assert.Throws(() => client.SetSubscriptionAsDefault(null, null)); + Assert.Throws(() => client.SetSubscriptionAsDefault(null, null)); } [Fact] @@ -917,7 +917,7 @@ public void SetAzureSubscriptionAsCurrentSetsCurrent() Assert.Equal(azureSubscription2.Id, AzureSession.CurrentContext.Subscription.Id); Assert.Throws(() => client.SetSubscriptionAsCurrent("bad", null)); - Assert.Throws(() => client.SetSubscriptionAsCurrent(null, null)); + Assert.Throws(() => client.SetSubscriptionAsCurrent(null, null)); } [Fact] @@ -1076,6 +1076,73 @@ public void ImportPublishSettingsUsesPassedInEnvironment() Assert.Equal(7, client.Profile.Subscriptions.Count); } + [Fact] + public void SelectAzureSubscriptionByIdWorks() + { + MockDataStore dataStore = new MockDataStore(); + ProfileClient.DataStore = dataStore; + ProfileClient client = new ProfileClient(); + + var tempSubscriptions = new List + { + new AzureSubscription + { + Id = new Guid("11111111-1383-4740-8A69-748C5B63ADBA"), + Name = "Same Name Subscription", + Environment = azureEnvironment.Name, + Account = azureAccount.Id, + Properties = new Dictionary + { + { AzureSubscription.Property.Default, "True" } + } + }, + + new AzureSubscription + { + Id = new Guid("22222222-1383-4740-8A69-748C5B63ADBA"), + Name = "Same Name Subscription", + Environment = azureEnvironment.Name, + Account = azureAccount.Id, + Properties = new Dictionary() + }, + + new AzureSubscription + { + Id = new Guid("33333333-1383-4740-8A69-748C5B63ADBA"), + Name = "Same Name Subscription", + Environment = azureEnvironment.Name, + Account = azureAccount.Id, + Properties = new Dictionary() + } + }; + + client.Profile.Accounts[azureAccount.Id] = azureAccount; + client.AddOrSetEnvironment(azureEnvironment); + + foreach (var s in tempSubscriptions) + { + client.AddOrSetSubscription(s); + } + + client.SetSubscriptionAsCurrent(tempSubscriptions[0].Name, tempSubscriptions[0].Account); + client.Profile.Save(); + + Assert.Equal(tempSubscriptions[0].Id, AzureSession.CurrentContext.Subscription.Id); + + var cmdlt = new SelectAzureSubscriptionCommand(); + + cmdlt.CommandRuntime = new MockCommandRuntime(); + cmdlt.SubscriptionId = tempSubscriptions[2].Id.ToString(); + cmdlt.SetParameterSet("SelectSubscriptionByIdParameterSet"); + + // Act + cmdlt.InvokeBeginProcessing(); + cmdlt.ExecuteCmdlet(); + cmdlt.InvokeEndProcessing(); + + Assert.Equal(tempSubscriptions[2].Id, AzureSession.CurrentContext.Subscription.Id); + } + [Fact] public void ImportPublishSettingsAddsSecondCertificate() { diff --git a/src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs b/src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs index c6902a22fdd3..25ad50d3662c 100644 --- a/src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs +++ b/src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs @@ -149,6 +149,20 @@ public void ClearAzureProfileClearsTokenCache() Assert.Equal(0, tokenCache.ReadItems().Count()); } + [Fact] + public void DeleteCorruptedTokenCache() + { + //setup + string testFileName = @"c:\foobar\TokenCache.dat"; + ProfileClient.DataStore.WriteFile(testFileName, new byte[] { 0, 1 }); + + //Act + ProtectedFileTokenCache tokenCache = new ProtectedFileTokenCache(testFileName); + + //Assert + Assert.False(ProfileClient.DataStore.FileExists(testFileName)); + } + [Fact] public void SetAzureSubscriptionAddsSubscriptionWithCertificate() { diff --git a/src/Common/Commands.Common.Test/packages.config b/src/Common/Commands.Common.Test/packages.config index 58fb9aaf054b..738a9f3d544f 100644 --- a/src/Common/Commands.Common.Test/packages.config +++ b/src/Common/Commands.Common.Test/packages.config @@ -10,8 +10,8 @@ - - + + diff --git a/src/Common/Commands.Common/Authentication/ProtectedFileTokenCache.cs b/src/Common/Commands.Common/Authentication/ProtectedFileTokenCache.cs index f6e184dc1b0c..f313eed7b143 100644 --- a/src/Common/Commands.Common/Authentication/ProtectedFileTokenCache.cs +++ b/src/Common/Commands.Common/Authentication/ProtectedFileTokenCache.cs @@ -44,22 +44,39 @@ public static ProtectedFileTokenCache Instance // Initializes the cache against a local file. // If the file is already present, it loads its content in the ADAL cache private ProtectedFileTokenCache() + { + Initialize(CacheFileName); + } + + private void Initialize(string fileName) { AfterAccess = AfterAccessNotification; BeforeAccess = BeforeAccessNotification; lock (fileLock) { - if (ProfileClient.DataStore.FileExists(CacheFileName)) + if (ProfileClient.DataStore.FileExists(fileName)) { - var existingData = ProfileClient.DataStore.ReadFileAsBytes(CacheFileName); + var existingData = ProfileClient.DataStore.ReadFileAsBytes(fileName); if (existingData != null) { - Deserialize(ProtectedData.Unprotect(existingData, null, DataProtectionScope.CurrentUser)); + try + { + Deserialize(ProtectedData.Unprotect(existingData, null, DataProtectionScope.CurrentUser)); + } + catch (CryptographicException) + { + ProfileClient.DataStore.DeleteFile(fileName); + } } } } } + public ProtectedFileTokenCache(string cacheFile) + { + Initialize(cacheFile); + } + // Empties the persistent store. public override void Clear() { @@ -81,7 +98,14 @@ void BeforeAccessNotification(TokenCacheNotificationArgs args) var existingData = ProfileClient.DataStore.ReadFileAsBytes(CacheFileName); if (existingData != null) { - Deserialize(ProtectedData.Unprotect(existingData, null, DataProtectionScope.CurrentUser)); + try + { + Deserialize(ProtectedData.Unprotect(existingData, null, DataProtectionScope.CurrentUser)); + } + catch (CryptographicException) + { + ProfileClient.DataStore.DeleteFile(CacheFileName); + } } } } diff --git a/src/Common/Commands.Common/Commands.Common.csproj b/src/Common/Commands.Common/Commands.Common.csproj index e83d8a68559c..8a7df1ba2964 100644 --- a/src/Common/Commands.Common/Commands.Common.csproj +++ b/src/Common/Commands.Common/Commands.Common.csproj @@ -85,11 +85,11 @@ False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/Common/Commands.Common/Common/AzurePowerShellClientFactory.cs b/src/Common/Commands.Common/Common/AzurePowerShellClientFactory.cs index 45752e551ab6..4f0c95b568d9 100644 --- a/src/Common/Commands.Common/Common/AzurePowerShellClientFactory.cs +++ b/src/Common/Commands.Common/Common/AzurePowerShellClientFactory.cs @@ -119,16 +119,24 @@ private void RegisterServiceManagementProviders(AzureContext context) where T } } - private void UpdateSubscriptionRegisteredProviders(AzureSubscription subscription, List providers) + private void UpdateSubscriptionRegisteredProviders(AzureSubscription subscription, List providers) { - if (providers != null && providers.Count > 0) - { - subscription.SetOrAppendProperty(AzureSubscription.Property.RegisteredResourceProviders, - providers.ToArray()); - ProfileClient profileClient = new ProfileClient(); - profileClient.AddOrSetSubscription(subscription); - profileClient.Profile.Save(); - } +     if (providers != null && providers.Count > 0) +     { +         subscription.SetOrAppendProperty(AzureSubscription.Property.RegisteredResourceProviders, +             providers.ToArray()); +         try +         { +             ProfileClient profileClient = new ProfileClient(); +             profileClient.AddOrSetSubscription(subscription); +             profileClient.Profile.Save(); +         } +         catch (KeyNotFoundException) +         { +             // if using a subscription data file, do not write registration to disk +             // long term solution is using -Profile parameter +         } +     } } } } diff --git a/src/Common/Commands.Common/Common/ProfileClient.cs b/src/Common/Commands.Common/Common/ProfileClient.cs index 5db8aec5e895..9e89e74ff103 100644 --- a/src/Common/Commands.Common/Common/ProfileClient.cs +++ b/src/Common/Commands.Common/Common/ProfileClient.cs @@ -372,7 +372,7 @@ private AzureAccount GetSubscriptionAccount(Guid subscriptionId) #endregion - #region Subscripton management + #region Subscription management public AzureSubscription AddOrSetSubscription(AzureSubscription subscription) { @@ -521,31 +521,31 @@ public AzureSubscription GetSubscription(string name) } } - public AzureSubscription SetSubscriptionAsCurrent(Guid id, string accountName) + public AzureSubscription SetSubscriptionAsCurrent(string name, string accountName) { - var subscription = Profile.Subscriptions.Values.FirstOrDefault(s => s.Id == id); + var subscription = Profile.Subscriptions.Values.FirstOrDefault(s => s.Name == name); if (subscription == null) { - throw new ArgumentException(string.Format(Resources.InvalidSubscriptionId, id), "id"); + throw new ArgumentException(string.Format(Resources.InvalidSubscriptionName, name), "name"); } - return SetSubscriptionAsCurrent(subscription.Name, accountName); + return SetSubscriptionAsCurrent(subscription.Id, accountName); } - public AzureSubscription SetSubscriptionAsCurrent(string name, string accountName) + public AzureSubscription SetSubscriptionAsCurrent(Guid id, string accountName) { - if (string.IsNullOrEmpty(name)) + if (Guid.Empty == id) { - throw new ArgumentNullException("name", string.Format(Resources.InvalidSubscription, name)); + throw new ArgumentNullException("id", string.Format(Resources.InvalidSubscriptionId, id)); } AzureSubscription currentSubscription = null; - var subscription = Profile.Subscriptions.Values.FirstOrDefault(s => s.Name == name); + var subscription = Profile.Subscriptions.Values.FirstOrDefault(s => s.Id == id); if (subscription == null) { - throw new ArgumentException(string.Format(Resources.InvalidSubscription, name), "name"); + throw new ArgumentException(string.Format(Resources.InvalidSubscriptionId, id), "id"); } else { @@ -561,21 +561,21 @@ public AzureSubscription SetSubscriptionAsCurrent(string name, string accountNam return currentSubscription; } - public AzureSubscription SetSubscriptionAsDefault(Guid id, string accountName) + public AzureSubscription SetSubscriptionAsDefault(string name, string accountName) { - var subscription = Profile.Subscriptions.Values.FirstOrDefault(s => s.Id == id); + var subscription = Profile.Subscriptions.Values.FirstOrDefault(s => s.Name == name); if (subscription == null) { - throw new ArgumentException(string.Format(Resources.InvalidSubscriptionId, id), "id"); + throw new ArgumentException(string.Format(Resources.InvalidSubscriptionName, name), "name"); } - return SetSubscriptionAsDefault(subscription.Name, accountName); + return SetSubscriptionAsDefault(subscription.Id, accountName); } - public AzureSubscription SetSubscriptionAsDefault(string name, string accountName) + public AzureSubscription SetSubscriptionAsDefault(Guid id, string accountName) { - AzureSubscription subscription = SetSubscriptionAsCurrent(name, accountName); + AzureSubscription subscription = SetSubscriptionAsCurrent(id, accountName); if (subscription != null) { diff --git a/src/Common/Commands.Common/Common/ServiceManagementTypes.cs b/src/Common/Commands.Common/Common/ServiceManagementTypes.cs index fe274f3e3221..b613f7e99ace 100644 --- a/src/Common/Commands.Common/Common/ServiceManagementTypes.cs +++ b/src/Common/Commands.Common/Common/ServiceManagementTypes.cs @@ -5258,7 +5258,7 @@ public string PrivateConfigurationSchema public string CompanyName { get; set; } #region IExtensibleDataObject Members - ExtensionDataObject IExtensibleDataObject.ExtensionData { get; set; } + public ExtensionDataObject ExtensionData { get; set; } #endregion } diff --git a/src/Common/Commands.Common/packages.config b/src/Common/Commands.Common/packages.config index df2b72a265a8..56b52b68db88 100644 --- a/src/Common/Commands.Common/packages.config +++ b/src/Common/Commands.Common/packages.config @@ -10,8 +10,8 @@ - - + + diff --git a/src/Common/Commands.Profile/Commands.Profile.csproj b/src/Common/Commands.Profile/Commands.Profile.csproj index d1b5d2b46f2a..0b1154c8cefa 100644 --- a/src/Common/Commands.Profile/Commands.Profile.csproj +++ b/src/Common/Commands.Profile/Commands.Profile.csproj @@ -75,11 +75,11 @@ False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/Common/Commands.Profile/packages.config b/src/Common/Commands.Profile/packages.config index 8a52e19c1d2d..c8c2784f5d51 100644 --- a/src/Common/Commands.Profile/packages.config +++ b/src/Common/Commands.Profile/packages.config @@ -5,8 +5,8 @@ - - + + \ No newline at end of file diff --git a/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj b/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj index 991531b3b214..3fd73d8df2db 100644 --- a/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj +++ b/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj @@ -78,11 +78,11 @@ False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/Common/Commands.ScenarioTest/packages.config b/src/Common/Commands.ScenarioTest/packages.config index 2c9315ab2fe6..7c0aa8ed61cd 100644 --- a/src/Common/Commands.ScenarioTest/packages.config +++ b/src/Common/Commands.ScenarioTest/packages.config @@ -10,8 +10,8 @@ - - + + diff --git a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj index 9b5e21401d18..9470c6f55c73 100644 --- a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj +++ b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj @@ -63,11 +63,11 @@ False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/Common/Commands.ScenarioTests.Common/PowerShellExtensions.cs b/src/Common/Commands.ScenarioTests.Common/PowerShellExtensions.cs index a27b604985da..38c071b43059 100644 --- a/src/Common/Commands.ScenarioTests.Common/PowerShellExtensions.cs +++ b/src/Common/Commands.ScenarioTests.Common/PowerShellExtensions.cs @@ -27,7 +27,7 @@ public static class PowerShellExtensions public static string CredentialImportFormat = "Import-AzurePublishSettingsFile '{0}'"; /// - /// Gets a powershell varibale from the current session and convernts it back to it's original type. + /// Gets a powershell variable from the current session and converts it back to it's original type. /// /// The powershell object original type /// The PowerShell instance diff --git a/src/Common/Commands.ScenarioTests.Common/packages.config b/src/Common/Commands.ScenarioTests.Common/packages.config index eb18caf5fa1e..0b670568f39a 100644 --- a/src/Common/Commands.ScenarioTests.Common/packages.config +++ b/src/Common/Commands.ScenarioTests.Common/packages.config @@ -7,8 +7,8 @@ - - + + \ No newline at end of file diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj b/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj index 28c499116e1f..da45d376c28e 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj +++ b/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj @@ -45,8 +45,9 @@ False ..\..\..\packages\Microsoft.Azure.Management.Authorization.0.11.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll - - ..\..\..\packages\Microsoft.Azure.Management.Batch.1.1.2-preview\lib\net40\Microsoft.Azure.Management.Batch.dll + + False + ..\..\..\packages\Microsoft.Azure.Management.Batch.1.1.6-preview\lib\net40\Microsoft.Azure.Management.Batch.dll False @@ -98,11 +99,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/packages.config b/src/ResourceManager/Batch/Commands.Batch.Test/packages.config index 6038b49920cd..e7a0c36525c5 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/packages.config +++ b/src/ResourceManager/Batch/Commands.Batch.Test/packages.config @@ -4,7 +4,7 @@ - + @@ -12,8 +12,8 @@ - - + + diff --git a/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj b/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj index 945fd24095dd..d01d791cdd41 100644 --- a/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj +++ b/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj @@ -41,8 +41,9 @@ false - - ..\..\..\packages\Microsoft.Azure.Management.Batch.1.1.2-preview\lib\net40\Microsoft.Azure.Management.Batch.dll + + False + ..\..\..\packages\Microsoft.Azure.Management.Batch.1.1.6-preview\lib\net40\Microsoft.Azure.Management.Batch.dll False @@ -62,11 +63,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/ResourceManager/Batch/Commands.Batch/packages.config b/src/ResourceManager/Batch/Commands.Batch/packages.config index a5eb80a5f148..9551c518b2b6 100644 --- a/src/ResourceManager/Batch/Commands.Batch/packages.config +++ b/src/ResourceManager/Batch/Commands.Batch/packages.config @@ -1,12 +1,12 @@  - + - - + + \ No newline at end of file diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/DataFactoryTests.ps1 b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/DataFactoryTests.ps1 index cd4867b2d57f..a0fc1ac31145 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/DataFactoryTests.ps1 +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/DataFactoryTests.ps1 @@ -124,4 +124,4 @@ function Test-DataFactoryPiping # Test the data factory no longer exists Assert-ThrowsContains { Get-AzureDataFactory -ResourceGroupName $rgname -Name $dfname } "ResourceNotFound" -} +} \ No newline at end of file diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/GetHubTests.cs b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/GetHubTests.cs index 69b5378fcb5f..e7e7a3d58743 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/GetHubTests.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/GetHubTests.cs @@ -12,10 +12,12 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using System.Collections.Generic; using Microsoft.Azure.Commands.DataFactories.Models; using Microsoft.WindowsAzure.Commands.ScenarioTest; using Moq; +using System; +using System.Collections.Generic; +using System.Management.Automation; using Xunit; namespace Microsoft.Azure.Commands.DataFactories.Test @@ -78,6 +80,30 @@ public void CanGetHub() commandRuntimeMock.Verify(f => f.WriteObject(expected), Times.Once()); } + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void GetHubWithEmptyName() + { + // Action + cmdlet.Name = String.Empty; + Exception exception = Assert.Throws(() => cmdlet.ExecuteCmdlet()); + + // Assert + Assert.Contains("Value cannot be null", exception.Message); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void GetHubWithWhiteSpaceName() + { + // Action + cmdlet.Name = " "; + Exception exception = Assert.Throws(() => cmdlet.ExecuteCmdlet()); + + // Assert + Assert.Contains("Value cannot be null", exception.Message); + } + [Fact] [Trait(Category.AcceptanceType, Category.CheckIn)] public void CanListHubs() diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/GetPipelineTests.cs b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/GetPipelineTests.cs index 8fa189de9633..e0ec60dd4d13 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/GetPipelineTests.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/GetPipelineTests.cs @@ -12,10 +12,12 @@ // limitations under the License. // ---------------------------------------------------------------------------------- -using System.Collections.Generic; using Microsoft.Azure.Commands.DataFactories.Models; using Microsoft.WindowsAzure.Commands.ScenarioTest; using Moq; +using System; +using System.Collections.Generic; +using System.Management.Automation; using Xunit; namespace Microsoft.Azure.Commands.DataFactories.Test @@ -78,6 +80,30 @@ public void CanGetPipeline() commandRuntimeMock.Verify(f => f.WriteObject(expected), Times.Once()); } + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void GetPipelineWithEmptyName() + { + // Action + cmdlet.Name = String.Empty; + Exception exception = Assert.Throws(() => cmdlet.ExecuteCmdlet()); + + // Assert + Assert.Contains("Value cannot be null", exception.Message); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void GetPipelineWithWhiteSpaceName() + { + // Action + cmdlet.Name = " "; + Exception exception = Assert.Throws(() => cmdlet.ExecuteCmdlet()); + + // Assert + Assert.Contains("Value cannot be null", exception.Message); + } + [Fact] [Trait(Category.AcceptanceType, Category.CheckIn)] public void CanListPipelines() diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Hubs/GetAzureDataFactoryHubCommand.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/Hubs/GetAzureDataFactoryHubCommand.cs index 666bdddd5e6d..86395da92486 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Hubs/GetAzureDataFactoryHubCommand.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Hubs/GetAzureDataFactoryHubCommand.cs @@ -12,12 +12,12 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.Azure.Commands.DataFactories.Models; +using Microsoft.Azure.Commands.DataFactories.Properties; using System.Collections.Generic; +using System.Globalization; using System.Management.Automation; using System.Security.Permissions; -using Microsoft.Azure.Commands.DataFactories.Models; -using System.Globalization; -using Microsoft.Azure.Commands.DataFactories.Properties; namespace Microsoft.Azure.Commands.DataFactories { @@ -31,6 +31,12 @@ public class GetAzureDataFactoryHubCommand : HubContextBaseCmdlet [EnvironmentPermission(SecurityAction.Demand, Unrestricted = true)] public override void ExecuteCmdlet() { + // ValidationNotNullOrEmpty doesn't handle whitespaces well + if (Name != null && string.IsNullOrWhiteSpace(Name)) + { + throw new PSArgumentNullException("Name"); + } + if (ParameterSetName == ByFactoryObject) { if (DataFactory == null) diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Pipelines/GetAzureDataFactoryPipelineCommand.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/Pipelines/GetAzureDataFactoryPipelineCommand.cs index 5899cf9baeac..9ed7fe5bf516 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Pipelines/GetAzureDataFactoryPipelineCommand.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Pipelines/GetAzureDataFactoryPipelineCommand.cs @@ -12,14 +12,14 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.Azure.Commands.DataFactories.Models; +using Microsoft.Azure.Commands.DataFactories.Properties; using System; +using System.Collections; using System.Collections.Generic; +using System.Globalization; using System.Management.Automation; using System.Security.Permissions; -using Microsoft.Azure.Commands.DataFactories.Models; -using System.Collections; -using System.Globalization; -using Microsoft.Azure.Commands.DataFactories.Properties; namespace Microsoft.Azure.Commands.DataFactories { @@ -42,6 +42,12 @@ public class GetAzureDataFactoryPipelineCommand : DataFactoryBaseCmdlet [EnvironmentPermission(SecurityAction.Demand, Unrestricted = true)] public override void ExecuteCmdlet() { + // ValidationNotNullOrEmpty doesn't handle whitespaces well + if (Name != null && string.IsNullOrWhiteSpace(Name)) + { + throw new PSArgumentNullException("Name"); + } + if (ParameterSetName == ByFactoryObject) { if (DataFactory == null) diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/ProvisioningFailedException.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/ProvisioningFailedException.cs index f3e7bc93d732..b717a8b80619 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/ProvisioningFailedException.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/ProvisioningFailedException.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Commands.DataFactories { + [Serializable] internal class ProvisioningFailedException : Exception { public ProvisioningFailedException(string errorMessage) diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj b/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj index ab3fb50e13af..975cf29e00b3 100644 --- a/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj +++ b/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj @@ -87,11 +87,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourcesController.cs b/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourcesController.cs index 4560934c6834..e29eda280d29 100644 --- a/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourcesController.cs +++ b/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourcesController.cs @@ -31,8 +31,8 @@ public sealed class ResourcesController { private CSMTestEnvironmentFactory csmTestFactory; private EnvironmentSetupHelper helper; - protected const string TenantIdKey = "TenantId"; - protected const string DomainKey = "Domain"; + private const string TenantIdKey = "TenantId"; + private const string DomainKey = "Domain"; public GraphRbacManagementClient GraphClient { get; private set; } diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/packages.config b/src/ResourceManager/Resources/Commands.Resources.Test/packages.config index 5c9cb785aec1..39350fefc378 100644 --- a/src/ResourceManager/Resources/Commands.Resources.Test/packages.config +++ b/src/ResourceManager/Resources/Commands.Resources.Test/packages.config @@ -12,8 +12,8 @@ - - + + diff --git a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj index eebaf66df062..d0bc098e07b2 100644 --- a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj +++ b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj @@ -90,11 +90,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll diff --git a/src/ResourceManager/Resources/Commands.Resources/packages.config b/src/ResourceManager/Resources/Commands.Resources/packages.config index 4af1bc0c2f29..ed9cd2079ea5 100644 --- a/src/ResourceManager/Resources/Commands.Resources/packages.config +++ b/src/ResourceManager/Resources/Commands.Resources/packages.config @@ -10,7 +10,7 @@ - - + + \ No newline at end of file diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj b/src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj index 96f800352f71..5d3c2588d0e7 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj +++ b/src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj @@ -48,7 +48,7 @@ False - ..\..\..\packages\Microsoft.Azure.Management.Sql.0.14.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll + ..\..\..\packages\Microsoft.Azure.Management.Sql.0.14.3-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll False @@ -58,7 +58,7 @@ False ..\..\..\packages\Microsoft.Azure.Management.Resources.2.7.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll - + False ..\..\..\packages\Hydra.HttpRecorder.1.0.5417.13285-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll @@ -83,19 +83,19 @@ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + False + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - False ..\..\..\packages\Microsoft.WindowsAzure.Management.Storage.3.1.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll - + False ..\..\..\packages\Hydra.SpecTestSupport.1.0.5417.13285-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll - + False ..\..\..\packages\Moq.4.2.1402.2112\lib\net40\Moq.dll diff --git a/src/ResourceManager/Sql/Commands.Sql.Test/packages.config b/src/ResourceManager/Sql/Commands.Sql.Test/packages.config index 5c5fc03033b0..b8d8b347c578 100644 --- a/src/ResourceManager/Sql/Commands.Sql.Test/packages.config +++ b/src/ResourceManager/Sql/Commands.Sql.Test/packages.config @@ -4,15 +4,15 @@ - + - - + + diff --git a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj index 4e6abf259975..dbabb3532ef8 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj +++ b/src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj @@ -89,7 +89,7 @@ False - ..\..\..\packages\Microsoft.Azure.Management.Sql.0.14.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll + ..\..\..\packages\Microsoft.Azure.Management.Sql.0.14.3-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll False @@ -110,11 +110,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.Designer.cs b/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.Designer.cs index 757628091ed5..2b22cf7cd63b 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.Designer.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.Designer.cs @@ -60,6 +60,24 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to {your_password_here}. + /// + internal static string EnterPassword { + get { + return ResourceManager.GetString("EnterPassword", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {your_user_id_here}. + /// + internal static string EnterUserId { + get { + return ResourceManager.GetString("EnterUserId", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cannot use the '{0}' option with other event types.. /// @@ -78,6 +96,33 @@ internal static string NoStorageAccountWhenConfiguringAuditingPolicy { } } + /// + /// Looks up a localized string similar to PHP Data Objects(PDO) Sample Code:. + /// + internal static string PdoTitle { + get { + return ResourceManager.GetString("PdoTitle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error connecting to SQL Server. + /// + internal static string PhpConnectionError { + get { + return ResourceManager.GetString("PhpConnectionError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SQL Server Extension Sample Code:. + /// + internal static string sqlSampleTitle { + get { + return ResourceManager.GetString("sqlSampleTitle", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cannot find a storage account with the name '{0}'. It either does not exist, associated with a different subscription or you do not have the appropriate credentials to access it.. /// diff --git a/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.resx b/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.resx index 0bb1355309aa..1c3014ac090d 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.resx +++ b/src/ResourceManager/Sql/Commands.Sql/Properties/Resources.resx @@ -117,12 +117,27 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + {your_password_here} + + + {your_user_id_here} + Cannot use the '{0}' option with other event types. Cannot set auditing policy without a storage account name. + + PHP Data Objects(PDO) Sample Code: + + + Error connecting to SQL Server + + + SQL Server Extension Sample Code: + Cannot find a storage account with the name '{0}'. It either does not exist, associated with a different subscription or you do not have the appropriate credentials to access it. diff --git a/src/ResourceManager/Sql/Commands.Sql/Security/Services/SqlClient.cs b/src/ResourceManager/Sql/Commands.Sql/Security/Services/SqlClient.cs index 4bfada279e82..19e4ef8e7732 100644 --- a/src/ResourceManager/Sql/Commands.Sql/Security/Services/SqlClient.cs +++ b/src/ResourceManager/Sql/Commands.Sql/Security/Services/SqlClient.cs @@ -18,6 +18,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text; namespace Microsoft.Azure.Commands.Sql.Security.Services { @@ -65,6 +66,7 @@ public AuditingPolicy GetDatabaseAuditingPolicy(string resourceGroup, string ser wrapper.ResourceGroupName = resourceGroup; wrapper.ServerName = serverName; wrapper.DatabaseName = databaseName; + AddConnectionStringsToWrapperFromPolicy(wrapper, policy.Properties); return wrapper; } @@ -86,7 +88,6 @@ private AuditingPolicy WrapPolicy(DatabaseSecurityPolicy policy) wrapper.DirectAccessEnabled = !properties.IsBlockDirectAccessEnabled; addStorageInfoToWrapperFromPolicy(wrapper, properties); AddEventTypesToWrapperFromPolicy(wrapper, properties); - AddConnectionStringsToWrapperFromPolicy(wrapper, properties); this.FetchedProperties = properties; return wrapper; } @@ -102,10 +103,69 @@ private void addStorageInfoToWrapperFromPolicy(AuditingPolicy wrapper, DatabaseS private void AddConnectionStringsToWrapperFromPolicy(AuditingPolicy wrapper, DatabaseSecurityPolicyProperties properties) { - wrapper.ConnectionStrings.AdoNetConnectionString = properties.AdoNetConnectionString; - wrapper.ConnectionStrings.OdbcConnectionString = properties.OdbcConnectionString; - wrapper.ConnectionStrings.JdbcConnectionString = properties.JdbcConnectionString; - wrapper.ConnectionStrings.PhpConnectionString = properties.PhpConnectionString; + wrapper.ConnectionStrings.AdoNetConnectionString = ConstructAdoNetConnectionString(wrapper, properties); + wrapper.ConnectionStrings.OdbcConnectionString = ConstructOdbcConnectionString(wrapper, properties); + wrapper.ConnectionStrings.JdbcConnectionString = ConstructJdbcConnectionString(wrapper, properties); + wrapper.ConnectionStrings.PhpConnectionString = ConstructPhpConnectionString(wrapper, properties); + } + + private string ConstructPhpConnectionString(AuditingPolicy wrapper, DatabaseSecurityPolicyProperties properties) + { + string enterUser = Microsoft.Azure.Commands.Sql.Properties.Resources.EnterUserId; + string enterPassword = Microsoft.Azure.Commands.Sql.Properties.Resources.EnterPassword; + string pdoTitle = Microsoft.Azure.Commands.Sql.Properties.Resources.PdoTitle; + string sqlServerSampleTitle = Microsoft.Azure.Commands.Sql.Properties.Resources.sqlSampleTitle; + string connectionError = Microsoft.Azure.Commands.Sql.Properties.Resources.PhpConnectionError; + StringBuilder sb = new StringBuilder(); + sb.Append(string.Format("Server: {0}, {1}", properties.ProxyDnsName, properties.ProxyPort)).Append(Environment.NewLine); + sb.Append(string.Format("SQL Database: {0}", wrapper.DatabaseName)).Append(Environment.NewLine); + sb.Append(string.Format("User Name: {0}", enterUser)).Append(Environment.NewLine).Append(Environment.NewLine); + sb.Append(pdoTitle).Append(Environment.NewLine); + sb.Append("try{").Append(Environment.NewLine); + sb.Append(string.Format("$conn = new PDO ( \"sqlsrv:server = tcp:{0},{1}; Database = \"{2}\", \"{3}\", \"{4}\");", + properties.ProxyDnsName, properties.ProxyPort, wrapper.DatabaseName, enterUser, enterPassword)).Append(Environment.NewLine); + sb.Append("$conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );").Append(Environment.NewLine); + sb.Append("}").Append(Environment.NewLine); + sb.Append("catch ( PDOException $e ) {").Append(Environment.NewLine); + sb.Append(string.Format("print( \"{0}\" );", connectionError)).Append(Environment.NewLine); + sb.Append("die(print_r($e));").Append(Environment.NewLine); + sb.Append("}").Append(Environment.NewLine); + sb.Append(sqlServerSampleTitle).Append(Environment.NewLine).Append(Environment.NewLine); + sb.Append(string.Format("connectionInfo = array(\"UID\" => \"{0}@{1}\", \"pwd\" => \"{2}\", \"Database\" => \"{3}\", \"LoginTimeout\" => 30, \"Encrypt\" => 1);", + enterUser, wrapper.ServerName, enterPassword, wrapper.DatabaseName)).Append(Environment.NewLine); + sb.Append(string.Format("$serverName = \"tcp:{0},{1}\";", properties.ProxyDnsName, properties.ProxyPort)).Append(Environment.NewLine); + sb.Append("$conn = sqlsrv_connect($serverName, $connectionInfo);"); + return sb.ToString(); + } + + private string ConstructOdbcConnectionString(AuditingPolicy wrapper, DatabaseSecurityPolicyProperties properties) + { + string enterUser = Microsoft.Azure.Commands.Sql.Properties.Resources.EnterUserId; + string enterPassword = Microsoft.Azure.Commands.Sql.Properties.Resources.EnterPassword; + StringBuilder sb = new StringBuilder(); + sb.Append("Driver={SQL Server Native Client 11.0};"); + sb.Append(string.Format("Server=tcp:{0},{1};", properties.ProxyDnsName, properties.ProxyPort)); + sb.Append(string.Format("Database={0};", wrapper.DatabaseName)); + sb.Append(string.Format("Uid={0}@{1};", enterUser, wrapper.ServerName)); + sb.Append(string.Format("Pwd={0};", enterPassword)); + sb.Append("Encrypt=yes;Connection Timeout=30;"); + return sb.ToString(); + } + + private string ConstructJdbcConnectionString(AuditingPolicy wrapper, DatabaseSecurityPolicyProperties properties) + { + string enterUser = Microsoft.Azure.Commands.Sql.Properties.Resources.EnterUserId; + string enterPassword = Microsoft.Azure.Commands.Sql.Properties.Resources.EnterPassword; + return string.Format("jdbc:sqlserver://{0}:{1};database={2};user={3}@{4};password={5};encrypt=true;hostNameInCertificate=*.database.secure.windows.net;loginTimeout=30;", + properties.ProxyDnsName, properties.ProxyPort, wrapper.DatabaseName, enterUser, wrapper.ServerName, enterPassword); + } + + private string ConstructAdoNetConnectionString(AuditingPolicy wrapper,DatabaseSecurityPolicyProperties properties) + { + string enterUser = Microsoft.Azure.Commands.Sql.Properties.Resources.EnterUserId; + string enterPassword = Microsoft.Azure.Commands.Sql.Properties.Resources.EnterPassword; + return string.Format("Server=tcp:{0},{1};Database={2};User ID={3}@{4};Password={5};Trusted_Connection=False;Encrypt=True;Connection Timeout=30", + properties.ProxyDnsName, properties.ProxyPort, wrapper.DatabaseName, enterUser, wrapper.ServerName, enterPassword); } private void AddEventTypesToWrapperFromPolicy(AuditingPolicy wrapper, DatabaseSecurityPolicyProperties properties) diff --git a/src/ResourceManager/Sql/Commands.Sql/packages.config b/src/ResourceManager/Sql/Commands.Sql/packages.config index f72e111e16ce..8fa0fe0627c6 100644 --- a/src/ResourceManager/Sql/Commands.Sql/packages.config +++ b/src/ResourceManager/Sql/Commands.Sql/packages.config @@ -1,7 +1,7 @@  - + @@ -9,8 +9,8 @@ - - + + diff --git a/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj b/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj index 66baca79a544..fdedd95890ca 100644 --- a/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj +++ b/src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj @@ -74,11 +74,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll diff --git a/src/ResourceManager/Tags/Commands.Tags/packages.config b/src/ResourceManager/Tags/Commands.Tags/packages.config index 15dd2cb893b1..cf130c809bb4 100644 --- a/src/ResourceManager/Tags/Commands.Tags/packages.config +++ b/src/ResourceManager/Tags/Commands.Tags/packages.config @@ -6,7 +6,7 @@ - - + + \ No newline at end of file diff --git a/src/ServiceManagement/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj b/src/ServiceManagement/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj index 49e3198321f4..cfd74729dd00 100644 --- a/src/ServiceManagement/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj +++ b/src/ServiceManagement/Automation/Commands.Automation.Test/Commands.Automation.Test.csproj @@ -62,11 +62,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/ServiceManagement/Automation/Commands.Automation.Test/packages.config b/src/ServiceManagement/Automation/Commands.Automation.Test/packages.config index 61f07aca05c3..493c62373189 100644 --- a/src/ServiceManagement/Automation/Commands.Automation.Test/packages.config +++ b/src/ServiceManagement/Automation/Commands.Automation.Test/packages.config @@ -4,8 +4,8 @@ - - + + \ No newline at end of file diff --git a/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj b/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj index 45ccfcbd4807..075d0daa9067 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj +++ b/src/ServiceManagement/Automation/Commands.Automation/Commands.Automation.csproj @@ -70,11 +70,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll diff --git a/src/ServiceManagement/Automation/Commands.Automation/packages.config b/src/ServiceManagement/Automation/Commands.Automation/packages.config index c1800219d89c..c597ef88a040 100644 --- a/src/ServiceManagement/Automation/Commands.Automation/packages.config +++ b/src/ServiceManagement/Automation/Commands.Automation/packages.config @@ -5,7 +5,7 @@ - - + + \ No newline at end of file diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj index 18afdc586714..7be82b7d1727 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj @@ -82,11 +82,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config index 244087329296..3a846474ee94 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config @@ -8,8 +8,8 @@ - - + + diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj index b69b462a090d..7554bfa4a04d 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj @@ -82,11 +82,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll @@ -101,7 +101,7 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll False diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config index 60e40c1d9cac..835cb1f46de4 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config @@ -8,12 +8,12 @@ - - + + - + diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj index 0dc6d8691976..938d3f3f7517 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj @@ -84,11 +84,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll @@ -103,7 +103,7 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll False diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/CredentialHelper.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/CredentialHelper.cs index df9d65c4deb1..579a68ccb504 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/CredentialHelper.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/CredentialHelper.cs @@ -34,7 +34,6 @@ public static class CredentialHelper private static string DefaultStorageAccountVariable = "AZURERT_DEFAULT_STORAGE_ACCOUNT"; private static string DefaultLocationVariable = "AZURERT_DEFAULT_LOCATION"; private static string CredentialBlobUriFormat = "https://{0}.blob.core.windows.net"; - //private static string CredentialImportFormat = "Import-AzurePublishSettingsFile '{0}'"; private static string publishSettingsFile = null; private static string defaultSubscriptionName = null; @@ -42,6 +41,7 @@ public static class CredentialHelper private static string defaultStorageName = null; private static string currentTestEnvironment = null; private static CloudBlobContainer blobContainer; + private const string VhdFilesContainerName = "vhdfiles"; private static Dictionary environment = new Dictionary(); public static Dictionary PowerShellVariables { get; private set; } @@ -59,10 +59,15 @@ public static void GetCredentialInfo(string downloadDirectoryPath) Assert.IsTrue(environment.ContainsKey(StorageAccountKeyVariable), string.Format("You must define a storage account key for credential download using environment variable {0}", StorageAccountKeyVariable)); string storageAccountKey = environment[StorageAccountKeyVariable]; + DownloadTestCredentials(currentTestEnvironment, downloadDirectoryPath, string.Format(CredentialBlobUriFormat, storageAccount), storageAccount, storageAccountKey); + DownloadTestVhdsAndPackages(currentTestEnvironment, downloadDirectoryPath, + string.Format(CredentialBlobUriFormat, storageAccount), + storageAccount, storageAccountKey); + if (environment.ContainsKey(DefaultStorageAccountVariable)) { string.Format("Default storage account name define is {0}", DefaultStorageAccountVariable); @@ -96,6 +101,22 @@ private static void DownloadTestCredentials(string testEnvironment, string downl } } + private static void DownloadTestVhdsAndPackages(string testEnvironment, string downloadDirectoryPath, string blobUri, string storageAccount, string storageKey) + { + StorageCredentials credentials = new StorageCredentials(storageAccount, storageKey); + CloudBlobClient blobClient = new CloudBlobClient(new Uri(blobUri), credentials); + blobContainer = blobClient.GetContainerReference(VhdFilesContainerName); + foreach (IListBlobItem blobItem in blobContainer.ListBlobs()) + { + ICloudBlob blob = blobClient.GetBlobReferenceFromServer(blobItem.Uri); + Console.WriteLine("Downloading file {0} from blob Uri {1}", blob.Name, blob.Uri); + FileStream blobStream = new FileStream(Path.Combine(downloadDirectoryPath, blob.Name), FileMode.Create); + blob.DownloadToStream(blobStream); + blobStream.Flush(); + blobStream.Close(); + } + } + public static void GetTestSettings(string testSettings) { switch (testSettings) diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs index a3f0998cc7c5..f1ba137d59dd 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ScenarioTest.cs @@ -225,8 +225,15 @@ public void ProvisionLinuxVM() try { - vmPowershellCmdlets.NewAzureQuickVM(OS.Linux, newAzureLinuxVMName, serviceName, linuxImageName, "user", - password, locationName); + Utilities.RetryActionUntilSuccess(() => + { + if (vmPowershellCmdlets.TestAzureServiceName(serviceName)) + { + var op = vmPowershellCmdlets.RemoveAzureService(serviceName); + } + + vmPowershellCmdlets.NewAzureQuickVM(OS.Linux, newAzureLinuxVMName, serviceName, linuxImageName, "user", password, locationName); + }, "Windows Azure is currently performing an operation on this hosted service that requires exclusive access.", 10, 30); // Verify PersistentVMRoleContext vmRoleCtxt = vmPowershellCmdlets.GetAzureVM(newAzureLinuxVMName, serviceName); diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs index a932994c8c42..ef084d8d9fac 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs @@ -69,13 +69,6 @@ public class ServiceManagementTest private TestContext testContextInstance; - private const string VhdFilesContainerName = "vhdfiles"; - private static readonly string[] VhdFiles = new[] - { - "dynamic_50.vhd", "dynamic_50_child01.vhd", "dynamic_50_child02.vhd", - "fixed_50.vhd", "fixed_50_child01.vhd", "fixed_50_child02.vhd" - }; - /// ///Gets or sets the test context which provides ///information about and functionality for the current test run. @@ -202,26 +195,6 @@ private static string GetDefaultStorage(string storageName, string locName) return null; } - private static string GetSubscriptionName(string publishSettingsFile) - { - try - { - XDocument psf = XDocument.Load(publishSettingsFile); - XElement pubData = psf.Descendants().FirstOrDefault(); - XElement pubProfile = pubData.Elements().ToList()[0]; - XElement sub = pubProfile.Elements().ToList()[0]; - string subName = sub.Attribute("Name").Value; - Console.WriteLine("Getting subscription: {0}", subName); - - return subName; - } - catch - { - Console.WriteLine("Error occurred during loading publish settings file..."); - return null; - } - } - private static string GetServiceManagementUrl(string publishSettingsFile) { try @@ -346,15 +319,6 @@ public static void SetTestSettings() Console.WriteLine("Error occurred during Get-AzureVMImageName... imageName is not set."); } - try - { - DownloadVhds(); - } - catch - { - Console.WriteLine("Error occurred during downloading vhds..."); - } - if (String.IsNullOrEmpty(imageName)) { Console.WriteLine("No image is selected!"); @@ -414,41 +378,6 @@ protected static void CleanupService(string svcName) Utilities.TryAndIgnore(() => vmPowershellCmdlets.RemoveAzureService(svcName, true), "does not exist"); } - protected static void DownloadVhds() - { - storageAccountKey = vmPowershellCmdlets.GetAzureStorageAccountKey(defaultAzureSubscription.CurrentStorageAccountName); - - foreach (var vhdFile in VhdFiles) - { - string vhdBlobLocation = string.Format("{0}{1}/{2}", blobUrlRoot, VhdFilesContainerName, vhdFile); - - var vhdLocalPath = new FileInfo(Directory.GetCurrentDirectory() + "\\" + vhdFile); - - if (!File.Exists(vhdLocalPath.FullName)) - { - // Set the source blob - BlobHandle blobHandle = Utilities.GetBlobHandle(vhdBlobLocation, storageAccountKey.Primary); - - SaveVhd(blobHandle, vhdLocalPath, storageAccountKey.Primary); - } - } - } - - protected static void SaveVhd(BlobHandle destination, FileInfo locFile, string storageKey, int? numThread = null, bool overwrite = false) - { - try - { - Console.WriteLine("Downloading a VHD from {0} to {1}...", destination.Blob.Uri.ToString(), locFile.FullName); - DateTime startTime = DateTime.Now; - vmPowershellCmdlets.SaveAzureVhd(destination.Blob.Uri, locFile, numThread, storageKey, overwrite); - Console.WriteLine("Downloading completed in {0} seconds.", (DateTime.Now - startTime).TotalSeconds); - } - catch (Exception e) - { - Assert.Fail(e.InnerException.ToString()); - } - } - protected void VerifyRDP(string serviceName, string rdpPath) { Utilities.GetDeploymentAndWaitForReady(serviceName, DeploymentSlotType.Production, 10, 600); diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config index d23e9867f5d8..47e809bbc43a 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config @@ -9,12 +9,12 @@ - - + + - + diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj index 377c84f3517b..4cd52cf3cdc8 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj @@ -84,11 +84,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll @@ -103,7 +103,7 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll False diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscSettingsSerializer.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscSettingsSerializer.cs index 5f9293030da6..9dac6c85073e 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscSettingsSerializer.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/DscSettingsSerializer.cs @@ -68,9 +68,9 @@ public static DscPublicSettings DeserializePublicSettings(string publicSettingsS JsonConvert.DeserializeObject(publicSettingsString); publicSettings = publicSettingsV1.ToCurrentVersion(); } - catch (JsonException e) + catch (JsonException) { - throw e; + throw; } } return publicSettings; diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Model/DeploymentInfoContext.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/Model/DeploymentInfoContext.cs index c60093f3ac7d..3c051acbf4dc 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Model/DeploymentInfoContext.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Model/DeploymentInfoContext.cs @@ -255,7 +255,7 @@ public DeploymentInfoContext(DeploymentGetResponse deployment) this.RolesConfiguration = new Dictionary(); - var roles = doc.Root.Descendants(this.ns + "Role"); + var roles = doc.Root.Descendants(this.ns + "Role").Where(t => t.Parent == doc.Root); foreach (var role in roles) { diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config index 60e40c1d9cac..835cb1f46de4 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config @@ -8,12 +8,12 @@ - - + + - + diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj index c5450f7d7711..8ad59476a26f 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj @@ -55,11 +55,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config index 48442ff69322..2229a2a14dca 100644 --- a/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config +++ b/src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config @@ -4,8 +4,8 @@ - - + + \ No newline at end of file diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj index 1bdcdb779650..ce0aa0c4258f 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj @@ -68,11 +68,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightJobSubmissionClientSimulator.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightJobSubmissionClientSimulator.cs index d59b5c97ee79..728f8bb95712 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightJobSubmissionClientSimulator.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightJobSubmissionClientSimulator.cs @@ -54,7 +54,7 @@ public AzureHDInsightJobSubmissionClientSimulator( this.InitializeSimulator(); } - public void Dispose() + public new void Dispose() { } @@ -65,17 +65,17 @@ public string GetCustomUserAgent() throw new NotImplementedException(); } - public void AddLogWriter(ILogWriter logWriter) + public new void AddLogWriter(ILogWriter logWriter) { this.logger.AddWriter(logWriter); } - public void RemoveLogWriter(ILogWriter logWriter) + public new void RemoveLogWriter(ILogWriter logWriter) { this.logger.RemoveWriter(logWriter); } - public void Cancel() + public new void Cancel() { } @@ -329,12 +329,12 @@ public Task ListJobsAsync() return TaskEx2.FromResult(jobDetailList); } - public void SetCancellationSource(CancellationTokenSource tokenSource) + public new void SetCancellationSource(CancellationTokenSource tokenSource) { this.cancellationTokenSource = tokenSource; } - public bool IgnoreSslErrors { get; set; } + public new bool IgnoreSslErrors { get; set; } public JobDetails StopJob(string jobId) { @@ -537,6 +537,6 @@ private void WriteJobOutput(string jobId, string statusDirectory, string stdoutC this.jobOutput[jobId] = stdoutContent; } - public ILogger Logger { get; private set; } + public new ILogger Logger { get; private set; } } } diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/packages.config b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/packages.config index 26c6b2de0c82..c33660e0c70c 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/packages.config +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight.Test/packages.config @@ -8,8 +8,8 @@ - - + + diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/GetAzureHDInsightJobOutputCmdlet.cs b/src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/GetAzureHDInsightJobOutputCmdlet.cs index 2fc8ef42facc..ab9cf7f0b5ec 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/GetAzureHDInsightJobOutputCmdlet.cs +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/GetAzureHDInsightJobOutputCmdlet.cs @@ -136,21 +136,39 @@ protected override void EndProcessing() this.command.CurrentSubscription = this.GetCurrentSubscription(this.Subscription, this.Certificate); this.AssertTaskLogsDirectorySpecified(this.TaskLogsDirectory); - if (this.StandardError.IsPresent) + int numSpecifiedOutputTypes = 0; + string selectedOutputType = "Standard Output"; + this.command.OutputType = JobOutputType.StandardOutput; + + if (this.StandardOutput.IsPresent) { - this.command.OutputType = JobOutputType.StandardError; + numSpecifiedOutputTypes++; } - else if (this.TaskSummary.IsPresent) + + if (this.DownloadTaskLogs.IsPresent) + { + this.command.OutputType = JobOutputType.TaskLogs; + selectedOutputType = "Task Logs"; + numSpecifiedOutputTypes++; + } + + if (this.TaskSummary.IsPresent) { this.command.OutputType = JobOutputType.TaskSummary; + selectedOutputType = "Task Summary"; + numSpecifiedOutputTypes++; } - else if (this.DownloadTaskLogs.IsPresent) + + if (this.StandardError.IsPresent) { - this.command.OutputType = JobOutputType.TaskLogs; + this.command.OutputType = JobOutputType.StandardError; + selectedOutputType = "Standard Error"; + numSpecifiedOutputTypes++; } - else + + if (numSpecifiedOutputTypes > 1) { - this.command.OutputType = JobOutputType.StandardOutput; + this.WriteWarning(String.Format("This cmdlet supports specifying only one job output type. Only {0} will be returned", selectedOutputType)); } try diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj b/src/ServiceManagement/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj index 5299623ae63a..1b5491787cef 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/Commands.HDInsight.csproj @@ -73,11 +73,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/ServiceManagement/HDInsight/Commands.HDInsight/packages.config b/src/ServiceManagement/HDInsight/Commands.HDInsight/packages.config index c12aa7900a7c..105f7505faea 100644 --- a/src/ServiceManagement/HDInsight/Commands.HDInsight/packages.config +++ b/src/ServiceManagement/HDInsight/Commands.HDInsight/packages.config @@ -8,8 +8,8 @@ - - + + diff --git a/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/Commands.ManagedCache.Test.csproj b/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/Commands.ManagedCache.Test.csproj index da7e309099eb..5d5afb66da44 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/Commands.ManagedCache.Test.csproj +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/Commands.ManagedCache.Test.csproj @@ -74,11 +74,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/packages.config b/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/packages.config index 304b6619a203..03ff9e41503d 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/packages.config +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache.Test/packages.config @@ -10,8 +10,8 @@ - - + + diff --git a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Commands.ManagedCache.csproj b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Commands.ManagedCache.csproj index d1b1e36ed9eb..1aeed4f80c51 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Commands.ManagedCache.csproj +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/Commands.ManagedCache.csproj @@ -64,11 +64,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/packages.config b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/packages.config index fbe39bb5fc17..9ea704f2a146 100644 --- a/src/ServiceManagement/ManagedCache/Commands.ManagedCache/packages.config +++ b/src/ServiceManagement/ManagedCache/Commands.ManagedCache/packages.config @@ -7,8 +7,8 @@ - - + + diff --git a/src/ServiceManagement/Network/Commands.Network.Test/Commands.Network.Test.csproj b/src/ServiceManagement/Network/Commands.Network.Test/Commands.Network.Test.csproj index de6c36559181..70a0695d54b3 100644 --- a/src/ServiceManagement/Network/Commands.Network.Test/Commands.Network.Test.csproj +++ b/src/ServiceManagement/Network/Commands.Network.Test/Commands.Network.Test.csproj @@ -73,10 +73,10 @@ - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False @@ -92,9 +92,9 @@ ..\..\..\packages\Microsoft.WindowsAzure.Management.Monitoring.1.0.0\lib\net40\Microsoft.WindowsAzure.Management.Monitoring.dll - + False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll ..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.3.0.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll diff --git a/src/ServiceManagement/Network/Commands.Network.Test/packages.config b/src/ServiceManagement/Network/Commands.Network.Test/packages.config index 14c31f5af839..5dffcc2761fe 100644 --- a/src/ServiceManagement/Network/Commands.Network.Test/packages.config +++ b/src/ServiceManagement/Network/Commands.Network.Test/packages.config @@ -10,14 +10,14 @@ - - + + - + diff --git a/src/ServiceManagement/Network/Commands.Network/Commands.Network.csproj b/src/ServiceManagement/Network/Commands.Network/Commands.Network.csproj index 94666af1c074..b8521350ee9b 100644 --- a/src/ServiceManagement/Network/Commands.Network/Commands.Network.csproj +++ b/src/ServiceManagement/Network/Commands.Network/Commands.Network.csproj @@ -51,11 +51,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False @@ -63,7 +63,7 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll False @@ -92,7 +92,8 @@ - + + @@ -101,10 +102,11 @@ - + - - + + + diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVNetGatewayIPsecParameters.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVNetGatewayIPsecParameters.cs new file mode 100644 index 000000000000..61163d9ec7bb --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/GetAzureVNetGatewayIPsecParameters.cs @@ -0,0 +1,42 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright 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. +// ---------------------------------------------------------------------------------- + +using System.Management.Automation; +using Microsoft.WindowsAzure.Management.Network.Models; + +namespace Microsoft.Azure.Commands.Network.Gateway +{ + [Cmdlet(VerbsCommon.Get, "AzureVNetGatewayIPsecParameters"), OutputType(typeof(IPsecParameters))] + public class GetAzureVNetGatewayIPsecParameters : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network name.")] + [ValidateNotNullOrEmpty] + public string VNetName + { + get; set; + } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The local network site name.")] + [ValidateNotNullOrEmpty] + public string LocalNetworkSiteName + { + get; set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.GetIPsecParameters(VNetName, LocalNetworkSiteName)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/VirtualNetworkGatewayContext.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/VirtualNetworkGatewayContext.cs index 86a5749bae35..33f0539e44e3 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/Model/VirtualNetworkGatewayContext.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/Model/VirtualNetworkGatewayContext.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Commands.Network { using System; using WindowsAzure.Commands.Utilities.Common; - using WindowsAzure.Management.Network.Models; public class VirtualNetworkGatewayContext : ManagementOperationContext { @@ -34,6 +33,6 @@ public class VirtualNetworkGatewayContext : ManagementOperationContext public string DefaultSite { get; set; } - public GatewaySKU GatewaySKU { get; set; } + public string GatewaySKU { get; set; } } } \ No newline at end of file diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVNetGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVNetGateway.cs index 383604c5bd29..94cf220994b9 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVNetGateway.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/NewAzureVNetGateway.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Commands.Network.Gateway { using System.Management.Automation; using WindowsAzure.Commands.Utilities.Common; - using WindowsAzure.Management.Network.Models; [Cmdlet(VerbsCommon.New, "AzureVNetGateway"), OutputType(typeof(ManagementOperationContext))] public class NewAzureVNetGatewayCommand : NetworkCmdletBase @@ -25,10 +24,10 @@ public class NewAzureVNetGatewayCommand : NetworkCmdletBase public string VNetName { get; set; } [Parameter(Position = 1, Mandatory = false, HelpMessage = "The type of routing that the gateway will use. This will default to StaticRouting if no value is provided.")] - public GatewayType GatewayType { get; set; } + public string GatewayType { get; set; } [Parameter(Position = 2, Mandatory = false, HelpMessage = "The Gateway SKU for the new gateway.")] - public GatewaySKU GatewaySKU { get; set; } + public string GatewaySKU { get; set; } public override void ExecuteCmdlet() { diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/ResizeAzureVnetGateway.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/ResizeAzureVnetGateway.cs index 6aed510aa466..9d111b48b59c 100644 --- a/src/ServiceManagement/Network/Commands.Network/Gateway/ResizeAzureVnetGateway.cs +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/ResizeAzureVnetGateway.cs @@ -15,24 +15,21 @@ namespace Microsoft.Azure.Commands.Network.Gateway { using System.Management.Automation; - using WindowsAzure.Commands.Utilities.Common; using WindowsAzure.Management.Network.Models; - [Cmdlet(VerbsCommon.Resize, "AzureVNetGateway"), OutputType(typeof(ManagementOperationContext))] + [Cmdlet(VerbsCommon.Resize, "AzureVNetGateway"), OutputType(typeof(GatewayGetOperationStatusResponse))] public class ResizeAzureVNetGateway : NetworkCmdletBase { [Parameter(Position = 0, Mandatory = true, HelpMessage = "Virtual network name.")] public string VNetName { - get; - set; + get; set; } [Parameter(Position = 1, Mandatory = true, HelpMessage = "The SKU that the existing gateway will be resized to.")] - public GatewaySKU GatewaySKU + public string GatewaySKU { - get; - set; + get; set; } public override void ExecuteCmdlet() diff --git a/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVNetGatewayIPsecParameters.cs b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVNetGatewayIPsecParameters.cs new file mode 100644 index 000000000000..3bf5a1058236 --- /dev/null +++ b/src/ServiceManagement/Network/Commands.Network/Gateway/SetAzureVNetGatewayIPsecParameters.cs @@ -0,0 +1,74 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright 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. +// ---------------------------------------------------------------------------------- + +using System.Management.Automation; +using Microsoft.WindowsAzure.Management.Network.Models; + +namespace Microsoft.Azure.Commands.Network.Gateway +{ + [Cmdlet(VerbsCommon.Set, "AzureVNetGatewayIPsecParameters"), OutputType(typeof(GatewayGetOperationStatusResponse))] + public class SetAzureVNetGatewayIPsecParameters : NetworkCmdletBase + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "The virtual network name.")] + [ValidateNotNullOrEmpty] + public string VNetName + { + get; set; + } + + [Parameter(Position = 1, Mandatory = true, HelpMessage = "The local network site name.")] + [ValidateNotNullOrEmpty] + public string LocalNetworkSiteName + { + get; set; + } + + [Parameter(Position = 2, Mandatory = false, HelpMessage = "The type of encryption that will " + + "be used for the connection between the virtual network gateway and the local network. " + + "Valid values are RequireEncryption and NoEncryption.")] + public string EncryptionType + { + get; set; + } + + [Parameter(Position = 3, Mandatory = false, HelpMessage = "The PFS gruop that will be used " + + "for the connection between the virtual network gateway and the local network. Valid " + + "values are RequireEncryption and NoEncryption.")] + public string PfsGroup + { + get; set; + } + + [Parameter(Position = 4, Mandatory = false, HelpMessage = "The SA Data Size Kilobytes value " + + "is used to determine how many kilobytes of traffic can be sent before the SA for the" + + "connection will be renegotiated.")] + public int SADataSizeKilobytes + { + get; set; + } + + [Parameter(Position = 5, Mandatory = false, HelpMessage = "The SA Lifetime Seconds value " + + "is used to determine how long (in seconds) this connection's SA will be valid before " + + "a new SA will be negotiated.")] + public int SALifetimeSeconds + { + get; set; + } + + public override void ExecuteCmdlet() + { + WriteObject(Client.SetIPsecParameters(VNetName, LocalNetworkSiteName, EncryptionType, PfsGroup, SADataSizeKilobytes, SALifetimeSeconds)); + } + } +} diff --git a/src/ServiceManagement/Network/Commands.Network/Microsoft.Azure.Commands.Network.dll-help.xml b/src/ServiceManagement/Network/Commands.Network/Microsoft.Azure.Commands.Network.dll-help.xml index 686a54414f21..b8b88a26a70a 100644 --- a/src/ServiceManagement/Network/Commands.Network/Microsoft.Azure.Commands.Network.dll-help.xml +++ b/src/ServiceManagement/Network/Commands.Network/Microsoft.Azure.Commands.Network.dll-help.xml @@ -1,1090 +1,3598 @@ - - - - - Get-AzureManagedCache - - Gets the Azure Caches in your Azure account. - - - - - Get - AzureManagedCache - - - - The Get-AzureManagedCache cmdlet get the Azure Caches in your account. By default, it gets all Azure Caches in the account. To get a particular Azure Cache, use the Name parameter. - An Azure Cache is a secure, dedicated cache that provides extremely fast access to data. This distributed, in-memory, scalable solution enables you to build highly scalable and responsive applications. For more information about Azure Cache, see Azure Cache (http://azure.microsoft.com/en-us/services/cache/). - - - - Get-AzureManagedCache - - Name - - Gets only the specified Azure Cache. Enter the name of an Azure Cache. The parameter value is case-sensitive. Wildcards are not permitted. This parameter is optional. By default, Get-AzureManagedCache get all Azure Caches in the account. - - String - - - - - - Name - - Gets only the specified Azure Cache. Enter the name of an Azure Cache. The parameter value is case-sensitive. Wildcards are not permitted. This parameter is optional. By default, Get-AzureManagedCache get all Azure Caches in the account. - - String - - String - - - - - - - - - - None - - - - - - - - You can pipe input to this cmdlet by property name, but not by value. - - - - - - - Microsoft.Azure.Commands.ManagedCache.Models.PSCacheService - - - - - - - - - - - - - - - - - - Before using this cmdlet, use Add-AzureAccount or Import-AzurePublishSettingsFile to make your Azure account available to Windows PowerShell. For more information, see How to install and configure Azure PowerShell (http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/). - - - - - Example 1: Get all Azure Caches - - - - - PS C:\>Get-AzureManagedCache + + + + + Get-AzureNetworkSecurityGroup + + + + + + + Get + AzureNetworkSecurityGroup + + + + + + + + + Get-AzureNetworkSecurityGroup + + Name + + + + String + + + Detailed + + + + SwitchParameter + + + + + + Name + + + + String + + String + + + + + + Detailed + + + + SwitchParameter + + SwitchParameter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureNetworkSecurityGroupForSubnet + + + + + + + Get + AzureNetworkSecurityGroupForSubnet + + + + + + + + + Get-AzureNetworkSecurityGroupForSubnet + + VirtualNetworkName + + + + String + + + SubnetName + + + + String + + + Detailed + + + + SwitchParameter + + + + + + VirtualNetworkName + + + + String + + String + + + + + + SubnetName + + + + String + + String + + + + + + Detailed + + + + SwitchParameter + + SwitchParameter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureRouteTable + + + + + + + Get + AzureRouteTable + + + + + + + + + Get-AzureRouteTable + + Name + + + + String + + + DetailLevel + + + + String + + + + + + Name + + + + String + + String + + + + + + DetailLevel + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureSubnetRouteTable + + + + + + + Get + AzureSubnetRouteTable + + + + + + + + + Get-AzureSubnetRouteTable + + VNetName + + + + String + + + SubnetName + + + + String + + + + + + VNetName + + + + String + + String + + + + + + SubnetName + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureVNetConnection + + + + + + + Get + AzureVNetConnection + + + + + + + + + Get-AzureVNetConnection + + VNetName + + + + String + + + + + + VNetName + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureVNetGateway + + Get the current status of an existing virtual network gateway. + + + + + Get + AzureVNetGateway + + + + + Get the current status of an existing virtual network gateway. + + + + Get-AzureVNetGateway + + VNetName + + + + String + + + + + + VNetName + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureVNetGatewayDiagnostics + + Get the current state and (if it exists) the url of the blob where the most recent diagnostics session was saved. + + + + + Get + AzureVNetGatewayDiagnostics + + + + + Get the current state and (if it exists) the url of the blob where the most recent diagnostics session was saved. + + + + Get-AzureVNetGatewayDiagnostics + + VNetName + + + + String + + + + + + VNetName + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureVNetGatewayIPsecParameters + + Get the current IPsec parameters that have been set on the connection between the provided virtual network gateway and local network site. + + + + + Get + AzureVNetGatewayIPsecParameters + + + + + Get the current IPsec parameters that have been set on the connection between the provided virtual network gateway and local network site. + + + + Get-AzureVNetGatewayIPsecParameters + + VNetName + + + + String + + + LocalNetworkSiteName + + + + String + + + + + + VNetName + + + + String + + String + + + + + + LocalNetworkSiteName + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get-AzureVNetGatewayKey + + Get the pre-shared key for the connection between the provided virtual network gateway and local network site. + + + + + Get + AzureVNetGatewayKey + + + + + Get the pre-shared key for the connection between the provided virtual network gateway and local network site. + + + + Get-AzureVNetGatewayKey + + VNetName + + + + String + + + LocalNetworkSiteName + + + + String + + + + + + VNetName + + + + String + + String + + + + + + LocalNetworkSiteName + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + New-AzureNetworkSecurityGroup + + + + + + + New + AzureNetworkSecurityGroup + + + + + + + + + New-AzureNetworkSecurityGroup + + Name + + + + String + + + Location + + + + String + + + Label + + + + String + + + + + + Name + + + + String + + String + + + + + + Location + + + + String + + String + + + + + + Label + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + New-AzureRouteTable + + + + + + + New + AzureRouteTable + + + + + + + + + New-AzureRouteTable + + Name + + + + String + + + Label + + + + String + + + Location + + + + String + + + + + + Name + + + + String + + String + + + + + + Label + + + + String + + String + + + + + + Location + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + New-AzureVNetGateway + + Create a new virtual network gateway in the provided virtual network. + + + + + New + AzureVNetGateway + + + + + Create a new virtual network gateway in the provided virtual network. You can also specify the SKU of the gateway (Default or HighPerformance) as well as the type (StaticRouting or DynamicRouting). + + + + New-AzureVNetGateway + + VNetName + + + + String + + + GatewayType + + + + String + + + GatewaySKU + + + + String + + + + + + VNetName + + + + String + + String + + + + + + GatewayType + + + + String + + String + + + + + + GatewaySKU + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureNetworkSecurityGroup + + + + + + + Remove + AzureNetworkSecurityGroup + + + + + + + + + Remove-AzureNetworkSecurityGroup + + Name + + + + String + + + Force + + + + SwitchParameter + + + PassThru + + + + SwitchParameter + + + + + + Name + + + + String + + String + + + + + + Force + + + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + + + SwitchParameter + + SwitchParameter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureNetworkSecurityGroupFromSubnet + + + + + + + Remove + AzureNetworkSecurityGroupFromSubnet + + + + + + + + + Remove-AzureNetworkSecurityGroupFromSubnet + + Name + + + + String + + + VirtualNetworkName + + + + String + + + SubnetName + + + + String + + + Force + + + + SwitchParameter + + + PassThru + + + + SwitchParameter + + + + + + Name + + + + String + + String + + + + + + VirtualNetworkName + + + + String + + String + + + + + + SubnetName + + + + String + + String + + + + + + Force + + + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + + + SwitchParameter + + SwitchParameter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureNetworkSecurityRule + + + + + + + Remove + AzureNetworkSecurityRule + + + + + + + + + Remove-AzureNetworkSecurityRule + + Name + + + + String + + + Force + + + + SwitchParameter + + + NetworkSecurityGroup + + + + INetworkSecurityGroup + + + + + + Name + + + + String + + String + + + + + + Force + + + + SwitchParameter + + SwitchParameter + + + + + + NetworkSecurityGroup + + + + INetworkSecurityGroup + + INetworkSecurityGroup + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureRoute + + + + + + + Remove + AzureRoute + + + + + + + + + Remove-AzureRoute + + RouteTableName + + + + String + + + RouteName + + + + String + + + + + + RouteTableName + + + + String + + String + + + + + + RouteName + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureRouteTable + + + + + + + Remove + AzureRouteTable + + + + + + + + + Remove-AzureRouteTable + + Name + + + + String + + + + + + Name + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureSubnetRouteTable + + + + + + + Remove + AzureSubnetRouteTable + + + + + + + + + Remove-AzureSubnetRouteTable + + VNetName + + + + String + + + SubnetName + + + + String + + + + + + VNetName + + + + String + + String + + + + + + SubnetName + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureVNetGateway + + Delete an existing virtual network gateway. + + + + + Remove + AzureVNetGateway + + + + + Delete an existing virtual network gateway. + + + + Remove-AzureVNetGateway + + VNetName + + + + String + + + + + + VNetName + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Remove-AzureVNetGatewayDefaultSite + + + + + + + Remove + AzureVNetGatewayDefaultSite + + + + + + + + + Remove-AzureVNetGatewayDefaultSite + + VNetName + + + + String + + + + + + VNetName + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Resize-AzureVNetGateway + + Resize the provided virtual network gateway to a different SKU. + + + + + Resize + AzureVNetGateway + + + + + Resize the provided virtual network gateway to a different SKU. Valid SKUs that a virtual network gateway can be resized to are Default and HighPerformance. + + + + Resize-AzureVNetGateway + + VNetName + + + + String + + + GatewaySKU + + + + String + + + + + + VNetName + + + + String + + String + + + + + + GatewaySKU + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureNetworkSecurityGroupToSubnet + + + + + + + Set + AzureNetworkSecurityGroupToSubnet + + + + + + + + + Set-AzureNetworkSecurityGroupToSubnet + + Name + + + + String + + + VirtualNetworkName + + + + String + + + SubnetName + + + + String + + + Force + + + + SwitchParameter + + + PassThru + + + + SwitchParameter + + + + + + Name + + + + String + + String + + + + + + VirtualNetworkName + + + + String + + String + + + + + + SubnetName + + + + String + + String + + + + + + Force + + + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + + + SwitchParameter + + SwitchParameter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureNetworkSecurityRule + + + + + + + Set + AzureNetworkSecurityRule + + + + + + + + + Set-AzureNetworkSecurityRule + + Name + + + + String + + + Type + + + + String + + + Priority + + + + Int32 + + + Action + + + + String + + + SourceAddressPrefix + + + + String + + + SourcePortRange + + + + String + + + DestinationAddressPrefix + + + + String + + + DestinationPortRange + + + + String + + + Protocol + + + + String + + + NetworkSecurityGroup + + + + INetworkSecurityGroup + + + + + + Name + + + + String + + String + + + + + + Type + + + + String + + String + + + + + + Priority + + + + Int32 + + Int32 + + + + + + Action + + + + String + + String + + + + + + SourceAddressPrefix + + + + String + + String + + + + + + SourcePortRange + + + + String + + String + + + + + + DestinationAddressPrefix + + + + String + + String + + + + + + DestinationPortRange + + + + String + + String + + + + + + Protocol + + + + String + + String + + + + + + NetworkSecurityGroup + + + + INetworkSecurityGroup + + INetworkSecurityGroup + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureRoute + + + + + + + Set + AzureRoute + + + + + + + + + Set-AzureRoute + + RouteTableName + + + + String + + + RouteName + + + + String + + + AddressPrefix + + + + String + + + NextHopType + + + + String + + + + + + RouteTableName + + + + String + + String + + + + + + RouteName + + + + String + + String + + + + + + AddressPrefix + + + + String + + String + + + + + + NextHopType + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureSubnetRouteTable + + + + + + + Set + AzureSubnetRouteTable + + + + + + + + + Set-AzureSubnetRouteTable + + VNetName + + + + String + + + SubnetName + + + + String + + + RouteTableName + + + + String + + + + + + VNetName + + + + String + + String + + + + + + SubnetName + + + + String + + String + + + + + + RouteTableName + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureVNetGateway + + + + + + + Set + AzureVNetGateway + + + + + + + + + Set-AzureVNetGateway + + Connect + + + + SwitchParameter + + + VNetName + + + + String + + + LocalNetworkSiteName + + + + String + + + + Set-AzureVNetGateway + + Disconnect + + + + SwitchParameter + + + VNetName + + + + String + + + LocalNetworkSiteName + + + + String + + + + + + Connect + + + + SwitchParameter + + SwitchParameter + + + + + + VNetName + + + + String + + String + + + + + + LocalNetworkSiteName + + + + String + + String + + + + + + Disconnect + + + + SwitchParameter + + SwitchParameter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureVNetGatewayDefaultSite + + + + + + + Set + AzureVNetGatewayDefaultSite + + + + + + + + + Set-AzureVNetGatewayDefaultSite + + VNetName + + + + String + + + DefaultSite + + + + String + + + + + + VNetName + + + + String + + String + + + + + + DefaultSite + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureVNetGatewayIPsecParameters + + Set the IPsec parameters that will be used for the connection between the provided virtual network gateway and local network site. + + + + + Set + AzureVNetGatewayIPsecParameters + + + + + Set the IPsec parameters that will be used for the connection between the provided virtual network gateway and local network site. - - - This command gets all Azure Caches in your account. - - - - - - - - - Example 2: Get an Azure Cache by name - - - - - PS C:\>Get-AzureManagedCache -Name ContosoCache - - - - This command gets only the ContosoCache Azure Cache. - - - - - - - - - - - Online Version: - - - - - New-AzureManagedCache - - - - Set-AzureManagedCache - - - - Remove-AzureManagedCache - - - - Get-AzureManagedCacheAccessKey - - - - New-AzureManagedCacheAccessKey - - - - - - - Get-AzureManagedCacheAccessKey - - Gets the access keys for an Azure Cache - - - - - Get - AzureManagedCacheAccessKey - - - - The Get-AzureManagedCacheAccessKey cmdlet gets the primary and secondary access keys for an Azure Cache. You can use these keys to allow clients, such as web applications, to access to your Azure Cache. - Typically, you use the primary key, but use the secondary key to avoid delays while the primary key is being regenerated. To get new access keys, use the New- AzureManagedCacheAccessKey cmdlet - An Azure Cache is a secure, dedicated cache that provides extremely fast access to data. This distributed, in-memory, scalable solution enables you to build highly scalable and responsive applications. For more information about Azure Cache, see Azure Cache (http://azure.microsoft.com/en-us/services/cache/). - - - - Get-AzureManagedCacheAccessKey - - Name - - Specifies the name of the Azure Cache. This parameter value is case-sensitve. Wildcard characters are not permitted. This parameter is required. - - String - - - - - - Name - - Specifies the name of the Azure Cache. This parameter value is case-sensitve. Wildcard characters are not permitted. This parameter is required. - - String - - String - - - - - - - - - - None - - - - - - - - You can pipe input to this cmdlet by property name, but not by value. - - - - - - - Microsoft.Azure.Management.ManagedCache.Models.CachingKeysResponse - - - - - - - - - - - - - - - - - Example 1: Get the access key - - - - - PS C:\>Get-AzureManagedCacheAccessKey -Name contosocache - - - - This command gets the access key for the contosocache Azure Cache. - - - - - - - - - - - New-AzureManagedCacheAccessKey - - - - New-AzureManagedCache - - - - Get-AzureManagedCache - - - - Set-AzureManagedCache - - - - Remove-AzureManagedCache - - - - Get-AzureManagedCacheAccessKey - - - - New-AzureManagedCacheAccessKey - - - - - - - New-AzureManagedCache - - Creates an Azure cache - - - - - New - AzureManagedCache - - - - The New-AzureManagedCache cmdlet creates an Azure Cache in your Azure account and returns an object that represents the new Azure Cache. - An Azure Cache is a secure, dedicated cache that provides extremely fast access to data. This distributed, in-memory, scalable solution enables you to build highly scalable and responsive applications. For more information about Azure Cache, see Azure Cache (http://azure.microsoft.com/en-us/services/cache/). - - - - New-AzureManagedCache - - Name - - Specifies a name for the Azure Cache. The name can include only lower-case letters and numbers, and it must begin with a lower-case letter. The name must be unique. This parameter is required. - - String - - - Location - - Specifies the location of the Azure Cache. Enter an Azure data center location, such as "North Central US" or "West Europe". This parameter is required. - To find a location that supports Azure Cache, use the Switch-AzureModule cmdlet to switch to the AzureResourceManager module, and then use the Get-AzureLocation cmdlet. - - String - - - Memory - - Specifies the size of the Azure Cache. The cache size might affect the cost of the service. Enter a value followed by "MB" or "GB" (no intervening space), such as (128MB or 8GB). This value must be compatible with the value of the Sku parameter. This parameter is optional. The default value is the lowest value in the range specified by the Sku parameter. - -- When the value of Sku is Basic, the value of Memory must be divisible by 128MB. - --- When the value of Sku is Standard, the value of Memory must be divisible by 1GB. - --- When the value of Sku is Premium, the value of Memory must be divisible by 5GB. - - String - - - Sku - - Specifies the tier of the Azure Cache. Valid values are Basic (128MB - 1GB), Standard (1GB - 10GB), and Premium (5GB - 150GB). This parameter is optional. The default value is Basic. - - String - - - - - - Location - - Specifies the location of the Azure Cache. Enter an Azure data center location, such as "North Central US" or "West Europe". This parameter is required. - To find a location that supports Azure Cache, use the Switch-AzureModule cmdlet to switch to the AzureResourceManager module, and then use the Get-AzureLocation cmdlet. - - String - - String - - - - - - - Memory - - Specifies the size of the Azure Cache. The cache size might affect the cost of the service. Enter a value followed by "MB" or "GB" (no intervening space), such as (128MB or 8GB). This value must be compatible with the value of the Sku parameter. This parameter is optional. The default value is the lowest value in the range specified by the Sku parameter. - -- When the value of Sku is Basic, the value of Memory must be divisible by 128MB. - --- When the value of Sku is Standard, the value of Memory must be divisible by 1GB. - --- When the value of Sku is Premium, the value of Memory must be divisible by 5GB. - - String - - String - - - - - - - Name - - Specifies a name for the Azure Cache. The name can include only lower-case letters and numbers, and it must begin with a lower-case letter. The name must be unique. This parameter is required. - - String - - String - - - - - - - Sku - - Specifies the tier of the Azure Cache. Valid values are Basic (128MB - 1GB), Standard (1GB - 10GB), and Premium (5GB - 150GB). This parameter is optional. The default value is Basic. - - String - - String - - - - - - - - - - None - - - - - - - - You cannot pipe input to this cmdlet. - - - - - - - Microsoft.Azure.Commands.ManagedCache.Models .PSCacheService - - - - - - - - - - - - - - - - - - Before using this cmdlet, use Add-AzureAccount or Import-AzurePublishSettingsFile to make your Azure account available to Windows PowerShell. For more information, see How to install and configure Azure PowerShell (http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/). - - - - - Example 1: Create an Azure Cache - - - - - PS C:\>New-AzureManagedCache -Name contosocache -Location "West Europe" - - - - This command creates an Azure Cache named ContosoCache in the West Europe Azure data center. It uses the default values for the Sku and Memory parameters, which are Basic and 128MB. - - - - - - - - - Example 2: Create a premium Azure Cache - - - - - PS C:\>New-AzureManagedCache -Name contosoappcache -Location "West Europe" -Sku Premium -Memory 150GB - - - - This command creates the largest available Azure Cache. - - - - - - - - - - - Online Version: - - - - - Get-AzureManagedCache - - - - Set-AzureManagedCache - - - - Remove-AzureManagedCache - - - - Get-AzureManagedCacheAccessKey - - - - New-AzureManagedCacheAccessKey - - - - - - - New-AzureManagedCacheAccessKey - - Creates new access keys for an Azure Cache. - - - - - New - AzureManagedCacheAccessKey - - - - The New-AzureManagedCacheAccessKey cmdlet generates new primary or secondary access keys for an Azure Cache. When you create an Azure Cache, it includes a set of access keys. To get the current access keys, use the Get-AzureManagedCacheAccessKey cmdlet. You can use these keys to allow clients, such as web applications, to access to your Azure Cache. - An Azure Cache is a secure, dedicated cache that provides extremely fast access to data. This distributed, in-memory, scalable solution enables you to build highly scalable and responsive applications. For more information about Azure Cache, see Azure Cache (http://azure.microsoft.com/en-us/services/cache/). - Typically, you use the primary key, but use the secondary key to avoid delays while the primary key is being regenerated. To get new access keys, use the New- AzureManagedCacheAccessKey cmdlet - - - - - - New-AzureManagedCacheAccessKey - - Name - - Generates keys for the specified Azure Cache. Enter the name of the Azure Cache. This parameter is required. The parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - KeyType - - Specifies the type of key to create. Valid values are Primary and Secondary. This parameter is optional. The default value is Primary. - - String - - - - - - KeyType - - Specifies the type of key to create. Valid values are Primary and Secondary. This parameter is optional. The default value is Primary. - - String - - String - - - - - - - Name - - Generates keys for the specified Azure Cache. Enter the name of the Azure Cache. This parameter is required. The parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - String - - - - - - - - - - None - - - - - - - - You cannot pipe input to this cmdlet. - - - - - - - Microsoft.Azure.Management.ManagedCache.Models.CachingKeysResponse - - - - - - - - - - - - - - - - - Create a new primary key - - - - - PS C:\>New-AzureManagedCacheAccessKey -Name contosocache - - - - This command creates a new primary key for the contosocache Azure Cache. - - - - - - - - - Create a new secondary key - - - - - PS C:\>New-AzureManagedCacheAccessKey -Name contosocache -KeyType Secondary - - - - This command creates a new secondary key for the contosocache Azure Cache. - - - - - - - - - Create new access keys - - - - - PS C:\>'Primary', 'Secondary' | ForEach-Object {New-AzureManagedCacheAccessKey -Name contosocache -KeyType $_} - - - - This command creates new primary and secondary keys for the contosocache Azure Cache. - - - - - - - - - - - Online Version: - - - - - Get-AzureManagedCacheAccessKey - - - - New-AzureManagedCache - - - - Get-AzureManagedCache - - - - Set-AzureManagedCache - - - - Remove-AzureManagedCache - - - - - - - Remove-AzureManagedCache - - Deletes an Azure Cache - - - - - Remove - AzureManagedCache - - - - The Remove-AzureManagedCache cmdlet deletes an Azure Cache and all of the data in the Cache. It returns True if the operation was successful and False if it failed. - By default, Remove-AzureManagedCache prompts you for confirmation before deleting the Azure Cache, but you can use the Force parameter to suppress the prompt. - An Azure Cache is a secure, dedicated cache that provides extremely fast access to data. This distributed, in-memory, scalable solution enables you to build highly scalable and responsive applications. For more information about Azure Cache, see Azure Cache (http://azure.microsoft.com/en-us/services/cache/). - - - - Remove-AzureManagedCache - - Name - - Specifies the name of the Azure Cache to delete. The parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - - Force - - Suppresses the confirmation prompt. By default, Remove-AzureManagedCache prompts you for confirmation before deleting the Azure Cache. - - - - - - - Force - - Suppresses the confirmation prompt. By default, Remove-AzureManagedCache prompts you for confirmation before deleting the Azure Cache. - - SwitchParameter - - SwitchParameter - - - - - - - Name - - Specifies the name of the Azure Cache to delete. The parameter value is case-sensitive. Wildcard characters are not permitted. - - String - - String - - - - - - - - - - None - - - - - - - - You can input to this cmdlet by property name, but not by value. - - - - - - - System.Boolean - - - - - - - - Returns True ($true) if the operation is successful and False ($false) if it fails. - - - - - - - - - Before using this cmdlet, use Add-AzureAccount or Import-AzurePublishSettingsFile to make your Azure account available to Windows PowerShell. For more information, see How to install and configure Azure PowerShell (http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/). - - - - - Delete an Azure Cache - - - - - PS C:\>Remove-AzureManagedCache -Name contosocache - -Confirm -Are you sure you want to perform this action? -Performing the operation "Delete" on target "contosocache". -[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): -Y - -True - - - - - This command deletes the contosocache Azure Cache. The command prompts for confirmation before deleting the Cache. It returns a value of $True to indicate that the Cache was deleted. - - - - - - - - - Example 2: Remove all test caches - - - - - PS C:\>Get-AzureManagedCache | Where-Object Name -like Test* | Remove-AzureManagedCache -Force - - - - This command removes all Azure Caches that have names that begin with "Test." It uses the Get-AzureManagedCache cmdlet to get the Azure Caches in your account. It pipes them to the Where-Object cmdlet, which returns only the Azure Caches that have names that begin with "Test". Then, it pipes the test caches to the Remove-AzureManagedCache cmdlet with the Force parameter, which deletes them without prompting for confirmation. - - - - - - - - - - - Online Version: - - - - - New-AzureManagedCache - - - - Get-AzureManagedCache - - - - Set-AzureManagedCache - - - - Get-AzureManagedCacheAccessKey - - - - New-AzureManagedCacheAccessKey - - - - - - - Set-AzureManagedCache - - Changes the properties of an Azure Cache. - - - - - Set - AzureManagedCache - - - - The Set-AzureManagedCache cmdlet changes the properties of an Azure Cache and returns an object that represents the cache with the changes. Use the Name and Location parameters to identify the Azure Cache, and the Sku and Memory parameters to change its properties. - An Azure Cache is a secure, dedicated cache that provides extremely fast access to data. This distributed, in-memory, scalable solution enables you to build highly scalable and responsive applications. For more information about Azure Cache, see Azure Cache (http://azure.microsoft.com/en-us/services/cache/). - WARNING: When you change the SKU of an Azure Cache, all data in the cache is deleted and a new, empty Azure Cache is created for you with the same name and location. When you use the Sku parameter, Set-AzureManagedCache prompts for confirmation. To suppress the confirmation prompt, use the Force parameter. - - - - Set-AzureManagedCache - - Name - - Identifies the Azure Cache. Enter the name of an Azure Cache. This parameter is required. The parameter value is case-sensitive. Wildcards are not permitted. You cannot use this cmdlet to change the name of an Azure Cache. - - String - - - Location - - Specifies the location of the Azure Cache. This parameter is required. Enter the name of the Azure data center location where the Azure Cache resides, such as "North Central US" or "West Europe". This parameter identifies the Azure Cache. You cannot use this parameter to change the location of the Azure Cache. - - String - - - Sku - - Changes the tier of the Azure Cache. Valid values are Basic (128MB - 1GB), Standard (1GB - 10GB), and Premium (5GB - 150GB). This parameter is optional. - - String - - - Memory - - Changes the Azure Cache to the specified size. The cache size might affect the cost of the service. Enter a value followed by "MB" or "GB" (no intervening space), such as (128MB or 8GB). This value must be compatible with the Sku of the Azure Cache. This parameter is optional. - -- When the value of Sku is Basic, the value of Memory must be divisible by 128MB. - --- When the value of Sku is Standard, the value of Memory must be divisible by 1GB. - --- When the value of Sku is Premium, the value of Memory must be divisible by 5GB. - - String - - - Force - - Suppresses the confirmation prompt that appears when you use the Sku parameter. Because changing the SKU deletes all data in the Azure Cache, Set-AzureManagedCache prompts you for confirmation before performing the operation. - - - - - - - Force - - Suppresses the confirmation prompt that appears when you use the Sku parameter. Because changing the SKU deletes all data in the Azure Cache, Set-AzureManagedCache prompts you for confirmation before performing the operation. - - SwitchParameter - - SwitchParameter - - - - - - - Location - - Specifies the location of the Azure Cache. This parameter is required. Enter the name of the Azure data center location where the Azure Cache resides, such as "North Central US" or "West Europe". This parameter identifies the Azure Cache. You cannot use this parameter to change the location of the Azure Cache. - - String - - String - - - - - - - Memory - - Changes the Azure Cache to the specified size. The cache size might affect the cost of the service. Enter a value followed by "MB" or "GB" (no intervening space), such as (128MB or 8GB). This value must be compatible with the Sku of the Azure Cache. This parameter is optional. - -- When the value of Sku is Basic, the value of Memory must be divisible by 128MB. - --- When the value of Sku is Standard, the value of Memory must be divisible by 1GB. - --- When the value of Sku is Premium, the value of Memory must be divisible by 5GB. - - String - - String - - - - - - - Name - - Identifies the Azure Cache. Enter the name of an Azure Cache. This parameter is required. The parameter value is case-sensitive. Wildcards are not permitted. You cannot use this cmdlet to change the name of an Azure Cache. - - String - - String - - - - - - - Sku - - Changes the tier of the Azure Cache. Valid values are Basic (128MB - 1GB), Standard (1GB - 10GB), and Premium (5GB - 150GB). This parameter is optional. - - String - - String - - - - - - - - - - None - - - - - - - - You cannot pipe input to this cmdlet. - - - - - - - Microsoft.Azure.Commands.ManagedCache.Models.PsCacheService - - - - - - - - - - - - - - - - - - Before using this cmdlet, use Add-AzureAccount or Import-AzurePublishSettingsFile to make your Azure account available to Windows PowerShell. For more information, see How to install and configure Azure PowerShell (http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/). - - - - - Example 1: Change the size of an Azure Cache - - - - - PS C:\>Set-AzureManagedCache -Name contosocache -Location "West Europe" -Memory 256MB - - - - This command increases the size of the contosocache Azure Cache to 256 MB. - - - - - - - - - Example 2: Change the SKU of an Azure Cache - - - - - -PS C:\>Set-AzureManagedCache -Name contosocache -Location "West Europe" -Sku Standard -Size 10GB - -Confirm -Are you sure you want to perform this action? -Performing the operation "Delete" on target "contosocache". -[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): - - - - - This command changes the SKU of the contosocache Azure Cache from Basic to Standard and the Size to 10 GB. - Because this operation deletes the existing Azure Cache and its data and creates a new empty Azure Cache, Set-AzureManagedCache prompts you for confirmation before deleting the cache. To suppress this prompt, use the Force parameter. - - - - - - - - - - - Online Version: - - - - - - +The parameters that can be set on the connection are as follows: +EncryptionType: (NoEncryption, RequireEncryption) +PfsGroup: (PFS1, None) + + + + Set-AzureVNetGatewayIPsecParameters + + VNetName + + + + String + + + LocalNetworkSiteName + + + + String + + + EncryptionType + + + + String + + + PfsGroup + + + + String + + + SADataSizeKilobytes + + + + Int32 + + + SALifetimeSeconds + + + + Int32 + + + + + + VNetName + + + + String + + String + + + + + + LocalNetworkSiteName + + + + String + + String + + + + + + EncryptionType + + + + String + + String + + + + + + PfsGroup + + + + String + + String + + + + + + SADataSizeKilobytes + + + + Int32 + + Int32 + + + + + + SALifetimeSeconds + + + + Int32 + + Int32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Set-AzureVNetGatewayKey + + Set the pre-shared key that will be used in this virtual network gateway's connection to the provided local network site. + + + + + Set + AzureVNetGatewayKey + + + + + Set the pre-shared key that will be used in this virtual network gateway's connection to the provided local network site. The key provided to this cmdlet must be equal to the key configured on the local network site's gateway (vpn device). If the keys on the virtual network gateway and the vpn device do not match, then a connection will not be established. + + + + Set-AzureVNetGatewayKey + + VNetName + + + + String + + + LocalNetworkSiteName + + + + String + + + SharedKey + + + + String + + + + + + VNetName + + + + String + + String + + + + + + LocalNetworkSiteName + + + + String + + String + + + + + + SharedKey + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Start-AzureVNetGatewayDiagnostics + + Start a new gateway diagnostics session for the provided virtual network gateway. + + + + + Start + AzureVNetGatewayDiagnostics + + + + + Start a new gateway diagnostics session for the provided virtual network gateway. If a gateway diagnostics session is currently running, then this cmdlet will return an error indicating that you cannot start a new diagnostics session in the current state. + + + + Start-AzureVNetGatewayDiagnostics + + VNetName + + + + String + + + CaptureDurationInSeconds + + + + Int32 + + + ContainerName + + + + String + + + StorageContext + + + + AzureStorageContext + + + + + + VNetName + + + + String + + String + + + + + + CaptureDurationInSeconds + + + + Int32 + + Int32 + + + + + + ContainerName + + + + String + + String + + + + + + StorageContext + + + + AzureStorageContext + + AzureStorageContext + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Stop-AzureVNetGatewayDiagnostics + + Stop a currently running diagnostics session. + + + + + Stop + AzureVNetGatewayDiagnostics + + + + + This cmdlet stops a currently running diagnostics session. The results of the diagnostics session will be saved to the storage account that was provided in the initial Start-AzureVNetGatewayDiagnostics invocation. + + + + Stop-AzureVNetGatewayDiagnostics + + VNetName + + + + String + + + + + + VNetName + + + + String + + String + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ServiceManagement/Network/Commands.Network/NetworkClient.cs b/src/ServiceManagement/Network/Commands.Network/NetworkClient.cs index c969571bd591..b30adf66c3b6 100644 --- a/src/ServiceManagement/Network/Commands.Network/NetworkClient.cs +++ b/src/ServiceManagement/Network/Commands.Network/NetworkClient.cs @@ -138,7 +138,7 @@ public GatewayGetOperationStatusResponse SetSharedKey(string vnetName, string lo return client.Gateways.SetSharedKey(vnetName, localNetworkSiteName, sharedKeyParameters); } - public GatewayGetOperationStatusResponse CreateGateway(string vnetName, GatewayType gatewayType, GatewaySKU gatewaySKU) + public GatewayGetOperationStatusResponse CreateGateway(string vnetName, string gatewayType, string gatewaySKU) { GatewayCreateParameters parameters = new GatewayCreateParameters() { @@ -154,7 +154,7 @@ public GatewayGetOperationStatusResponse DeleteGateway(string vnetName) return client.Gateways.Delete(vnetName); } - public GatewayGetOperationStatusResponse ResizeGateway(string vnetName, GatewaySKU gatewaySKU) + public GatewayGetOperationStatusResponse ResizeGateway(string vnetName, string gatewaySKU) { ResizeGatewayParameters parameters = new ResizeGatewayParameters() { @@ -182,7 +182,7 @@ public GatewayGetOperationStatusResponse StartDiagnostics(string vnetName, int c } public GatewayGetOperationStatusResponse StartDiagnostics(string vnetName, int captureDurationInSeconds, string containerName, string customerStorageKey, string customerStorageName) { - UpdateGatewayPublicDiagnostics parameters = new UpdateGatewayPublicDiagnostics() + StartGatewayPublicDiagnosticsParameters parameters = new StartGatewayPublicDiagnosticsParameters() { CaptureDurationInSeconds = captureDurationInSeconds.ToString(), ContainerName = containerName, @@ -191,17 +191,17 @@ public GatewayGetOperationStatusResponse StartDiagnostics(string vnetName, int c Operation = UpdateGatewayPublicDiagnosticsOperation.StartDiagnostics, }; - return client.Gateways.UpdateDiagnostics(vnetName, parameters); + return client.Gateways.StartDiagnostics(vnetName, parameters); } - public GatewayGetOperationStatusResponse StopDiagnostics(string vnetName) + public GatewayOperationResponse StopDiagnostics(string vnetName) { - UpdateGatewayPublicDiagnostics parameters = new UpdateGatewayPublicDiagnostics() + StopGatewayPublicDiagnosticsParameters parameters = new StopGatewayPublicDiagnosticsParameters() { Operation = UpdateGatewayPublicDiagnosticsOperation.StopDiagnostics, }; - return client.Gateways.UpdateDiagnostics(vnetName, parameters); + return client.Gateways.StopDiagnostics(vnetName, parameters); } public GatewayGetOperationStatusResponse SetDefaultSite(string vnetName, string defaultSiteName) @@ -219,6 +219,27 @@ public GatewayGetOperationStatusResponse RemoveDefaultSite(string vnetName) return client.Gateways.RemoveDefaultSites(vnetName); } + public GatewayGetOperationStatusResponse SetIPsecParameters(string vnetName, string localNetworkName, string encryptionType, string pfsGroup, int saDataSizeKilobytes, int saLifetimeSeconds) + { + GatewaySetIPsecParametersParameters parameters = new GatewaySetIPsecParametersParameters() + { + Parameters = new IPsecParameters() + { + EncryptionType = encryptionType, + PfsGroup = pfsGroup, + SADataSizeKilobytes = saDataSizeKilobytes, + SALifeTimeSeconds = saLifetimeSeconds, + }, + }; + + return client.Gateways.SetIPsecParameters(vnetName, localNetworkName, parameters); + } + + public IPsecParameters GetIPsecParameters(string vnetName, string localNetworkName) + { + return client.Gateways.GetIPsecParameters(vnetName, localNetworkName).IPsecParameters; + } + public RouteTable GetRouteTable(string routeTableName, string detailLevel) { RouteTable result; diff --git a/src/ServiceManagement/Network/Commands.Network/packages.config b/src/ServiceManagement/Network/Commands.Network/packages.config index 3bed37144e6b..82b77cc182ba 100644 --- a/src/ServiceManagement/Network/Commands.Network/packages.config +++ b/src/ServiceManagement/Network/Commands.Network/packages.config @@ -8,11 +8,11 @@ - - + + - + diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Commands.RecoveryServices.Test.csproj b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Commands.RecoveryServices.Test.csproj index 3376f1cde7d3..7ddf3858b47e 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Commands.RecoveryServices.Test.csproj +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Commands.RecoveryServices.Test.csproj @@ -58,10 +58,10 @@ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.Azure.Management.RecoveryServices.0.1.0-preview\lib\net40\Microsoft.WindowsAzure.Management.SiteRecovery.dll diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/packages.config b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/packages.config index f9dddb37ebfd..a3efc42ba1b2 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/packages.config +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/packages.config @@ -8,8 +8,8 @@ - - + + diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj index d3363b92a410..8d5e36cfa7d0 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj @@ -57,11 +57,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/packages.config b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/packages.config index 3f0757f68cd5..8e133b6c1b4b 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/packages.config +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/packages.config @@ -5,7 +5,7 @@ - - + + \ No newline at end of file diff --git a/src/ServiceManagement/Services/Commands.Test.Utilities/Commands.Test.Utilities.csproj b/src/ServiceManagement/Services/Commands.Test.Utilities/Commands.Test.Utilities.csproj index 845f91162e43..5ad5d2c9409b 100644 --- a/src/ServiceManagement/Services/Commands.Test.Utilities/Commands.Test.Utilities.csproj +++ b/src/ServiceManagement/Services/Commands.Test.Utilities/Commands.Test.Utilities.csproj @@ -57,11 +57,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/ServiceManagement/Services/Commands.Test.Utilities/packages.config b/src/ServiceManagement/Services/Commands.Test.Utilities/packages.config index 06e73968cf50..d84fe27eca2b 100644 --- a/src/ServiceManagement/Services/Commands.Test.Utilities/packages.config +++ b/src/ServiceManagement/Services/Commands.Test.Utilities/packages.config @@ -4,8 +4,8 @@ - - + + diff --git a/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj b/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj index ade95128367b..041540ad328f 100644 --- a/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj +++ b/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj @@ -78,11 +78,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll @@ -97,7 +97,7 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Management.ExpressRoute.0.11.2-preview\lib\net40\Microsoft.WindowsAzure.Management.ExpressRoute.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.ExpressRoute.0.16.2-preview\lib\net40\Microsoft.WindowsAzure.Management.ExpressRoute.dll ..\..\..\packages\Microsoft.WindowsAzure.Management.MediaServices.1.2.0\lib\net40\Microsoft.WindowsAzure.Management.MediaServices.dll diff --git a/src/ServiceManagement/Services/Commands.Test/packages.config b/src/ServiceManagement/Services/Commands.Test/packages.config index 16f8f94a59ca..47d2bba97b0d 100644 --- a/src/ServiceManagement/Services/Commands.Test/packages.config +++ b/src/ServiceManagement/Services/Commands.Test/packages.config @@ -7,12 +7,12 @@ - - + + - + diff --git a/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj b/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj index a78596be1433..d21490724364 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj +++ b/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj @@ -88,11 +88,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll @@ -113,13 +113,13 @@ False ..\..\..\packages\Microsoft.WindowsAzure.Management.MediaServices.1.2.0\lib\net40\Microsoft.WindowsAzure.Management.MediaServices.dll - + False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.3.0.2\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll ..\..\..\packages\Microsoft.WindowsAzure.Management.ServiceBus.0.15.0-preview\lib\net40\Microsoft.WindowsAzure.Management.ServiceBus.dll @@ -246,6 +246,9 @@ + + + diff --git a/src/ServiceManagement/Services/Commands.Utilities/Microsoft.WindowsAzure.Commands.Scheduler.format.ps1xml b/src/ServiceManagement/Services/Commands.Utilities/Microsoft.WindowsAzure.Commands.Scheduler.format.ps1xml index 9c449126a410..605c97d540b0 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Microsoft.WindowsAzure.Commands.Scheduler.format.ps1xml +++ b/src/ServiceManagement/Services/Commands.Utilities/Microsoft.WindowsAzure.Commands.Scheduler.format.ps1xml @@ -131,6 +131,416 @@ + + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSHttpJobDetail + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSHttpJobDetail + + + + + + + + JobCollectionName + + + + JobName + + + + Lastrun + + + + Nextrun + + + + StartTime + + + + Status + + + + Recurrence + + + + Failures + + + + Faults + + + + Executions + + + + EndSchedule + + + + Method + + + + Uri + + + + Body + + + + Headers + + + + + + + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSStorageQueueJobDetail + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSStorageQueueJobDetail + + + + + + + + JobCollectionName + + + + JobName + + + + Lastrun + + + + Nextrun + + + + StartTime + + + + Status + + + + Recurrence + + + + Failures + + + + Faults + + + + Executions + + + + EndSchedule + + + + QueueMessage + + + + StorageAccountName + + + + StorageQueueName + + + + SasToken + + + + + + + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSClientCertAuthenticationJobDetail + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSClientCertAuthenticationJobDetail + + + + + + + + JobCollectionName + + + + JobName + + + + Lastrun + + + + Nextrun + + + + StartTime + + + + Status + + + + Recurrence + + + + Failures + + + + Faults + + + + Executions + + + + EndSchedule + + + + Method + + + + Uri + + + + Body + + + + Headers + + + + AuthenticationType + + + + ClientCertSubjectName + + + + ClientCertThumbprint + + + + ClientCertExpiryDate + + + + + + + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSAADOAuthenticationJobDetail + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSAADOAuthenticationJobDetail + + + + + + + + JobCollectionName + + + + JobName + + + + Lastrun + + + + Nextrun + + + + StartTime + + + + Status + + + + Recurrence + + + + Failures + + + + Faults + + + + Executions + + + + EndSchedule + + + + Method + + + + Uri + + + + Body + + + + Headers + + + + AuthenticationType + + + + Tenant + + + + Audience + + + + ClientId + + + + + + + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSBasicAuthenticationJobDetail + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSBasicAuthenticationJobDetail + + + + + + + + JobCollectionName + + + + JobName + + + + Lastrun + + + + Nextrun + + + + StartTime + + + + Status + + + + Recurrence + + + + Failures + + + + Faults + + + + Executions + + + + EndSchedule + + + + Method + + + + Uri + + + + Body + + + + Headers + + + + AuthenticationType + + + + Username + + + + + \ No newline at end of file diff --git a/src/ServiceManagement/Services/Commands.Utilities/Microsoft.WindowsAzure.Commands.dll-Help.xml b/src/ServiceManagement/Services/Commands.Utilities/Microsoft.WindowsAzure.Commands.dll-Help.xml index e9c58c344e82..6e306d40f9a0 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Microsoft.WindowsAzure.Commands.dll-Help.xml +++ b/src/ServiceManagement/Services/Commands.Utilities/Microsoft.WindowsAzure.Commands.dll-Help.xml @@ -28113,4 +28113,14 @@ + + + New-AzureDataFactory + + You must be in AzureResourceManager mode to run Azure Data Factory cmdlets. To switch to AzureResourceManager mode, run Switch-AzureMode AzureResourceManager. + + New + AzureDataFactory + + diff --git a/src/ServiceManagement/Services/Commands.Utilities/Properties/Resources.Designer.cs b/src/ServiceManagement/Services/Commands.Utilities/Properties/Resources.Designer.cs index 95d14b36cc62..d2c6a3cc7b53 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Properties/Resources.Designer.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Properties/Resources.Designer.cs @@ -3459,6 +3459,24 @@ public static string SchedulerExistingJobCollection { } } + /// + /// Looks up a localized string similar to A valid value for Tenant, Secret, Audience and Clientid parameters are required for Http scheduler jobs with ActiveDirectoryOAuth authentication type.. + /// + public static string SchedulerInvalidAADOAuthRequest { + get { + return ResourceManager.GetString("SchedulerInvalidAADOAuthRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid value for Username and Password parameters are required for Http scheduler jobs with Basic authentication type.. + /// + public static string SchedulerInvalidBasicAuthRequest { + get { + return ResourceManager.GetString("SchedulerInvalidBasicAuthRequest", resourceCulture); + } + } + /// /// Looks up a localized string similar to A valid value for ClientCertificatePfx and ClientCertificatePassword parameters are required for Http scheduler jobs with ClientCertificate authentication type.. /// @@ -3478,7 +3496,7 @@ public static string SchedulerInvalidLocation { } /// - /// Looks up a localized string similar to For None authentication type, both ClientCertificatePfx and ClientCertificatePassword parameters should be null. + /// Looks up a localized string similar to For None authentication type, all authentication related parameters should be null. /// public static string SchedulerInvalidNoneAuthRequest { get { diff --git a/src/ServiceManagement/Services/Commands.Utilities/Properties/Resources.resx b/src/ServiceManagement/Services/Commands.Utilities/Properties/Resources.resx index 39a13875d20d..3cea1ec63e68 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Properties/Resources.resx +++ b/src/ServiceManagement/Services/Commands.Utilities/Properties/Resources.resx @@ -1602,6 +1602,12 @@ use and privacy statement at <url> and (c) agree to sharing my contact inf A valid value for ClientCertificatePfx and ClientCertificatePassword parameters are required for Http scheduler jobs with ClientCertificate authentication type. - For None authentication type, both ClientCertificatePfx and ClientCertificatePassword parameters should be null + For None authentication type, all authentication related parameters should be null + + + A valid value for Tenant, Secret, Audience and Clientid parameters are required for Http scheduler jobs with ActiveDirectoryOAuth authentication type. + + + A valid value for Username and Password parameters are required for Http scheduler jobs with Basic authentication type. \ No newline at end of file diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSAADOAuthenticationJobDetail.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSAADOAuthenticationJobDetail.cs new file mode 100644 index 000000000000..9ccb7d046e2a --- /dev/null +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSAADOAuthenticationJobDetail.cs @@ -0,0 +1,46 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright 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. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model +{ + public class PSAADOAuthenticationJobDetail : PSHttpJobDetail + { + public string AuthenticationType = "AAD OAuthentication"; + + public string Tenant { get; internal set; } + + public string Audience { get; internal set; } + + public string ClientId { get; internal set; } + + public PSAADOAuthenticationJobDetail (PSHttpJobDetail jobDetail) + { + foreach(PropertyInfo prop in jobDetail.GetType().GetProperties()) + { + GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(jobDetail, null), null); + } + } + + public PSAADOAuthenticationJobDetail() + { + } + } +} diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSBasicAuthenticationJobDetail.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSBasicAuthenticationJobDetail.cs new file mode 100644 index 000000000000..1aaa84330223 --- /dev/null +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSBasicAuthenticationJobDetail.cs @@ -0,0 +1,42 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright 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. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model +{ + public class PSBasicAuthenticationJobDetail : PSHttpJobDetail + { + public string AuthenticationType = "Basic Authentication"; + + public string Username { get; internal set; } + + public PSBasicAuthenticationJobDetail (PSHttpJobDetail jobDetail) + { + foreach(PropertyInfo prop in jobDetail.GetType().GetProperties()) + { + GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(jobDetail, null), null); + } + } + + public PSBasicAuthenticationJobDetail() + { + } + } +} diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSClientCertAuthenticationJobDetail.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSClientCertAuthenticationJobDetail.cs new file mode 100644 index 000000000000..6a82c023125f --- /dev/null +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSClientCertAuthenticationJobDetail.cs @@ -0,0 +1,46 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright 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. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model +{ + public class PSClientCertAuthenticationJobDetail : PSHttpJobDetail + { + public string AuthenticationType = "Client Certificate Authentication"; + + public string ClientCertSubjectName { get; internal set; } + + public string ClientCertThumbprint { get; internal set; } + + public string ClientCertExpiryDate { get; internal set; } + + public PSClientCertAuthenticationJobDetail (PSHttpJobDetail jobDetail) + { + foreach(PropertyInfo prop in jobDetail.GetType().GetProperties()) + { + GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(jobDetail, null), null); + } + } + + public PSClientCertAuthenticationJobDetail() + { + } + } +} diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSCreateJobParams.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSCreateJobParams.cs index 71e9cf75daa3..b9641b6253e6 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSCreateJobParams.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSCreateJobParams.cs @@ -74,5 +74,17 @@ public class PSCreateJobParams public string ClientCertPfx { get; set; } public string ClientCertPassword { get; set; } + + public string Secret { get; set; } + + public string Tenant { get; set; } + + public string Audience { get; set; } + + public string ClientId { get; set; } + + public string Username { get; set; } + + public string Password { get; set; } } } diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSHttpJobDetail.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSHttpJobDetail.cs index 0d7f548083f4..d8e68c0a66fb 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSHttpJobDetail.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSHttpJobDetail.cs @@ -26,11 +26,5 @@ public class PSHttpJobDetail : PSJobDetail public string Body { get; internal set; } public IDictionary Headers { get; internal set; } - - public string ClientCertSubjectName { get; internal set; } - - public string ClientCertThumbprint { get; internal set; } - - public string ClientCertExpiryDate { get; internal set; } } } diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.CreateJobs.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.CreateJobs.cs index 9fc671dac66a..99d104d97491 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.CreateJobs.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.CreateJobs.cs @@ -315,29 +315,19 @@ private JobCreateOrUpdateParameters PopulateExistingJobParams(Job job, PSCreateJ //Job has existing authentication if (job.Action.Request.Authentication != null) { - if (jobRequest.HttpAuthType.Equals("ClientCertificate", StringComparison.OrdinalIgnoreCase)) + if (!string.IsNullOrEmpty(jobRequest.HttpAuthType)) { - jobUpdateParams.Action.Request.Authentication = SetClientCertAuthentication(jobRequest, jobUpdateParams); - } - else if (jobRequest.HttpAuthType.Equals("None", StringComparison.OrdinalIgnoreCase)) - { - if (!string.IsNullOrEmpty(jobRequest.ClientCertPfx) || !string.IsNullOrEmpty(jobRequest.ClientCertPassword)) - { - throw new InvalidOperationException(Resources.SchedulerInvalidNoneAuthRequest); - } - else - { - jobUpdateParams.Action.Request.Authentication = null; - } + jobUpdateParams.Action.Request.Authentication = SetHttpAuthentication(jobRequest, jobUpdateParams); } + //the new request doesn't have any changes to auth, so preserve it else { jobUpdateParams.Action.Request.Authentication = job.Action.Request.Authentication; } } - else if (job.Action.Request.Authentication == null && jobRequest.HttpAuthType.Equals("ClientCertificate", StringComparison.OrdinalIgnoreCase)) + else if (job.Action.Request.Authentication == null) { - jobUpdateParams.Action.Request.Authentication = SetClientCertAuthentication(jobRequest, jobUpdateParams); + jobUpdateParams.Action.Request.Authentication = SetHttpAuthentication(jobRequest, jobUpdateParams); } } else if (job.Action.Request == null) @@ -346,10 +336,7 @@ private JobCreateOrUpdateParameters PopulateExistingJobParams(Job job, PSCreateJ jobUpdateParams.Action.Request.Method = jobRequest.Method; jobUpdateParams.Action.Request.Headers = jobRequest.Headers.ToDictionary(); jobUpdateParams.Action.Request.Body = jobRequest.Body; - if (jobRequest.HttpAuthType.Equals("ClientCertificate", StringComparison.OrdinalIgnoreCase)) - { - jobUpdateParams.Action.Request.Authentication = SetClientCertAuthentication(jobRequest, jobUpdateParams); - } + jobUpdateParams.Action.Request.Authentication = SetHttpAuthentication(jobRequest, jobUpdateParams); } } else @@ -358,10 +345,7 @@ private JobCreateOrUpdateParameters PopulateExistingJobParams(Job job, PSCreateJ jobUpdateParams.Action.Request.Method = jobRequest.Method; jobUpdateParams.Action.Request.Headers = jobRequest.Headers.ToDictionary(); jobUpdateParams.Action.Request.Body = jobRequest.Body; - if (jobRequest.HttpAuthType.Equals("ClientCertificate", StringComparison.OrdinalIgnoreCase)) - { - jobUpdateParams.Action.Request.Authentication = SetClientCertAuthentication(jobRequest, jobUpdateParams); - } + jobUpdateParams.Action.Request.Authentication = SetHttpAuthentication(jobRequest, jobUpdateParams); } } else @@ -460,21 +444,74 @@ private JobCreateOrUpdateParameters PopulateExistingJobParams(Job job, PSCreateJ return jobUpdateParams; } - private HttpAuthentication SetClientCertAuthentication(PSCreateJobParams jobRequest, JobCreateOrUpdateParameters jobUpdateParams) + private HttpAuthentication SetHttpAuthentication(PSCreateJobParams jobRequest, JobCreateOrUpdateParameters jobUpdateParams) { - if (jobRequest.ClientCertPfx != null && jobRequest.ClientCertPassword != null) + HttpAuthentication httpAuthentication = null; + if (!string.IsNullOrEmpty(jobRequest.HttpAuthType)) { - return new ClientCertAuthentication + switch (jobRequest.HttpAuthType.ToLower()) { - Type = HttpAuthenticationType.ClientCertificate, - Password = jobRequest.ClientCertPassword, - Pfx = jobRequest.ClientCertPfx - }; - } - else - { - throw new InvalidOperationException(Resources.SchedulerInvalidClientCertAuthRequest); + case "clientcertificate": + if (jobRequest.ClientCertPfx != null && jobRequest.ClientCertPassword != null) + { + httpAuthentication = new ClientCertAuthentication + { + Type = HttpAuthenticationType.ClientCertificate, + Password = jobRequest.ClientCertPassword, + Pfx = jobRequest.ClientCertPfx + }; + } + else + { + throw new InvalidOperationException(Resources.SchedulerInvalidClientCertAuthRequest); + } + break; + + case "activedirectoryoauth": + if (jobRequest.Tenant != null && jobRequest.Audience != null && jobRequest.ClientId != null && jobRequest.Secret != null) + { + httpAuthentication = new AADOAuthAuthentication + { + Type = HttpAuthenticationType.ActiveDirectoryOAuth, + Tenant = jobRequest.Tenant, + Audience = jobRequest.Audience, + ClientId = jobRequest.ClientId, + Secret = jobRequest.Secret + }; + } + else + { + throw new InvalidOperationException(Resources.SchedulerInvalidAADOAuthRequest); + } + break; + + case "basic": + if (jobRequest.Username != null && jobRequest.Password != null) + { + httpAuthentication = new BasicAuthentication + { + Type = HttpAuthenticationType.Basic, + Username = jobRequest.Username, + Password = jobRequest.Password + }; + } + else + { + throw new InvalidOperationException(Resources.SchedulerInvalidBasicAuthRequest); + } + break; + + case "none": + if (!string.IsNullOrEmpty(jobRequest.ClientCertPfx) || !string.IsNullOrEmpty(jobRequest.ClientCertPassword) || + !string.IsNullOrEmpty(jobRequest.Tenant) || !string.IsNullOrEmpty(jobRequest.Secret) || !string.IsNullOrEmpty(jobRequest.ClientId) || !string.IsNullOrEmpty(jobRequest.Audience) || + !string.IsNullOrEmpty(jobRequest.Username) || !string.IsNullOrEmpty(jobRequest.Password)) + { + throw new InvalidOperationException(Resources.SchedulerInvalidNoneAuthRequest); + } + break; + } } + return httpAuthentication; } /// diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.cs index 5c17f4a926c5..728b6c902af8 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.cs @@ -425,11 +425,27 @@ public PSJobDetail GetJobDetail(string jobCollection, string job, string cloudSe jobDetail.Lastrun = j.Status.LastExecutionTime; jobDetail.Nextrun = j.Status.NextExecutionTime; } - if (j.Action.Request.Authentication != null && j.Action.Request.Authentication.Type == HttpAuthenticationType.ClientCertificate) + if (j.Action.Request.Authentication != null) { - jobDetail.ClientCertThumbprint = ((j.Action.Request.Authentication) as ClientCertAuthentication).CertificateThumbprint; - jobDetail.ClientCertExpiryDate = ((j.Action.Request.Authentication) as ClientCertAuthentication).CertificateExpiration.ToString(); - jobDetail.ClientCertSubjectName = ((j.Action.Request.Authentication) as ClientCertAuthentication).CertificateSubjectName; + switch(j.Action.Request.Authentication.Type) + { + case HttpAuthenticationType.ClientCertificate: + PSClientCertAuthenticationJobDetail ClientCertJobDetail = new PSClientCertAuthenticationJobDetail(jobDetail); + ClientCertJobDetail.ClientCertExpiryDate = ((j.Action.Request.Authentication) as ClientCertAuthentication).CertificateExpiration.ToString(); + ClientCertJobDetail.ClientCertSubjectName = ((j.Action.Request.Authentication) as ClientCertAuthentication).CertificateSubjectName; + ClientCertJobDetail.ClientCertThumbprint = ((j.Action.Request.Authentication) as ClientCertAuthentication).CertificateThumbprint; + return ClientCertJobDetail; + case HttpAuthenticationType.ActiveDirectoryOAuth: + PSAADOAuthenticationJobDetail AADOAuthJobDetail = new PSAADOAuthenticationJobDetail(jobDetail); + AADOAuthJobDetail.Audience = ((j.Action.Request.Authentication) as AADOAuthAuthentication).Audience; + AADOAuthJobDetail.ClientId = ((j.Action.Request.Authentication) as AADOAuthAuthentication).ClientId; + AADOAuthJobDetail.Tenant = ((j.Action.Request.Authentication) as AADOAuthAuthentication).Tenant; + return AADOAuthJobDetail; + case HttpAuthenticationType.Basic: + PSBasicAuthenticationJobDetail BasicAuthJobDetail = new PSBasicAuthenticationJobDetail(jobDetail); + BasicAuthJobDetail.Username = ((j.Action.Request.Authentication) as BasicAuthentication).Username; + return BasicAuthJobDetail; + } } return jobDetail; } diff --git a/src/ServiceManagement/Services/Commands.Utilities/packages.config b/src/ServiceManagement/Services/Commands.Utilities/packages.config index bb5d0a608aa4..caf4583e1181 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/packages.config +++ b/src/ServiceManagement/Services/Commands.Utilities/packages.config @@ -8,15 +8,15 @@ - - + + - - + + diff --git a/src/ServiceManagement/Services/Commands/Commands.csproj b/src/ServiceManagement/Services/Commands/Commands.csproj index 4a835410fcac..6e5c5bac6ef3 100644 --- a/src/ServiceManagement/Services/Commands/Commands.csproj +++ b/src/ServiceManagement/Services/Commands/Commands.csproj @@ -92,13 +92,11 @@ False ..\..\..\lib\Microsoft.Web.Deployment.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll @@ -115,13 +113,12 @@ False ..\..\..\packages\Microsoft.WindowsAzure.Management.MediaServices.1.2.0\lib\net40\Microsoft.WindowsAzure.Management.MediaServices.dll - + False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.3.0.2\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll ..\..\..\packages\Microsoft.WindowsAzure.Management.ServiceBus.0.15.0-preview\lib\net40\Microsoft.WindowsAzure.Management.ServiceBus.dll @@ -212,6 +209,7 @@ + diff --git a/src/ServiceManagement/Services/Commands/DataFactories/NewAzureDataFactoryStubCommand.cs b/src/ServiceManagement/Services/Commands/DataFactories/NewAzureDataFactoryStubCommand.cs new file mode 100644 index 000000000000..059c6f1f4f39 --- /dev/null +++ b/src/ServiceManagement/Services/Commands/DataFactories/NewAzureDataFactoryStubCommand.cs @@ -0,0 +1,53 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright 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. +// ---------------------------------------------------------------------------------- + +using System.Collections; +using System.Management.Automation; +using System.Security.Permissions; +using Microsoft.WindowsAzure.Commands.Utilities.Common; + +namespace Microsoft.WindowsAzure.Commands.DataFactories +{ + /// + /// In order to show warning for ADF cmdlets if client is using service management mode + /// + [Cmdlet(VerbsCommon.New, "AzureDataFactory")] + public class NewAzureDataFactoryStubCommand : AzurePSCmdlet + { + //Just to make sure there is no error messages for parameters when clients use "New-AzureDataFactory" + [Parameter(Mandatory = false)] + public string ResourceGroupName { get; set; } + + [Parameter(Mandatory = false)] + public string Name { get; set; } + + [Parameter(Mandatory = false)] + public string Location { get; set; } + + [Parameter(Mandatory = false)] + public Hashtable Tags { get; set; } + + [Parameter(Mandatory = false)] + public SwitchParameter Force { get; set; } + + /// + /// Execute this cmdlet. + /// + [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] + public override void ExecuteCmdlet() + { + WriteWarning("You must be in AzureResourceManager mode to run Azure Data Factory cmdlets. To switch to AzureResourceManager mode, run Switch-AzureMode AzureResourceManager."); + } + } +} diff --git a/src/ServiceManagement/Services/Commands/Scheduler/NewSchedulerHttpJobCommand.cs b/src/ServiceManagement/Services/Commands/Scheduler/NewSchedulerHttpJobCommand.cs index f785941fdcaa..702d80d3b72a 100644 --- a/src/ServiceManagement/Services/Commands/Scheduler/NewSchedulerHttpJobCommand.cs +++ b/src/ServiceManagement/Services/Commands/Scheduler/NewSchedulerHttpJobCommand.cs @@ -120,7 +120,7 @@ public class NewSchedulerHttpJobCommand : SchedulerBaseCmdlet [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = false, ParameterSetName = AuthParamSet, HelpMessage = "The Http Authentication type (None or ClientCertificate).")] [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = false, ParameterSetName = RequiredParamSet, HelpMessage = "The Http Authentication type (None or ClientCertificate).")] - [ValidateSet("None", "ClientCertificate", IgnoreCase = true)] + [ValidateSet("None", "ClientCertificate", "ActiveDirectoryOAuth", "Basic", IgnoreCase = true)] public string HttpAuthenticationType { get; set; } [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = false, ParameterSetName = AuthParamSet, HelpMessage = "The pfx of client certificate.")] diff --git a/src/ServiceManagement/Services/Commands/Scheduler/SetSchedulerHttpJobCommand.cs b/src/ServiceManagement/Services/Commands/Scheduler/SetSchedulerHttpJobCommand.cs index 2fca2bb05dfd..8cc7de51e717 100644 --- a/src/ServiceManagement/Services/Commands/Scheduler/SetSchedulerHttpJobCommand.cs +++ b/src/ServiceManagement/Services/Commands/Scheduler/SetSchedulerHttpJobCommand.cs @@ -119,7 +119,7 @@ public class SetSchedulerHttpJobCommand : SchedulerBaseCmdlet [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = false, ParameterSetName = AuthParamSet, HelpMessage = "The Http Authentication type (None or ClientCertificate).")] [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = false, ParameterSetName = RequiredParamSet, HelpMessage = "The Http Authentication type (None or ClientCertificate).")] - [ValidateSet("None", "ClientCertificate", IgnoreCase = true)] + [ValidateSet("None", "ClientCertificate", "ActiveDirectoryOAuth", "Basic", IgnoreCase = true)] public string HttpAuthenticationType { get; set; } [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = false, ParameterSetName = AuthParamSet, HelpMessage = "The pfx of client certificate.")] diff --git a/src/ServiceManagement/Services/Commands/packages.config b/src/ServiceManagement/Services/Commands/packages.config index 225068cf1eaa..3806cbb94119 100644 --- a/src/ServiceManagement/Services/Commands/packages.config +++ b/src/ServiceManagement/Services/Commands/packages.config @@ -8,14 +8,14 @@ - - + + - - + + diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/Commands.SqlDatabase.Test.csproj b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/Commands.SqlDatabase.Test.csproj index fdcae8c60965..f6f2c213d616 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/Commands.SqlDatabase.Test.csproj +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/Commands.SqlDatabase.Test.csproj @@ -72,11 +72,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/packages.config b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/packages.config index 6a1c364acc43..830b7830cf61 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/packages.config +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase.Test/packages.config @@ -7,8 +7,8 @@ - - + + diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj b/src/ServiceManagement/Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj index 75d1ed611600..6917534b33e1 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj @@ -74,11 +74,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/ServiceManagement/Sql/Commands.SqlDatabase/packages.config b/src/ServiceManagement/Sql/Commands.SqlDatabase/packages.config index 206f71805635..b55429b14cb9 100644 --- a/src/ServiceManagement/Sql/Commands.SqlDatabase/packages.config +++ b/src/ServiceManagement/Sql/Commands.SqlDatabase/packages.config @@ -7,8 +7,8 @@ - - + + diff --git a/src/ServiceManagement/Storage/Commands.Storage/Commands.Storage.csproj b/src/ServiceManagement/Storage/Commands.Storage/Commands.Storage.csproj index 05ca1808ed76..f896296bf24c 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Commands.Storage.csproj +++ b/src/ServiceManagement/Storage/Commands.Storage/Commands.Storage.csproj @@ -64,11 +64,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/ServiceManagement/Storage/Commands.Storage/Common/Cmdlet/NewAzureStorageContext.cs b/src/ServiceManagement/Storage/Commands.Storage/Common/Cmdlet/NewAzureStorageContext.cs index afdc47e4df63..843b572dbc50 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Common/Cmdlet/NewAzureStorageContext.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/Common/Cmdlet/NewAzureStorageContext.cs @@ -13,6 +13,7 @@ // ---------------------------------------------------------------------------------- using System; +using System.Globalization; using System.Management.Automation; using System.Security.Permissions; using Microsoft.WindowsAzure.Commands.Common; @@ -346,7 +347,14 @@ internal CloudStorageAccount GetStorageAccountWithAzureEnvironment(StorageCreden } else { - azureEnvironment = DefaultProfileClient.GetEnvironmentOrDefault(azureEnvironmentName); + try + { + azureEnvironment = DefaultProfileClient.GetEnvironmentOrDefault(azureEnvironmentName); + } + catch (ArgumentException e) + { + throw new ArgumentException(e.Message + " " + string.Format(CultureInfo.CurrentCulture, Resources.ValidEnvironmentName, EnvironmentName.AzureCloud, EnvironmentName.AzureChinaCloud)); + } } Uri blobEndPoint = azureEnvironment.GetStorageBlobEndpoint(storageAccountName, useHttps); diff --git a/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/NewAzureStorageDirectory.cs b/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/NewAzureStorageDirectory.cs index 5c33be8d398f..2497168bddf5 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/NewAzureStorageDirectory.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/NewAzureStorageDirectory.cs @@ -50,6 +50,7 @@ public class NewAzureStorageDirectory : AzureStorageFileCmdletBase [Parameter( Position = 1, Mandatory = true, + ValueFromPipeline = true, HelpMessage = "Path of the directory to be created.")] [ValidateNotNullOrEmpty] public string Path { get; set; } diff --git a/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/NewAzureStorageShare.cs b/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/NewAzureStorageShare.cs index 43b658ddd229..f932ee115ea5 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/NewAzureStorageShare.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/NewAzureStorageShare.cs @@ -22,6 +22,7 @@ public class NewAzureStorageShare : AzureStorageFileCmdletBase [Parameter( Position = 0, Mandatory = true, + ValueFromPipeline = true, HelpMessage = "Name of the file share to be created.")] [ValidateNotNullOrEmpty] public string Name { get; set; } diff --git a/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/RemoveAzureStorageDirectory.cs b/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/RemoveAzureStorageDirectory.cs index d3905c228c3e..0e56d2600e02 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/RemoveAzureStorageDirectory.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/RemoveAzureStorageDirectory.cs @@ -64,6 +64,7 @@ public class RemoveAzureStorageDirectory : AzureStorageFileCmdletBase HelpMessage = "Path to the directory to be removed.")] [Parameter( Position = 1, + ValueFromPipeline = true, ParameterSetName = Constants.DirectoryParameterSetName, HelpMessage = "Path to the directory to be removed.")] [ValidateNotNullOrEmpty] diff --git a/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/RemoveAzureStorageShare.cs b/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/RemoveAzureStorageShare.cs index d9e46a61c4e7..eab3e00f0bb4 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/RemoveAzureStorageShare.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/RemoveAzureStorageShare.cs @@ -29,6 +29,7 @@ public class RemoveAzureStorageShare : AzureStorageFileCmdletBase [Parameter( Position = 0, Mandatory = true, + ValueFromPipeline = true, ParameterSetName = Constants.ShareNameParameterSetName, HelpMessage = "Name of the file share to be removed.")] [ValidateNotNullOrEmpty] diff --git a/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/SetAzureStorageFileContent.cs b/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/SetAzureStorageFileContent.cs index 1e992e04a0dc..545d610be675 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/SetAzureStorageFileContent.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/SetAzureStorageFileContent.cs @@ -52,9 +52,11 @@ public class SetAzureStorageFileContent : StorageFileDataManagementCmdletBase [ValidateNotNull] public CloudFileDirectory Directory { get; set; } + [Alias("FullName")] [Parameter( Position = 1, Mandatory = true, + ValueFromPipelineByPropertyName = true, HelpMessage = "Path to the local file to be uploaded.")] [ValidateNotNullOrEmpty] public string Source { get; set; } diff --git a/src/ServiceManagement/Storage/Commands.Storage/Microsoft.WindowsAzure.Commands.Storage.dll-Help.xml b/src/ServiceManagement/Storage/Commands.Storage/Microsoft.WindowsAzure.Commands.Storage.dll-Help.xml index 1d36c9737074..c57a26264ae2 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Microsoft.WindowsAzure.Commands.Storage.dll-Help.xml +++ b/src/ServiceManagement/Storage/Commands.Storage/Microsoft.WindowsAzure.Commands.Storage.dll-Help.xml @@ -2643,7 +2643,7 @@ echo "Total $total containers" - PS C:\> Get-AzureStorageFileContent -FileShareName sample -FilePath sampledir/samplefile + PS C:\> Get-AzureStorageFileContent -ShareName sample -FilePath sampledir/samplefile This example downloads the file whose path is sampledir/samplefile in the sample file share. @@ -3039,6 +3039,9 @@ echo "Total $total containers" + + http://msdn.microsoft.com/en-us/library/dn806375.aspx + @@ -3209,6 +3212,9 @@ echo "Total $total containers" + + http://msdn.microsoft.com/en-us/library/dn806390.aspx + @@ -4125,8 +4131,7 @@ New-AzureStorageBlobSASToken -Container cname -Blob bname -Permission rwd -Start - http://msdn.microsoft.com/en-us/library/windowsazure/dn140255.aspx - + http://msdn.microsoft.com/en-us/library/dn806412.aspx @@ -4649,8 +4654,7 @@ New-AzureStorageBlobSASToken -Container cname -Blob bname -Permission rwd -Start - http://msdn.microsoft.com/en-us/library/windowsazure/dn140255.aspx - + http://msdn.microsoft.com/en-us/library/dn806416.aspx @@ -4956,7 +4960,7 @@ New-AzureStorageBlobSASToken -Container cname -Blob bname -Permission rwd -Start String - + AzureCloud | AzureChinaCloud ConnectionString @@ -6041,8 +6045,7 @@ $context | Get-AzureStorageBlob -Container abc - http://msdn.microsoft.com/en-us/library/windowsazure/dn140255.aspx - + http://msdn.microsoft.com/en-us/library/dn806410.aspx @@ -6893,8 +6896,7 @@ $context | Get-AzureStorageBlob -Container abc - http://msdn.microsoft.com/en-us/library/windowsazure/dn140255.aspx - + http://msdn.microsoft.com/en-us/library/dn806400.aspx @@ -9482,7 +9484,7 @@ $context | Get-AzureStorageBlob -Container abc Name - + The name of the table to be removed. String @@ -9527,7 +9529,7 @@ $context | Get-AzureStorageBlob -Container abc Name - + The name of the table to be removed. String @@ -11368,6 +11370,9 @@ Set-AzureStorageBlobContent -File filename -Container containername -Metadata $m + + http://msdn.microsoft.com/en-us/library/dn806397.aspx + @@ -11614,6 +11619,9 @@ Set-AzureStorageBlobContent -File filename -Container containername -Metadata $m + + http://msdn.microsoft.com/en-us/library/dn806391.aspx + diff --git a/src/ServiceManagement/Storage/Commands.Storage/Resources.Designer.cs b/src/ServiceManagement/Storage/Commands.Storage/Resources.Designer.cs index 6b771c0a10a0..54664d9182dc 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Resources.Designer.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/Resources.Designer.cs @@ -1459,6 +1459,15 @@ internal static string UseStorageAccountFromContext { } } + /// + /// Looks up a localized string similar to Valid environment names are: '{0}' and '{1}'. + /// + internal static string ValidEnvironmentName { + get { + return ResourceManager.GetString("ValidEnvironmentName", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0} {1}.. /// diff --git a/src/ServiceManagement/Storage/Commands.Storage/Resources.resx b/src/ServiceManagement/Storage/Commands.Storage/Resources.resx index 0e11042c4d4f..d7e24e14b87b 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Resources.resx +++ b/src/ServiceManagement/Storage/Commands.Storage/Resources.resx @@ -661,4 +661,8 @@ Failed: {2}. Transmit cancelled by user. + + Valid environment names are: '{0}' and '{1}' + 0 and 1 are for the correct Environment names + \ No newline at end of file diff --git a/src/ServiceManagement/Storage/Commands.Storage/packages.config b/src/ServiceManagement/Storage/Commands.Storage/packages.config index 9979bb0e1f8f..abc5215e8944 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/packages.config +++ b/src/ServiceManagement/Storage/Commands.Storage/packages.config @@ -7,8 +7,8 @@ - - + + diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Commands.TrafficManager.Test.csproj b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Commands.TrafficManager.Test.csproj index d57b7814a183..fc40b9b1787d 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Commands.TrafficManager.Test.csproj +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Commands.TrafficManager.Test.csproj @@ -59,11 +59,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll False diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/packages.config b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/packages.config index a2938791bf5b..5e8c017f9629 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/packages.config +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/packages.config @@ -7,8 +7,8 @@ - - + + diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj index 6728227a0fa9..86ea75d0aa0a 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj @@ -68,11 +68,11 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config index 3ccc754e42e0..11f921bdd596 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config @@ -7,8 +7,8 @@ - - + + diff --git a/tools/InstallationTests/InstallationTest.ps1 b/tools/InstallationTests/InstallationTest.ps1 index e178ff651fdb..779312ea6632 100644 --- a/tools/InstallationTests/InstallationTest.ps1 +++ b/tools/InstallationTests/InstallationTest.ps1 @@ -41,4 +41,14 @@ function Test-UpdateStorageAccount Set-AzureSubscription -SubscriptionName $subscription -CurrentStorageAccountName $accounts[1].StorageAccountName $storageAccountName = $(Get-AzureStorageContainer)[0].Context.StorageAccountName Assert-AreEqual $storageAccountName $accounts[1].StorageAccountName +} + +function Test-GetBatchAccountWithSubscriptionDataFile +{ + param([PSCredential] $credential) + Get-AzureSubscription | Remove-AzureSubscription -Force + $account = Add-AzureAccount -Credential $credential -SubscriptionDataFile "File.txt" + Select-AzureSubscription -SubscriptionId $account.Subscriptions.Split("`r`n")[0] -SubscriptionDataFile "File.txt" + Get-AzureBatchAccount + Add-AzureAccount -Credential $credential } \ No newline at end of file diff --git a/tools/InstallationTests/RunInstallationTests.ps1 b/tools/InstallationTests/RunInstallationTests.ps1 index 6c59592736c7..e0b238ecc4c5 100644 --- a/tools/InstallationTests/RunInstallationTests.ps1 +++ b/tools/InstallationTests/RunInstallationTests.ps1 @@ -107,6 +107,7 @@ Run-TestProtected { Test-UpdateStorageAccount } "Test-UpdateStorageAccount" $serviceCommands | % { Run-TestProtected $_ $_.ToString() } Write-Host -ForegroundColor Green "STARTING RESOURCE MANAGER TESTS" Switch-AzureMode AzureResourceManager > $null +Run-TestProtected { Test-GetBatchAccountWithSubscriptionDataFile $credential} "Test-GetBatchAccountWithSubscriptionDataFile" $resourceCommands | % { Run-TestProtected $_ $_.ToString() } Write-Host Write-Host -ForegroundColor Green "$global:passedCount / $global:totalCount Installation Tests Pass"