Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Accounts/Accounts/AzureRmAlias/Mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2023,7 +2023,8 @@
"Set-AzADUser": "Set-AzureRmADUser",
"Remove-AzTag": "Remove-AzureRmTag",
"Get-AzTag": "Get-AzureRmTag",
"New-AzTag": "New-AzureRmTag"
"New-AzTag": "New-AzureRmTag",
"Update-AzTag": "Update-AzureRmTag"
},
"Az.Scheduler": {
"Disable-AzSchedulerJobCollection": "Disable-AzureRmSchedulerJobCollection",
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/ResourceManager/ResourceManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="3.0.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="3.3.0-preview" />
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,13 +560,15 @@ private TemplateValidationInfo GetTemplateValidationResult(PSDeploymentCmdletPar

private DeploymentValidateResult ValidateDeployment(PSDeploymentCmdletParameters parameters, Deployment deployment)
{
var scopedDeployment = new ScopedDeployment { Properties = deployment.Properties, Location = deployment.Location };

switch (parameters.ScopeType)
{
case DeploymentScopeType.Tenant:
return ResourceManagementClient.Deployments.ValidateAtTenantScope(parameters.DeploymentName, deployment);
return ResourceManagementClient.Deployments.ValidateAtTenantScope(parameters.DeploymentName, scopedDeployment);

case DeploymentScopeType.ManagementGroup:
return ResourceManagementClient.Deployments.ValidateAtManagementGroupScope(parameters.ManagementGroupId, parameters.DeploymentName, deployment);
return ResourceManagementClient.Deployments.ValidateAtManagementGroupScope(parameters.ManagementGroupId, parameters.DeploymentName, scopedDeployment);

case DeploymentScopeType.ResourceGroup:
return ResourceManagementClient.Deployments.Validate(parameters.ResourceGroupName, parameters.DeploymentName, deployment);
Expand Down Expand Up @@ -687,14 +689,16 @@ private bool CheckDeploymentExistence(string subscriptionId, string resourceGrou

private void BeginDeployment(PSDeploymentCmdletParameters parameters, Deployment deployment)
{
var scopedDeployment = new ScopedDeployment { Properties = deployment.Properties, Location = deployment.Location };

switch (parameters.ScopeType)
{
case DeploymentScopeType.Tenant:
ResourceManagementClient.Deployments.BeginCreateOrUpdateAtTenantScope(parameters.DeploymentName, deployment);
ResourceManagementClient.Deployments.BeginCreateOrUpdateAtTenantScope(parameters.DeploymentName, scopedDeployment);
break;

case DeploymentScopeType.ManagementGroup:
ResourceManagementClient.Deployments.BeginCreateOrUpdateAtManagementGroupScope(parameters.ManagementGroupId, parameters.DeploymentName, deployment);
ResourceManagementClient.Deployments.BeginCreateOrUpdateAtManagementGroupScope(parameters.ManagementGroupId, parameters.DeploymentName, scopedDeployment);
break;

case DeploymentScopeType.ResourceGroup:
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/Resources.Test/Resources.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Azure.Management.ResourceManager" Version="3.0.0-preview" />
<PackageReference Update="Microsoft.Azure.Management.ResourceManager" Version="3.3.0-preview" />
</ItemGroup>

</Project>
83 changes: 83 additions & 0 deletions src/Resources/Resources.Test/ScenarioTests/TagTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// ----------------------------------------------------------------------------------
//
// 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 Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.Azure.Commands.Resources.Test.ScenarioTests
{
public class TagTests : ResourceTestRunner
{
public TagTests(ITestOutputHelper output) : base(output)
{
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TagCreateOrUpdateWithResourceIdParamsForSubscription()
{
TestRunner.RunTestScript("Test-TagCreateOrUpdateWithResourceIdParamsForSubscription");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TagCreateOrUpdateWithResourceIdParamsForResource()
{
TestRunner.RunTestScript("Test-TagCreateOrUpdateWithResourceIdParamsForResource");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TagUpdateWithResourceIdParamsForSubscription()
{
TestRunner.RunTestScript("Test-TagUpdateWithResourceIdParamsForSubscription");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TagUpdateWithResourceIdParamsForResource()
{
TestRunner.RunTestScript("Test-TagUpdateWithResourceIdParamsForResource");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TagGetWithResourceIdParamsForSubscription()
{
TestRunner.RunTestScript("Test-TagGetWithResourceIdParamsForSubscription");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TagGetWithResourceIdParamsForResource()
{
TestRunner.RunTestScript("Test-TagGetWithResourceIdParamsForResource");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TagDeleteWithResourceIdParamsForSubscription()
{
TestRunner.RunTestScript("Test-TagDeleteWithResourceIdParamsForSubscription");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TagDeleteWithResourceIdParamsForResource()
{
TestRunner.RunTestScript("Test-TagDeleteWithResourceIdParamsForResource");
}
}
}
Loading