Skip to content

Commit da5af36

Browse files
committed
Bicep support for DeploymentStacks
1 parent ca9a340 commit da5af36

10 files changed

+26
-5
lines changed

src/Resources/ResourceManager/Implementation/CmdletBase/DeploymentStacksCmdletBase.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ public DeploymentStacksSdkClient DeploymentStacksSdkClient
4343
}
4444
}
4545

46+
protected string ResolveBicepFile(string TemplateFile)
47+
{
48+
string filePath = "";
49+
if (BicepUtility.IsBicepFile(TemplateFile))
50+
{
51+
filePath = BicepUtility.BuildFile(this.ResolvePath(TemplateFile), this.WriteVerbose, this.WriteWarning);
52+
}
53+
return filePath;
54+
}
55+
4656
protected Hashtable GetParameterObject(string parameterFile)
4757
{
4858
var parameters = new Hashtable();

src/Resources/ResourceManager/Implementation/DeploymentStacks/NewAzResourceGroupDeploymentStack.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ protected override void OnProcessRecord()
153153
throw new PSInvalidOperationException(
154154
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
155155
}
156+
filePath = ResolveBicepFile(TemplateFile);
156157
TemplateUri = filePath;
157158
break;
158159
case ParameterFileTemplateSpecParameterSetName:
@@ -166,6 +167,7 @@ protected override void OnProcessRecord()
166167
throw new PSInvalidOperationException(
167168
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
168169
}
170+
filePath = ResolveBicepFile(TemplateFile);
169171
parameters = this.GetParameterObject(TemplateParameterFile);
170172
TemplateUri = filePath;
171173
break;
@@ -176,6 +178,7 @@ protected override void OnProcessRecord()
176178
throw new PSInvalidOperationException(
177179
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
178180
}
181+
filePath = ResolveBicepFile(TemplateFile);
179182
TemplateUri = filePath;
180183
parameters = GetTemplateParameterObject(TemplateParameterObject);
181184
break;

src/Resources/ResourceManager/Implementation/DeploymentStacks/NewAzSubscriptionDeploymentStack.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
1616
{
1717
using Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels;
18-
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
1918
using Microsoft.Azure.Management.ResourceManager.Models;
2019
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2120
using System;
@@ -155,6 +154,7 @@ protected override void OnProcessRecord()
155154
throw new PSInvalidOperationException(
156155
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
157156
}
157+
filePath = ResolveBicepFile(TemplateFile);
158158
TemplateUri = filePath;
159159
break;
160160
case ParameterFileTemplateSpecParameterSetName:
@@ -168,6 +168,7 @@ protected override void OnProcessRecord()
168168
throw new PSInvalidOperationException(
169169
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
170170
}
171+
filePath = ResolveBicepFile(TemplateFile);
171172
parameters = this.GetParameterObject(TemplateParameterFile);
172173
TemplateUri = filePath;
173174
break;
@@ -178,6 +179,7 @@ protected override void OnProcessRecord()
178179
throw new PSInvalidOperationException(
179180
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
180181
}
182+
filePath = ResolveBicepFile(TemplateFile);
181183
TemplateUri = filePath;
182184
parameters = GetTemplateParameterObject(TemplateParameterObject);
183185
break;

src/Resources/ResourceManager/Implementation/DeploymentStacks/SetAzResourceGroupDeploymentStack.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ protected override void OnProcessRecord()
152152
throw new PSInvalidOperationException(
153153
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
154154
}
155+
filePath = ResolveBicepFile(TemplateFile);
155156
TemplateUri = filePath;
156157
break;
157158
case ParameterFileTemplateSpecParameterSetName:
@@ -165,6 +166,7 @@ protected override void OnProcessRecord()
165166
throw new PSInvalidOperationException(
166167
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
167168
}
169+
filePath = ResolveBicepFile(TemplateFile);
168170
parameters = this.GetParameterObject(TemplateParameterFile);
169171
TemplateUri = templatePath;
170172
break;
@@ -175,6 +177,7 @@ protected override void OnProcessRecord()
175177
throw new PSInvalidOperationException(
176178
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
177179
}
180+
filePath = ResolveBicepFile(TemplateFile);
178181
TemplateUri = filePath;
179182
parameters = GetTemplateParameterObject(TemplateParameterObject);
180183
break;

src/Resources/ResourceManager/Implementation/DeploymentStacks/SetAzSubscriptionDeploymentStack.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ protected override void OnProcessRecord()
155155
throw new PSInvalidOperationException(
156156
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
157157
}
158+
filePath = ResolveBicepFile(TemplateFile);
158159
TemplateUri = filePath;
159160
break;
160161
case ParameterFileTemplateSpecParameterSetName:
@@ -168,6 +169,7 @@ protected override void OnProcessRecord()
168169
throw new PSInvalidOperationException(
169170
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
170171
}
172+
filePath = ResolveBicepFile(TemplateFile);
171173
parameters = this.GetParameterObject(TemplateParameterFile);
172174
TemplateUri = filePath;
173175
break;
@@ -178,6 +180,7 @@ protected override void OnProcessRecord()
178180
throw new PSInvalidOperationException(
179181
string.Format(ProjectResources.InvalidFilePath, TemplateFile));
180182
}
183+
filePath = ResolveBicepFile(TemplateFile);
181184
TemplateUri = filePath;
182185
parameters = GetTemplateParameterObject(TemplateParameterObject);
183186
break;

src/Resources/ResourceManager/ResourceManager.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<ItemGroup>
1515
<PackageReference Include="AutoMapper" Version="6.2.2" />
16-
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="3.17.3-preview" />
16+
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="3.17.4-preview" />
1717
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
1818
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
1919
</ItemGroup>

src/Resources/ResourceManager/SdkClient/DeploymentStacksSdkClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public DeploymentStacksSdkClient(IDeploymentStacksClient deploymentStacksClient)
4040
this.DeploymentStacksClient = deploymentStacksClient;
4141
}
4242

43-
// <summary>
43+
/// <summary>
4444
/// Parameter-less constructor for mocking
4545
/// </summary>
4646
public DeploymentStacksSdkClient()

src/Resources/Resources.Test/Resources.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Update="Microsoft.Azure.Management.ResourceManager" Version="3.17.3-preview" />
36+
<PackageReference Update="Microsoft.Azure.Management.ResourceManager" Version="3.17.4-preview" />
3737
</ItemGroup>
3838
<ItemGroup>
3939
<PackageReference Include="FluentAssertions" Version="5.9.0" />

src/Resources/Resources/Resources.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<ItemGroup>
1919
<PackageReference Include="Microsoft.Azure.Management.Authorization" Version="2.13.0-preview" />
2020
<PackageReference Include="Microsoft.Azure.Management.ManagementGroups" Version="2.0.0-beta" />
21-
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="3.17.3-preview" />
21+
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="3.17.4-preview" />
2222
</ItemGroup>
2323

2424
<ItemGroup>
Binary file not shown.

0 commit comments

Comments
 (0)