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 b21c304cd91e..0d614ccf2c9f 100644
--- a/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj
+++ b/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj
@@ -208,7 +208,7 @@
-
+
True
diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommandTests.cs b/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommandTests.cs
index 15ff45fac23f..3f0f8b515afa 100644
--- a/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommandTests.cs
+++ b/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommandTests.cs
@@ -59,8 +59,6 @@ public void CreatesNewPSResourceGroupDeploymentWithUserTemplate()
{
TemplateFile = templateFile,
DeploymentName = deploymentName,
- StorageAccountName = storageAccountName,
- TemplateVersion = "1.0"
};
CreatePSResourceGroupDeploymentParameters actualParameters = new CreatePSResourceGroupDeploymentParameters();
PSResourceGroupDeployment expected = new PSResourceGroupDeployment()
@@ -97,75 +95,12 @@ public void CreatesNewPSResourceGroupDeploymentWithUserTemplate()
cmdlet.ResourceGroupName = resourceGroupName;
cmdlet.Name = expectedParameters.DeploymentName;
cmdlet.TemplateFile = expectedParameters.TemplateFile;
- cmdlet.TemplateVersion = expectedParameters.TemplateVersion;
cmdlet.ExecuteCmdlet();
Assert.Equal(expectedParameters.DeploymentName, actualParameters.DeploymentName);
- Assert.Equal(expectedParameters.GalleryTemplateIdentity, actualParameters.GalleryTemplateIdentity);
Assert.Equal(expectedParameters.TemplateFile, actualParameters.TemplateFile);
Assert.NotNull(actualParameters.TemplateParameterObject);
- Assert.Equal(expectedParameters.TemplateVersion, actualParameters.TemplateVersion);
-
- commandRuntimeMock.Verify(f => f.WriteObject(expected), Times.Once());
- }
-
- [Fact]
- [Trait(Category.AcceptanceType, Category.CheckIn)]
- public void CreatesNewPSResourceGroupDeploymentWithGalleryTemplate()
- {
- CreatePSResourceGroupDeploymentParameters expectedParameters = new CreatePSResourceGroupDeploymentParameters()
- {
- GalleryTemplateIdentity = "sqlServer",
- DeploymentName = deploymentName,
- StorageAccountName = storageAccountName,
- TemplateVersion = "1.0"
- };
- CreatePSResourceGroupDeploymentParameters actualParameters = new CreatePSResourceGroupDeploymentParameters();
- PSResourceGroupDeployment expected = new PSResourceGroupDeployment()
- {
- Mode = DeploymentMode.Incremental,
- DeploymentName = deploymentName,
- CorrelationId = "123",
- Outputs = new Dictionary()
- {
- { "Variable1", new DeploymentVariable() { Value = "true", Type = "bool" } },
- { "Variable2", new DeploymentVariable() { Value = "10", Type = "int" } },
- { "Variable3", new DeploymentVariable() { Value = "hello world", Type = "string" } }
- },
- Parameters = new Dictionary()
- {
- { "Parameter1", new DeploymentVariable() { Value = "true", Type = "bool" } },
- { "Parameter2", new DeploymentVariable() { Value = "10", Type = "int" } },
- { "Parameter3", new DeploymentVariable() { Value = "hello world", Type = "string" } }
- },
- ProvisioningState = ProvisioningState.Succeeded,
- ResourceGroupName = resourceGroupName,
- TemplateLink = new TemplateLink()
- {
- ContentVersion = "1.0",
- Uri = new Uri("http://mytemplate.com")
- },
- Timestamp = new DateTime(2014, 2, 13)
- };
- resourcesClientMock.Setup(f => f.ExecuteDeployment(
- It.IsAny()))
- .Returns(expected)
- .Callback((CreatePSResourceGroupDeploymentParameters p) => { actualParameters = p; });
-
- cmdlet.ResourceGroupName = resourceGroupName;
- cmdlet.Name = expectedParameters.DeploymentName;
- cmdlet.GalleryTemplateIdentity = expectedParameters.GalleryTemplateIdentity;
- cmdlet.TemplateVersion = expectedParameters.TemplateVersion;
-
- cmdlet.ExecuteCmdlet();
-
- Assert.Equal(expectedParameters.DeploymentName, actualParameters.DeploymentName);
- Assert.Equal(expectedParameters.GalleryTemplateIdentity, actualParameters.GalleryTemplateIdentity);
- Assert.Equal(expectedParameters.TemplateFile, actualParameters.TemplateFile);
- Assert.NotNull(actualParameters.TemplateParameterObject);
- Assert.Equal(expectedParameters.TemplateVersion, actualParameters.TemplateVersion);
- Assert.Equal(null, actualParameters.StorageAccountName);
commandRuntimeMock.Verify(f => f.WriteObject(expected), Times.Once());
}
diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/Templates/TestAzureResourceGroupTemplateCommandTests.cs b/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroupDeployments/TestAzureResourceGroupDeploymentCommandTests.cs
similarity index 52%
rename from src/ResourceManager/Resources/Commands.Resources.Test/Templates/TestAzureResourceGroupTemplateCommandTests.cs
rename to src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroupDeployments/TestAzureResourceGroupDeploymentCommandTests.cs
index d4532d6dc805..b752368947ad 100644
--- a/src/ResourceManager/Resources/Commands.Resources.Test/Templates/TestAzureResourceGroupTemplateCommandTests.cs
+++ b/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroupDeployments/TestAzureResourceGroupDeploymentCommandTests.cs
@@ -23,9 +23,9 @@
namespace Microsoft.Azure.Commands.Resources.Test.Resources
{
- public class TestAzureResourceGroupTemplateCommandTests
+ public class TestAzureResourceGroupDeploymentCommandTests
{
- private TestAzureResourceGroupTemplateCommand cmdlet;
+ private TestAzureResourceGroupDeploymentCommand cmdlet;
private Mock resourcesClientMock;
@@ -35,13 +35,11 @@ public class TestAzureResourceGroupTemplateCommandTests
private string templateFile = @"Resources\sampleTemplateFile.json";
- private string storageAccountName = "myStorageAccount";
-
- public TestAzureResourceGroupTemplateCommandTests()
+ public TestAzureResourceGroupDeploymentCommandTests()
{
resourcesClientMock = new Mock();
commandRuntimeMock = new Mock();
- cmdlet = new TestAzureResourceGroupTemplateCommand()
+ cmdlet = new TestAzureResourceGroupDeploymentCommand()
{
CommandRuntime = commandRuntimeMock.Object,
ResourcesClient = resourcesClientMock.Object
@@ -53,9 +51,7 @@ public void ValidatesPSResourceGroupDeploymentWithUserTemplate()
{
ValidatePSResourceGroupDeploymentParameters expectedParameters = new ValidatePSResourceGroupDeploymentParameters()
{
- TemplateFile = templateFile,
- StorageAccountName = storageAccountName,
- TemplateVersion = "1.0"
+ TemplateFile = templateFile
};
ValidatePSResourceGroupDeploymentParameters actualParameters = new ValidatePSResourceGroupDeploymentParameters();
List expected = new List()
@@ -83,63 +79,11 @@ public void ValidatesPSResourceGroupDeploymentWithUserTemplate()
cmdlet.ResourceGroupName = resourceGroupName;
cmdlet.TemplateFile = expectedParameters.TemplateFile;
- cmdlet.TemplateVersion = expectedParameters.TemplateVersion;
-
- cmdlet.ExecuteCmdlet();
-
- Assert.Equal(expectedParameters.GalleryTemplateIdentity, actualParameters.GalleryTemplateIdentity);
- Assert.Equal(expectedParameters.TemplateFile, actualParameters.TemplateFile);
- Assert.NotNull(actualParameters.TemplateParameterObject);
- Assert.Equal(expectedParameters.TemplateVersion, actualParameters.TemplateVersion);
- Assert.Equal(null, actualParameters.StorageAccountName);
-
- commandRuntimeMock.Verify(f => f.WriteObject(expected), Times.Once());
- }
-
- [Fact]
- public void ValidatesPSResourceGroupDeploymentWithGalleryTemplate()
- {
- ValidatePSResourceGroupDeploymentParameters expectedParameters = new ValidatePSResourceGroupDeploymentParameters()
- {
- GalleryTemplateIdentity = "sqlServer",
- StorageAccountName = storageAccountName,
- TemplateVersion = "1.0"
- };
- ValidatePSResourceGroupDeploymentParameters actualParameters = new ValidatePSResourceGroupDeploymentParameters();
- List expected = new List()
- {
- new PSResourceManagerError()
- {
- Code = "202",
- Message = "bad input",
- },
- new PSResourceManagerError()
- {
- Code = "203",
- Message = "bad input 2",
- },
- new PSResourceManagerError()
- {
- Code = "203",
- Message = "bad input 3",
- }
- };
- resourcesClientMock.Setup(f => f.ValidatePSResourceGroupDeployment(
- It.IsAny(), DeploymentMode.Incremental))
- .Returns(expected)
- .Callback((ValidatePSResourceGroupDeploymentParameters p, DeploymentMode m) => { actualParameters = p; m = DeploymentMode.Incremental; });
-
- cmdlet.ResourceGroupName = resourceGroupName;
- cmdlet.GalleryTemplateIdentity = expectedParameters.GalleryTemplateIdentity;
- cmdlet.TemplateVersion = expectedParameters.TemplateVersion;
cmdlet.ExecuteCmdlet();
- Assert.Equal(expectedParameters.GalleryTemplateIdentity, actualParameters.GalleryTemplateIdentity);
Assert.Equal(expectedParameters.TemplateFile, actualParameters.TemplateFile);
Assert.NotNull(actualParameters.TemplateParameterObject);
- Assert.Equal(expectedParameters.TemplateVersion, actualParameters.TemplateVersion);
- Assert.Equal(null, actualParameters.StorageAccountName);
commandRuntimeMock.Verify(f => f.WriteObject(expected), Times.Once());
}
diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroups/NewAzureResourceGroupCommandTests.cs b/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroups/NewAzureResourceGroupCommandTests.cs
index 8fafbeaadea5..b3962439e97c 100644
--- a/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroups/NewAzureResourceGroupCommandTests.cs
+++ b/src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroups/NewAzureResourceGroupCommandTests.cs
@@ -73,8 +73,6 @@ public void CreatesNewPSResourceGroupWithUserTemplate()
Location = resourceGroupLocation,
TemplateFile = templateFile,
DeploymentName = deploymentName,
- StorageAccountName = storageAccountName,
- TemplateVersion = "1.0",
Tag = tags
};
CreatePSResourceGroupParameters actualParameters = new CreatePSResourceGroupParameters();
@@ -93,7 +91,6 @@ public void CreatesNewPSResourceGroupWithUserTemplate()
cmdlet.Location = expectedParameters.Location;
cmdlet.TemplateFile = expectedParameters.TemplateFile;
cmdlet.DeploymentName = expectedParameters.DeploymentName;
- cmdlet.TemplateVersion = expectedParameters.TemplateVersion;
cmdlet.Tag = expectedParameters.Tag;
cmdlet.ExecuteCmdlet();
@@ -101,58 +98,11 @@ public void CreatesNewPSResourceGroupWithUserTemplate()
Assert.Equal(expectedParameters.ResourceGroupName, actualParameters.ResourceGroupName);
Assert.Equal(expectedParameters.Location, actualParameters.Location);
Assert.Equal(expectedParameters.DeploymentName, actualParameters.DeploymentName);
- Assert.Equal(expectedParameters.GalleryTemplateIdentity, actualParameters.GalleryTemplateIdentity);
Assert.Equal(expectedParameters.TemplateFile, actualParameters.TemplateFile);
Assert.NotNull(actualParameters.TemplateParameterObject);
- Assert.Equal(expectedParameters.TemplateVersion, actualParameters.TemplateVersion);
- Assert.Equal(null, actualParameters.StorageAccountName);
Assert.Equal(expectedParameters.Tag, actualParameters.Tag);
commandRuntimeMock.Verify(f => f.WriteObject(expected), Times.Once());
}
-
- [Fact]
- [Trait(Category.AcceptanceType, Category.CheckIn)]
- public void CreatesNewPSResourceGroupWithGalleryTemplate()
- {
- CreatePSResourceGroupParameters expectedParameters = new CreatePSResourceGroupParameters()
- {
- ResourceGroupName = resourceGroupName,
- Location = resourceGroupLocation,
- GalleryTemplateIdentity = "sqlServer",
- DeploymentName = deploymentName,
- StorageAccountName = storageAccountName,
- TemplateVersion = "1.0"
- };
- CreatePSResourceGroupParameters actualParameters = new CreatePSResourceGroupParameters();
- PSResourceGroup expected = new PSResourceGroup()
- {
- Location = expectedParameters.Location,
- ResourceGroupName = expectedParameters.ResourceGroupName,
- Resources = new List() { new PSResource() { Name = "resource1" } }
- };
- resourcesClientMock.Setup(f => f.CreatePSResourceGroup(It.IsAny()))
- .Returns(expected)
- .Callback((CreatePSResourceGroupParameters p) => { actualParameters = p; });
-
- cmdlet.Name = expectedParameters.ResourceGroupName;
- cmdlet.Location = expectedParameters.Location;
- cmdlet.GalleryTemplateIdentity = expectedParameters.GalleryTemplateIdentity;
- cmdlet.DeploymentName = expectedParameters.DeploymentName;
- cmdlet.TemplateVersion = expectedParameters.TemplateVersion;
-
- cmdlet.ExecuteCmdlet();
-
- Assert.Equal(expectedParameters.ResourceGroupName, actualParameters.ResourceGroupName);
- Assert.Equal(expectedParameters.Location, actualParameters.Location);
- Assert.Equal(expectedParameters.DeploymentName, actualParameters.DeploymentName);
- Assert.Equal(expectedParameters.GalleryTemplateIdentity, actualParameters.GalleryTemplateIdentity);
- Assert.Equal(expectedParameters.TemplateFile, actualParameters.TemplateFile);
- Assert.NotNull(actualParameters.TemplateParameterObject);
- Assert.Equal(expectedParameters.TemplateVersion, actualParameters.TemplateVersion);
- Assert.Equal(null, actualParameters.StorageAccountName);
-
- commandRuntimeMock.Verify(f => f.WriteObject(expected), Times.Once());
- }
}
}
diff --git a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj
index cd424ada4626..fb68150db25b 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj
+++ b/src/ResourceManager/Resources/Commands.Resources/Commands.Resources.csproj
@@ -209,7 +209,7 @@
-
+
diff --git a/src/ResourceManager/Resources/Commands.Resources/Microsoft.Azure.Commands.Resources.dll-Help.xml b/src/ResourceManager/Resources/Commands.Resources/Microsoft.Azure.Commands.Resources.dll-Help.xml
index d8b14c114b4c..18c29e751a9d 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Microsoft.Azure.Commands.Resources.dll-Help.xml
+++ b/src/ResourceManager/Resources/Commands.Resources/Microsoft.Azure.Commands.Resources.dll-Help.xml
@@ -2067,7 +2067,7 @@ ContosoLabsRG WordPress.WordPress Succ
This is the Description section
- The Get-AzureRmResourceGroupGalleryTemplate cmdlet gets resource group gallery templates from the template gallery that Azure hosts. To save a gallery template as a JSON file, use the Save-AzureRmResourceGroupGalleryTemplate cmdlet.A resource group template is a JSON string that defines a resource group for a complex entity, such as a web portal, a blog, a photo gallery, a commerce site, or a wiki. The template defines the resources that are typically needed for the entity, such as web sites, database servers, databases and storage accounts, and includes parameters for user-defined values, such as the names and properties of the resources. To create a resource group with a template, just identify the template and provide values for its parameters.You can create your own templates or use the Get-AzureRmResourceGroupGalleryTemplate get a template from the template gallery that Azure hosts. You can also create templates by editing the gallery templates. If you create or edit a template, be sure to use the Test-AzureResourceGroupTemplate cmdlet to verify that your template and its parameters are valid.To create a resource group with a custom or gallery template, use the New-AzureRmResourceGroup or New-AzureRmResourceGroupDeployment cmdlets.By default the cmdlet gets only the latest version of the template. To get all versions, use the -AllVersions parameter flag.
+ The Get-AzureRmResourceGroupGalleryTemplate cmdlet gets resource group gallery templates from the template gallery that Azure hosts. To save a gallery template as a JSON file, use the Save-AzureRmResourceGroupGalleryTemplate cmdlet.A resource group template is a JSON string that defines a resource group for a complex entity, such as a web portal, a blog, a photo gallery, a commerce site, or a wiki. The template defines the resources that are typically needed for the entity, such as web sites, database servers, databases and storage accounts, and includes parameters for user-defined values, such as the names and properties of the resources. To create a resource group with a template, just identify the template and provide values for its parameters.You can create your own templates or use the Get-AzureRmResourceGroupGalleryTemplate get a template from the template gallery that Azure hosts. You can also create templates by editing the gallery templates. If you create or edit a template, be sure to use the Test-AzureResourceGroupDeployment cmdlet to verify that your template and its parameters are valid.To create a resource group with a custom or gallery template, use the New-AzureRmResourceGroup or New-AzureRmResourceGroupDeployment cmdlets.By default the cmdlet gets only the latest version of the template. To get all versions, use the -AllVersions parameter flag.
@@ -8311,7 +8311,7 @@ c. ResourceName, ResourceType, ResourceGroupName and (optionally) ParentResource
This is the Description section
- The Save-AzureRmResourceGroupGalleryTemplate cmdlet saves a template from the Azure template gallery as a JSON file on disk and returns the path to the saved file. You can to use the template to create Azure resource groups and deploymentsA resource is a user-managed entity, such as a website, database server, or database. A resource group is a collection of resources that are deployed as a unit. You can create resources individually and add them to resource groups. However, typically, you create a resource group by using a template.A template is a JSON string that defines a resource group for a complex entity, such as a web hosting site or web portal. The template defines the resources that are typically needed for the entity, such as websites, databases, and storage accounts, and includes parameters for user-defined values, such as the names and properties of the resources. To get a resource group template, use the Get-AzureRmResourceGroupGalleryTemplate cmdlet to get a gallery template and then use the Save-AzureRmResourceGroupGalleryTemplate cmdlet to save the template as a JSON file. Or, you can create your own templates, either from scratch or by editing a gallery template. To verify the syntax of a template, use the Test-AzureResourceGroupTemplate cmdlet.To use a template to create a resource group, use the New-AzureRmResourceGroup or New-AzureRmResourceGroupDeployment cmdlets. Just identify the template and provide values for its parameters.
+ The Save-AzureRmResourceGroupGalleryTemplate cmdlet saves a template from the Azure template gallery as a JSON file on disk and returns the path to the saved file. You can to use the template to create Azure resource groups and deploymentsA resource is a user-managed entity, such as a website, database server, or database. A resource group is a collection of resources that are deployed as a unit. You can create resources individually and add them to resource groups. However, typically, you create a resource group by using a template.A template is a JSON string that defines a resource group for a complex entity, such as a web hosting site or web portal. The template defines the resources that are typically needed for the entity, such as websites, databases, and storage accounts, and includes parameters for user-defined values, such as the names and properties of the resources. To get a resource group template, use the Get-AzureRmResourceGroupGalleryTemplate cmdlet to get a gallery template and then use the Save-AzureRmResourceGroupGalleryTemplate cmdlet to save the template as a JSON file. Or, you can create your own templates, either from scratch or by editing a gallery template. To verify the syntax of a template, use the Test-AzureResourceGroupDeployment cmdlet.To use a template to create a resource group, use the New-AzureRmResourceGroup or New-AzureRmResourceGroupDeployment cmdlets. Just identify the template and provide values for its parameters.
@@ -9143,7 +9143,7 @@ True
- Test-AzureResourceGroupTemplate
+ Test-AzureResourceGroupDeployment
Detects errors in a resource group template or template parameters
@@ -9156,11 +9156,11 @@ True
This is the Description section
- The Test-AzureResourceGroupTemplate cmdlet verifies the validity of a resource group template, its parameters, and parameter values. It returns errors that it finds. Otherwise, it does not return any output.To specify a template, use the GalleryTemplateIdentity or TemplateFile parameters. To specify the template parameter values, use the TemplateParameterFile or TemplateParameterObject parameters, or use the template parameters that are added to the command dynamically when you specify the template. To get the parameters, just type a minus sign (-) to indicate a parameter name and press the TAB key to trigger tab-completion. If you miss a required parameter, the cmdlet prompts you for the value. Parameter values typed at the command line take precedence over values in a template parameter object or file.A resource group template is a JSON-based model of a resource group for a complex cloud-based service, such as a web portal. You can use a resource group template to create a resource group or resource group deployment. The template includes parameter (placeholders) for configurable property values, likes names and sizes. You can find many templates in the Azure template gallery (Get-AzureRmResourceGroupGalleryTemplate) and you can create your own templates.
+ The Test-AzureResourceGroupDeployment cmdlet verifies the validity of a resource group template, its parameters, and parameter values. It returns errors that it finds. Otherwise, it does not return any output.To specify a template, use the GalleryTemplateIdentity or TemplateFile parameters. To specify the template parameter values, use the TemplateParameterFile or TemplateParameterObject parameters, or use the template parameters that are added to the command dynamically when you specify the template. To get the parameters, just type a minus sign (-) to indicate a parameter name and press the TAB key to trigger tab-completion. If you miss a required parameter, the cmdlet prompts you for the value. Parameter values typed at the command line take precedence over values in a template parameter object or file.A resource group template is a JSON-based model of a resource group for a complex cloud-based service, such as a web portal. You can use a resource group template to create a resource group or resource group deployment. The template includes parameter (placeholders) for configurable property values, likes names and sizes. You can find many templates in the Azure template gallery (Get-AzureRmResourceGroupGalleryTemplate) and you can create your own templates.
- Test-AzureResourceGroupTemplate
+ Test-AzureResourceGroupDeployment
ResourceGroupName
@@ -9175,20 +9175,6 @@ True
String
-
- StorageAccountName
-
- Specifies the name of a storage account in the subscription. Test-AzureResourceGroupGalleryTemplate saves the contents of local template files in the storage account. This parameter is optional, but a storage account is required when you use the TemplateFile parameter.The default value is the current storage account in the subscription. If you do not specify a storage account and the subscription does not have a storage account that it designated as "current," the command fails.To create a storage account, use the Switch-AzureMode cmdlet to switch to the Azure module, and then use the New-AzureRmStorageAccount cmdlet. To make the a storage account the "current storage account" for the subscription, use the CurrentStorageAccountName parameter of the Set-AzureRmSubscription cmdlet.
-
- String
-
-
- TemplateVersion
-
- Specifies a particular version of the gallery or custom template. Enter the API version number, such as "2014-04-01-preview". This parameter is optional. If you specify this parameter, Test-AzureResourceGroupGalleryTemplate verifies that the specified template has the matching version and fails if it does not.
-
- String
-
Profile
@@ -9198,7 +9184,7 @@ True
- Test-AzureResourceGroupTemplate
+ Test-AzureResourceGroupDeployment
ResourceGroupName
@@ -9220,13 +9206,6 @@ True
String
-
- TemplateVersion
-
- Specifies a particular version of the gallery or custom template. Enter the API version number, such as "2014-04-01-preview". This parameter is optional. If you specify this parameter, Test-AzureResourceGroupGalleryTemplate verifies that the specified template has the matching version and fails if it does not.
-
- String
-
Profile
@@ -9236,7 +9215,7 @@ True
- Test-AzureResourceGroupTemplate
+ Test-AzureResourceGroupDeployment
ResourceGroupName
@@ -9258,20 +9237,6 @@ True
String
-
- StorageAccountName
-
- Specifies the name of a storage account in the subscription. Test-AzureResourceGroupGalleryTemplate saves the contents of local template files in the storage account. This parameter is optional, but a storage account is required when you use the TemplateFile parameter.The default value is the current storage account in the subscription. If you do not specify a storage account and the subscription does not have a storage account that it designated as "current," the command fails.To create a storage account, use the Switch-AzureMode cmdlet to switch to the Azure module, and then use the New-AzureRmStorageAccount cmdlet. To make the a storage account the "current storage account" for the subscription, use the CurrentStorageAccountName parameter of the Set-AzureRmSubscription cmdlet.
-
- String
-
-
- TemplateVersion
-
- Specifies a particular version of the gallery or custom template. Enter the API version number, such as "2014-04-01-preview". This parameter is optional. If you specify this parameter, Test-AzureResourceGroupGalleryTemplate verifies that the specified template has the matching version and fails if it does not.
-
- String
-
Profile
@@ -9281,7 +9246,7 @@ True
- Test-AzureResourceGroupTemplate
+ Test-AzureResourceGroupDeployment
ResourceGroupName
@@ -9296,20 +9261,6 @@ True
Hashtable
-
- GalleryTemplateIdentity
-
- Specifies the identity of the gallery template to test. Enter an Identity value not a file name. Wildcards are not permitted.To get the identity of a gallery template, use the Get-AzureRmResourceGroupGalleryTemplate cmdlet. To test a gallery template that is saved as a JSON file on disk, use the TemplateFile parameter.
-
- String
-
-
- TemplateVersion
-
- Specifies a particular version of the gallery or custom template. Enter the API version number, such as "2014-04-01-preview". This parameter is optional. If you specify this parameter, Test-AzureResourceGroupGalleryTemplate verifies that the specified template has the matching version and fails if it does not.
-
- String
-
Profile
@@ -9319,7 +9270,7 @@ True
- Test-AzureResourceGroupTemplate
+ Test-AzureResourceGroupDeployment
ResourceGroupName
@@ -9334,20 +9285,6 @@ True
String
-
- GalleryTemplateIdentity
-
- Specifies the identity of the gallery template to test. Enter an Identity value not a file name. Wildcards are not permitted.To get the identity of a gallery template, use the Get-AzureRmResourceGroupGalleryTemplate cmdlet. To test a gallery template that is saved as a JSON file on disk, use the TemplateFile parameter.
-
- String
-
-
- TemplateVersion
-
- Specifies a particular version of the gallery or custom template. Enter the API version number, such as "2014-04-01-preview". This parameter is optional. If you specify this parameter, Test-AzureResourceGroupGalleryTemplate verifies that the specified template has the matching version and fails if it does not.
-
- String
-
Profile
@@ -9357,7 +9294,7 @@ True
- Test-AzureResourceGroupTemplate
+ Test-AzureResourceGroupDeployment
ResourceGroupName
@@ -9379,13 +9316,6 @@ True
String
-
- TemplateVersion
-
- Specifies a particular version of the gallery or custom template. Enter the API version number, such as "2014-04-01-preview". This parameter is optional. If you specify this parameter, Test-AzureResourceGroupGalleryTemplate verifies that the specified template has the matching version and fails if it does not.
-
- String
-
Profile
@@ -9395,7 +9325,7 @@ True
- Test-AzureResourceGroupTemplate
+ Test-AzureResourceGroupDeployment
ResourceGroupName
@@ -9417,20 +9347,6 @@ True
String
-
- StorageAccountName
-
- Specifies the name of a storage account in the subscription. Test-AzureResourceGroupGalleryTemplate saves the contents of local template files in the storage account. This parameter is optional, but a storage account is required when you use the TemplateFile parameter.The default value is the current storage account in the subscription. If you do not specify a storage account and the subscription does not have a storage account that it designated as "current," the command fails.To create a storage account, use the Switch-AzureMode cmdlet to switch to the Azure module, and then use the New-AzureRmStorageAccount cmdlet. To make the a storage account the "current storage account" for the subscription, use the CurrentStorageAccountName parameter of the Set-AzureRmSubscription cmdlet.
-
- String
-
-
- TemplateVersion
-
- Specifies a particular version of the gallery or custom template. Enter the API version number, such as "2014-04-01-preview". This parameter is optional. If you specify this parameter, Test-AzureResourceGroupGalleryTemplate verifies that the specified template has the matching version and fails if it does not.
-
- String
-
Profile
@@ -9440,7 +9356,7 @@ True
- Test-AzureResourceGroupTemplate
+ Test-AzureResourceGroupDeployment
ResourceGroupName
@@ -9448,20 +9364,6 @@ True
String
-
- GalleryTemplateIdentity
-
- Specifies the identity of the gallery template to test. Enter an Identity value not a file name. Wildcards are not permitted.To get the identity of a gallery template, use the Get-AzureRmResourceGroupGalleryTemplate cmdlet. To test a gallery template that is saved as a JSON file on disk, use the TemplateFile parameter.
-
- String
-
-
- TemplateVersion
-
- Specifies a particular version of the gallery or custom template. Enter the API version number, such as "2014-04-01-preview". This parameter is optional. If you specify this parameter, Test-AzureResourceGroupGalleryTemplate verifies that the specified template has the matching version and fails if it does not.
-
- String
-
Profile
@@ -9471,7 +9373,7 @@ True
- Test-AzureResourceGroupTemplate
+ Test-AzureResourceGroupDeployment
ResourceGroupName
@@ -9486,13 +9388,6 @@ True
String
-
- TemplateVersion
-
- Specifies a particular version of the gallery or custom template. Enter the API version number, such as "2014-04-01-preview". This parameter is optional. If you specify this parameter, Test-AzureResourceGroupGalleryTemplate verifies that the specified template has the matching version and fails if it does not.
-
- String
-
Profile
@@ -9527,30 +9422,6 @@ True
-
- StorageAccountName
-
- Specifies the name of a storage account in the subscription. Test-AzureResourceGroupGalleryTemplate saves the contents of local template files in the storage account. This parameter is optional, but a storage account is required when you use the TemplateFile parameter.The default value is the current storage account in the subscription. If you do not specify a storage account and the subscription does not have a storage account that it designated as "current," the command fails.To create a storage account, use the Switch-AzureMode cmdlet to switch to the Azure module, and then use the New-AzureRmStorageAccount cmdlet. To make the a storage account the "current storage account" for the subscription, use the CurrentStorageAccountName parameter of the Set-AzureRmSubscription cmdlet.
-
- String
-
- String
-
-
-
-
-
- TemplateVersion
-
- Specifies a particular version of the gallery or custom template. Enter the API version number, such as "2014-04-01-preview". This parameter is optional. If you specify this parameter, Test-AzureResourceGroupGalleryTemplate verifies that the specified template has the matching version and fails if it does not.
-
- String
-
- String
-
-
-
-
Profile
@@ -9587,18 +9458,6 @@ True
-
- GalleryTemplateIdentity
-
- Specifies the identity of the gallery template to test. Enter an Identity value not a file name. Wildcards are not permitted.To get the identity of a gallery template, use the Get-AzureRmResourceGroupGalleryTemplate cmdlet. To test a gallery template that is saved as a JSON file on disk, use the TemplateFile parameter.
-
- String
-
- String
-
-
-
-
TemplateParameterFile
@@ -9652,7 +9511,7 @@ True
PS C:\>
- PS C:\>Test-AzureResourceGroupTemplate -ResourceGroupName ContosoLabsRG -TemplateFile $home\Documents\Azure\Templates\CustomHostingPlan.json -TemplateParameterFile $home\Documents\Azure\Templates\HostingPlanParms.jsonPS C:>
+ PS C:\>Test-AzureResourceGroupDeployment -ResourceGroupName ContosoLabsRG -TemplateFile $home\Documents\Azure\Templates\CustomHostingPlan.json -TemplateParameterFile $home\Documents\Azure\Templates\HostingPlanParms.jsonPS C:>
This command tests a custom template file, CustomHostingPlan.json, and a template parameter file, HostingPlanParms.json. Because the cmdlet does not find any errors, it does not return any output.
@@ -9667,36 +9526,14 @@ True
-
- -------------------------- Example 2: Test a parameter object for a gallery template --------------------------
-
- PS C:\>
-
- PS C:\>Test-AzureResourceGroupTemplate -ResourceGroupName ContosoLabsRG -GalleryTemplateIdentity Microsoft.WebSite.0.1.0-preview1 -TemplateParameterObject @{siteName = "ContosoSite";hostingPlanName="ContosoHosting";siteMode="Limited";computeMode="Shared";subscriptionID='9b14a38b-4b93-4554-8bb0-3cefb47a4e1f';resourceGroup='ContosoLabsRG'}cmdlet Test-AzureResourceGroupTemplate at command pipeline position 1Supply values for the following parameters:(Type !? for Help.)siteLocation:"South Central US"Code : InvalidTemplateMessage : Deployment template validation failed: 'The template parameters 'subscriptionID' are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supportedparameters for this template are 'siteName, hostingPlanName, siteMode, computeMode, siteLocation, subscriptionId, resourceGroup'.'.a
-
-PS C:\>Test-AzureResourceGroupTemplate -ResourceGroupName ContosoLabsRG -GalleryTemplateIdentity Microsoft.WebSite.0.1.0-preview1 -TemplateParameterObject @{siteName = "ContosoSite";hostingPlanName="ContosoHosting";siteMode="Limited";computeMode="Shared";subscriptionId='9b14a38b-4b93-4554-8bb0-3cefb47a4e1f';resourceGroup='ContosoLabsRG';siteLocation='South Central US'}
-
- This command tests gallery template and a hash table of parameter names and values. The command uses the GalleryTemplateIdentity parameter to specify the identity of the gallery template. It uses the TemplateParameterObject cmdlet to specify the template parameters and their values.
-
-
- In this case, the template parameter hash table is missing the siteLocation parameter. The cmdlet recognizes the omission and prompts for a value. However, the cmdlet still returns an error, because the subscriptionId parameter in hash table is misspelled as "subscriptionID".In the second command, the errors are corrected, and the cmdlet does not return any output.
-
-
-
-
-
-
-
-
-
-------------------------- Example 3: Test a template with dynamic parameter values --------------------------
PS C:\>
- PS C:\>Test-AzureResourceGroupTemplate -ResourceGroupName ContosoLabsRG -TemplateFile C:\Users\juneb\Documents\Azure\Templates\NewHostingPlan.json -siteName ContosoDev -siteMode Limited -computeMode Shared -siteLocation 'South Central US' -sku FreeCode : InvalidTemplateMessage : Deployment template validation failed: 'The template parameter 'hostingPlanName' is not valid.'.
+ PS C:\>Test-AzureResourceGroupDeployment -ResourceGroupName ContosoLabsRG -TemplateFile C:\Users\juneb\Documents\Azure\Templates\NewHostingPlan.json -siteName ContosoDev -siteMode Limited -computeMode Shared -siteLocation 'South Central US' -sku FreeCode : InvalidTemplateMessage : Deployment template validation failed: 'The template parameter 'hostingPlanName' is not valid.'.
- This command uses the Test-AzureResourceGroupTemplate cmdlet to test a custom template. Instead of providing the template parameter names, we used the feature that adds the template parameters to command dynamically.
+ This command uses the Test-AzureResourceGroupDeployment cmdlet to test a custom template. Instead of providing the template parameter names, we used the feature that adds the template parameters to command dynamically.
To use the dynamic parameters, type a minus sign (-) to indicate a parameter name and press the TAB key. The tab-completion feature supplies parameter name. To cycle through all of the parameter names, press the TAB key repeatedly. In this case, we used the dynamic parameters to specify all of the parameter names at the command line.In this case, even though the template parameter names and values are correct, the Parameters section in the custom template is missing the hostingPlan parameter that is specified in the Resource section of the template. The cmdlet detects and reports this error.
diff --git a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceWithParameterBaseCmdlet.cs b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceWithParameterBaseCmdlet.cs
index 33ceac142058..7b50be7045c2 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceWithParameterBaseCmdlet.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceWithParameterBaseCmdlet.cs
@@ -30,9 +30,6 @@ namespace Microsoft.Azure.Commands.Resources
public abstract class ResourceWithParameterBaseCmdlet : ResourcesBaseCmdlet
{
protected const string BaseParameterSetName = "Default";
- protected const string GalleryTemplateParameterObjectParameterSetName = "Deployment via Gallery and template parameters object";
- protected const string GalleryTemplateParameterFileParameterSetName = "Deployment via Gallery and template parameters file";
- protected const string GalleryTemplateParameterUriParameterSetName = "Deployment via Gallery and template parameters uri";
protected const string TemplateFileParameterObjectParameterSetName = "Deployment via template file and template parameters object";
protected const string TemplateFileParameterFileParameterSetName = "Deployment via template file and template parameters file";
protected const string TemplateFileParameterUriParameterSetName = "Deployment via template file template parameters uri";
@@ -45,8 +42,6 @@ public abstract class ResourceWithParameterBaseCmdlet : ResourcesBaseCmdlet
protected RuntimeDefinedParameterDictionary dynamicParameters;
- private string galleryTemplateName;
-
private string templateFile;
private string templateUri;
@@ -54,19 +49,14 @@ public abstract class ResourceWithParameterBaseCmdlet : ResourcesBaseCmdlet
protected ResourceWithParameterBaseCmdlet()
{
dynamicParameters = new RuntimeDefinedParameterDictionary();
- galleryTemplateName = null;
}
- [Parameter(ParameterSetName = GalleryTemplateParameterObjectParameterSetName,
- Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "A hash table which represents the parameters.")]
[Parameter(ParameterSetName = TemplateFileParameterObjectParameterSetName,
Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "A hash table which represents the parameters.")]
[Parameter(ParameterSetName = TemplateUriParameterObjectParameterSetName,
Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "A hash table which represents the parameters.")]
public Hashtable TemplateParameterObject { get; set; }
- [Parameter(ParameterSetName = GalleryTemplateParameterFileParameterSetName,
- Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "A file that has the template parameters.")]
[Parameter(ParameterSetName = TemplateFileParameterFileParameterSetName,
Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "A file that has the template parameters.")]
[Parameter(ParameterSetName = TemplateUriParameterFileParameterSetName,
@@ -74,8 +64,6 @@ protected ResourceWithParameterBaseCmdlet()
[ValidateNotNullOrEmpty]
public string TemplateParameterFile { get; set; }
- [Parameter(ParameterSetName = GalleryTemplateParameterUriParameterSetName,
- Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Uri to the template parameter file.")]
[Parameter(ParameterSetName = TemplateFileParameterUriParameterSetName,
Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Uri to the template parameter file.")]
[Parameter(ParameterSetName = TemplateUriParameterUriParameterSetName,
@@ -83,17 +71,6 @@ protected ResourceWithParameterBaseCmdlet()
[ValidateNotNullOrEmpty]
public string TemplateParameterUri { get; set; }
- [Parameter(ParameterSetName = GalleryTemplateParameterObjectParameterSetName,
- Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Name of the template in the gallery.")]
- [Parameter(ParameterSetName = GalleryTemplateParameterFileParameterSetName,
- Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Name of the template in the gallery.")]
- [Parameter(ParameterSetName = GalleryTemplateParameterUriParameterSetName,
- Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Name of the template in the gallery.")]
- [Parameter(ParameterSetName = ParameterlessGalleryTemplateParameterSetName,
- Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Name of the template in the gallery.")]
- [ValidateNotNullOrEmpty]
- public string GalleryTemplateIdentity { get; set; }
-
[Parameter(ParameterSetName = TemplateFileParameterObjectParameterSetName,
Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Local path to the template file.")]
[Parameter(ParameterSetName = TemplateFileParameterFileParameterSetName,
@@ -116,69 +93,9 @@ protected ResourceWithParameterBaseCmdlet()
[ValidateNotNullOrEmpty]
public string TemplateUri { get; set; }
- [Parameter(ParameterSetName = TemplateFileParameterObjectParameterSetName,
- Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The storage account which the cmdlet should use to upload the template file to. If not specified, the current storage account of the subscription will be used.")]
- [Parameter(ParameterSetName = TemplateFileParameterFileParameterSetName,
- Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The storage account which the cmdlet should use to upload the template file to. If not specified, the current storage account of the subscription will be used.")]
- [Parameter(ParameterSetName = TemplateFileParameterUriParameterSetName,
- Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The storage account which the cmdlet should use to upload the template file to. If not specified, the current storage account of the subscription will be used.")]
- [Parameter(ParameterSetName = ParameterlessTemplateFileParameterSetName,
- Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The storage account which the cmdlet should use to upload the template file to. If not specified, the current storage account of the subscription will be used.")]
- [ValidateNotNullOrEmpty]
- public string StorageAccountName { get; set; }
-
- [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The expect content version of the template.")]
- [ValidateNotNullOrEmpty]
- public string TemplateVersion { get; set; }
-
public object GetDynamicParameters()
{
- if (!string.IsNullOrEmpty(GalleryTemplateIdentity))
- {
- List galleryItems = new List();
- try
- {
- galleryItems = GalleryTemplatesClient.FilterGalleryTemplates(new FilterGalleryTemplatesOptions() { Identity = GalleryTemplateIdentity });
- }
- catch (CloudException)
- {
- // we could not find a template with that identity
- }
-
- if (galleryItems.Count == 0)
- {
- galleryItems = GalleryTemplatesClient.FilterGalleryTemplates(new FilterGalleryTemplatesOptions() { ApplicationName = GalleryTemplateIdentity, AllVersions = false });
- if (galleryItems == null || galleryItems.Count == 0)
- {
- throw new ArgumentException(string.Format(Properties.Resources.InvalidTemplateIdentity, GalleryTemplateIdentity));
- }
-
- GalleryTemplateIdentity = galleryItems[0].Identity;
- }
- }
-
- if (!string.IsNullOrEmpty(GalleryTemplateIdentity) &&
- !GalleryTemplateIdentity.Equals(galleryTemplateName, StringComparison.OrdinalIgnoreCase))
- {
- galleryTemplateName = GalleryTemplateIdentity;
- if(string.IsNullOrEmpty(TemplateParameterUri))
- {
- dynamicParameters = GalleryTemplatesClient.GetTemplateParametersFromGallery(
- GalleryTemplateIdentity,
- TemplateParameterObject,
- this.TryResolvePath(TemplateParameterFile),
- MyInvocation.MyCommand.Parameters.Keys.ToArray());
- }
- else
- {
- dynamicParameters = GalleryTemplatesClient.GetTemplateParametersFromGallery(
- GalleryTemplateIdentity,
- TemplateParameterObject,
- TemplateParameterUri,
- MyInvocation.MyCommand.Parameters.Keys.ToArray());
- }
- }
- else if (!string.IsNullOrEmpty(TemplateFile) &&
+ if (!string.IsNullOrEmpty(TemplateFile) &&
!TemplateFile.Equals(templateFile, StringComparison.OrdinalIgnoreCase))
{
templateFile = TemplateFile;
diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommand.cs
index 6681e3fd22a6..dee826d4a631 100644
--- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommand.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommand.cs
@@ -53,19 +53,11 @@ protected override void ProcessRecord()
ResourceGroupName = ResourceGroupName,
DeploymentName = Name,
DeploymentMode = Mode,
- GalleryTemplateIdentity = GalleryTemplateIdentity,
TemplateFile = TemplateUri ?? this.TryResolvePath(TemplateFile),
TemplateParameterObject = GetTemplateParameterObject(TemplateParameterObject),
- ParameterUri = TemplateParameterUri,
- TemplateVersion = TemplateVersion,
- StorageAccountName = StorageAccountName
+ ParameterUri = TemplateParameterUri
};
- if (!string.IsNullOrEmpty(TemplateVersion) || !string.IsNullOrEmpty(StorageAccountName) || !string.IsNullOrEmpty(GalleryTemplateIdentity))
- {
- WriteWarning("The GalleryTemplateIdentity, TemplateVersion and StorageAccountName parameters in New-AzureRmResourceGroupDeployment cmdlet is being deprecated and will be removed in a future release.");
- }
-
if(this.Mode == DeploymentMode.Complete)
{
this.ConfirmAction(
diff --git a/src/ResourceManager/Resources/Commands.Resources/Templates/TestAzureResourceGroupTemplateCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/TestAzureResourceGroupDeploymentCommand.cs
similarity index 67%
rename from src/ResourceManager/Resources/Commands.Resources/Templates/TestAzureResourceGroupTemplateCommand.cs
rename to src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/TestAzureResourceGroupDeploymentCommand.cs
index 5eca9db4a855..f0ff21d1a74a 100644
--- a/src/ResourceManager/Resources/Commands.Resources/Templates/TestAzureResourceGroupTemplateCommand.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/TestAzureResourceGroupDeploymentCommand.cs
@@ -23,8 +23,8 @@ namespace Microsoft.Azure.Commands.Resources.ResourceGroupDeployments
///
/// Validate a template to see whether it's using the right syntax, resource providers, resource types, etc.
///
- [Cmdlet(VerbsDiagnostic.Test, "AzureRmResourceGroupTemplate", DefaultParameterSetName = ParameterlessTemplateFileParameterSetName), OutputType(typeof(List))]
- public class TestAzureResourceGroupTemplateCommand : ResourceWithParameterBaseCmdlet, IDynamicParameters
+ [Cmdlet(VerbsDiagnostic.Test, "AzureRmResourceGroupDeployment", DefaultParameterSetName = ParameterlessTemplateFileParameterSetName), OutputType(typeof(List))]
+ public class TestAzureResourceGroupDeploymentCommand : ResourceWithParameterBaseCmdlet, IDynamicParameters
{
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")]
[ValidateNotNullOrEmpty]
@@ -33,27 +33,19 @@ public class TestAzureResourceGroupTemplateCommand : ResourceWithParameterBaseCm
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The deployment mode.")]
public DeploymentMode Mode { get; set; }
- public TestAzureResourceGroupTemplateCommand()
+ public TestAzureResourceGroupDeploymentCommand()
{
this.Mode = DeploymentMode.Incremental;
}
protected override void ProcessRecord()
{
- this.WriteWarning("The Test-AzureResourceGroupTemplate cmdlet is being renamed to Test-AzureResourceGroupDeployment in a future release.");
- if (!string.IsNullOrEmpty(TemplateVersion) || !string.IsNullOrEmpty(StorageAccountName) || !string.IsNullOrEmpty(GalleryTemplateIdentity))
- {
- WriteWarning("The GalleryTemplateIdentity, TemplateVersion and StorageAccountName parameters are being deprecated and will be removed in a future release.");
- }
ValidatePSResourceGroupDeploymentParameters parameters = new ValidatePSResourceGroupDeploymentParameters()
{
ResourceGroupName = ResourceGroupName,
- GalleryTemplateIdentity = GalleryTemplateIdentity,
TemplateFile = TemplateUri ?? this.TryResolvePath(TemplateFile),
TemplateParameterObject = GetTemplateParameterObject(TemplateParameterObject),
- ParameterUri = TemplateParameterUri,
- TemplateVersion = TemplateVersion,
- StorageAccountName = StorageAccountName
+ ParameterUri = TemplateParameterUri
};
WriteObject(ResourcesClient.ValidatePSResourceGroupDeployment(parameters, Mode));
diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs
index b12cd457f6a3..9308d87017ad 100644
--- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs
+++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs
@@ -53,17 +53,14 @@ protected override void ProcessRecord()
ResourceGroupName = Name,
Location = Location,
DeploymentName = DeploymentName,
- GalleryTemplateIdentity = GalleryTemplateIdentity,
TemplateFile = TemplateUri ?? this.TryResolvePath(TemplateFile),
TemplateParameterObject = GetTemplateParameterObject(TemplateParameterObject),
- TemplateVersion = TemplateVersion,
- StorageAccountName = StorageAccountName,
Force = Force.IsPresent,
Tag = Tag,
ConfirmAction = ConfirmAction
};
- if(!string.IsNullOrEmpty(DeploymentName) || !string.IsNullOrEmpty(GalleryTemplateIdentity) || !string.IsNullOrEmpty(TemplateFile)
- || !string.IsNullOrEmpty(TemplateVersion) || TemplateParameterObject != null || !string.IsNullOrEmpty(StorageAccountName))
+ if(!string.IsNullOrEmpty(DeploymentName) || !string.IsNullOrEmpty(TemplateFile)
+ || TemplateParameterObject != null)
{
WriteWarning("The deployment parameters in New-AzureRmResourceGroup cmdlet is being deprecated and will be removed in a future release. Please use New-AzureRmResourceGroupDeployment to submit deployments.");
}