Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/Bicep.Core.IntegrationTests/RegistryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public async Task InvalidRootCachePathShouldProduceReasonableErrors()
var compilation = await compiler.CreateCompilation(fileUri.ToIOUri());

var diagnostics = compilation.GetAllDiagnosticsByBicepFile();
diagnostics.Should().HaveCount(1);
diagnostics.Should().HaveCount(2);
var expectedErrorMessage = "Unable to restore the artifact with reference \"{0}\": Unable to create the local artifact directory \"";
diagnostics.Single().Value.ExcludingLinterDiagnostics().Should().SatisfyRespectively(
diagnostics[compilation.SourceFileGrouping.EntryPoint].ExcludingLinterDiagnostics().Should().SatisfyRespectively(
Comment thread
SimonWahlin marked this conversation as resolved.
x =>
{
x.Level.Should().Be(DiagnosticLevel.Error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"demo-two": {
"registry": "mock-registry-two.invalid",
"modulePath": "demo"
},
"mock-registry-emulated": {
"fileSystem": "Publish"
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion src/Bicep.Core.Samples/Files/baselines/Registry_LF/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ module appPlanDeploy2 'br/mock-registry-one:demo/plan:v2' = {
}
}

module appPlanDeploy3 'br/mock-registry-emulated:plan:v2' = {
name: 'planDeploy3'
scope: rg
params: {
namePrefix: 'hello'
}
}

var websites = [
{
name: 'fancy'
Expand Down Expand Up @@ -130,4 +138,4 @@ module ipv6port 'br:[::1]:5000/passthrough/ipv6port:v1' = {
params: {
ipv6port: 'test'
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ module appPlanDeploy2 'br/mock-registry-one:demo/plan:v2' = {
}
}

module appPlanDeploy3 'br/mock-registry-emulated:plan:v2' = {
name: 'planDeploy3'
scope: rg
params: {
namePrefix: 'hello'
}
}

var websites = [
{
name: 'fancy'
Expand Down Expand Up @@ -132,3 +140,4 @@ module ipv6port 'br:[::1]:5000/passthrough/ipv6port:v1' = {
ipv6port: 'test'
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ module appPlanDeploy2 'br/mock-registry-one:demo/plan:v2' = {
}
}

module appPlanDeploy3 'br/mock-registry-emulated:plan:v2' = {
name: 'planDeploy3'
scope: rg
params: {
namePrefix: 'hello'
}
}

var websites = [
{
name: 'fancy'
Expand Down
22 changes: 21 additions & 1 deletion src/Bicep.Core.Samples/Files/baselines/Registry_LF/main.ir.bicep
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
targetScope = 'subscription'
//@[000:2463) ProgramExpression
//@[000:2603) ProgramExpression
//@[000:0000) | └─ResourceDependencyExpression [UNPARENTED]
//@[000:0000) | └─ResourceReferenceExpression [UNPARENTED]
//@[000:0000) | └─ResourceDependencyExpression [UNPARENTED]
//@[000:0000) | └─ResourceReferenceExpression [UNPARENTED]
//@[000:0000) | └─ResourceDependencyExpression [UNPARENTED]
Expand Down Expand Up @@ -74,6 +76,23 @@ module appPlanDeploy2 'br/mock-registry-one:demo/plan:v2' = {
}
}

module appPlanDeploy3 'br/mock-registry-emulated:plan:v2' = {
//@[000:0137) ├─DeclaredModuleExpression
//@[060:0137) | ├─ObjectExpression
name: 'planDeploy3'
//@[002:0021) | | └─ObjectPropertyExpression
//@[002:0006) | | ├─StringLiteralExpression { Value = name }
//@[008:0021) | | └─StringLiteralExpression { Value = planDeploy3 }
scope: rg
params: {
//@[010:0039) | ├─ObjectExpression
namePrefix: 'hello'
//@[004:0023) | | └─ObjectPropertyExpression
//@[004:0014) | | ├─StringLiteralExpression { Value = namePrefix }
//@[016:0023) | | └─StringLiteralExpression { Value = hello }
}
}

var websites = [
//@[000:0110) ├─DeclaredVariableExpression { Name = websites }
//@[015:0110) | └─ArrayExpression
Expand Down Expand Up @@ -374,3 +393,4 @@ module ipv6port 'br:[::1]:5000/passthrough/ipv6port:v1' = {
//@[014:0020) | | └─StringLiteralExpression { Value = test }
}
}

63 changes: 62 additions & 1 deletion src/Bicep.Core.Samples/Files/baselines/Registry_LF/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "16097344762357511977"
"templateHash": "11340138247578714789"
}
},
"variables": {
Expand Down Expand Up @@ -159,6 +159,67 @@
"[subscriptionResourceId('Microsoft.Resources/resourceGroups', 'adotfrank-rg')]"
]
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2025-04-01",
"name": "planDeploy3",
"resourceGroup": "adotfrank-rg",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
},
"mode": "Incremental",
"parameters": {
"namePrefix": {
"value": "hello"
}
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "15019246960605065046"
}
},
"parameters": {
"namePrefix": {
"type": "string"
},
"sku": {
"type": "string",
"defaultValue": "B1"
}
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2020-06-01",
"name": "[format('{0}appPlan', parameters('namePrefix'))]",
"location": "[resourceGroup().location]",
"kind": "linux",
"sku": {
"name": "[parameters('sku')]"
},
"properties": {
"reserved": true
}
}
],
"outputs": {
"planId": {
"type": "string",
"value": "[resourceId('Microsoft.Web/serverfarms', format('{0}appPlan', parameters('namePrefix')))]"
}
}
}
},
"dependsOn": [
"[subscriptionResourceId('Microsoft.Resources/resourceGroups', 'adotfrank-rg')]"
]
},
{
"copy": {
"name": "siteDeploy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,75 @@ module appPlanDeploy2 'br/mock-registry-one:demo/plan:v2' = {
}
}

module appPlanDeploy3 'br/mock-registry-emulated:plan:v2' = {
//@ {
//@ "type": "Microsoft.Resources/deployments",
//@ "apiVersion": "2025-04-01",
//@ "resourceGroup": "adotfrank-rg",
//@ "properties": {
//@ "expressionEvaluationOptions": {
//@ "scope": "inner"
//@ },
//@ "mode": "Incremental",
//@ "template": {
//@ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
//@ "contentVersion": "1.0.0.0",
//@ "metadata": {
//@ "_generator": {
//@ "name": "bicep",
//@ "version": "dev",
//@ "templateHash": "15019246960605065046"
//@ }
//@ },
//@ "parameters": {
//@ "namePrefix": {
//@ "type": "string"
//@ },
//@ "sku": {
//@ "type": "string",
//@ "defaultValue": "B1"
//@ }
//@ },
//@ "resources": [
//@ {
//@ "type": "Microsoft.Web/serverfarms",
//@ "apiVersion": "2020-06-01",
//@ "name": "[format('{0}appPlan', parameters('namePrefix'))]",
//@ "location": "[resourceGroup().location]",
//@ "kind": "linux",
//@ "sku": {
//@ "name": "[parameters('sku')]"
//@ },
//@ "properties": {
//@ "reserved": true
//@ }
//@ }
//@ ],
//@ "outputs": {
//@ "planId": {
//@ "type": "string",
//@ "value": "[resourceId('Microsoft.Web/serverfarms', format('{0}appPlan', parameters('namePrefix')))]"
//@ }
//@ }
//@ }
//@ },
//@ "dependsOn": [
//@ "[subscriptionResourceId('Microsoft.Resources/resourceGroups', 'adotfrank-rg')]"
//@ ]
//@ },
name: 'planDeploy3'
//@ "name": "planDeploy3",
scope: rg
params: {
//@ "parameters": {
//@ },
namePrefix: 'hello'
//@ "namePrefix": {
//@ "value": "hello"
//@ }
}
}

var websites = [
//@ "websites": [
//@ ],
Expand Down Expand Up @@ -780,3 +849,4 @@ module ipv6port 'br:[::1]:5000/passthrough/ipv6port:v1' = {
//@ }
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "3717084932040700305"
"templateHash": "17302964314594708830"
}
},
"variables": {
Expand Down Expand Up @@ -162,6 +162,68 @@
"rg"
]
},
"appPlanDeploy3": {
"type": "Microsoft.Resources/deployments",
"apiVersion": "2025-04-01",
"name": "planDeploy3",
"resourceGroup": "adotfrank-rg",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
},
"mode": "Incremental",
"parameters": {
"namePrefix": {
"value": "hello"
}
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"languageVersion": "2.0",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "13508561622047952911"
}
},
"parameters": {
"namePrefix": {
"type": "string"
},
"sku": {
"type": "string",
"defaultValue": "B1"
}
},
"resources": {
"appPlan": {
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2020-06-01",
"name": "[format('{0}appPlan', parameters('namePrefix'))]",
"location": "[resourceGroup().location]",
"kind": "linux",
"sku": {
"name": "[parameters('sku')]"
},
"properties": {
"reserved": true
}
}
},
"outputs": {
"planId": {
"type": "string",
"value": "[resourceId('Microsoft.Web/serverfarms', format('{0}appPlan', parameters('namePrefix')))]"
}
}
}
},
"dependsOn": [
"rg"
]
},
"siteDeploy": {
"copy": {
"name": "siteDeploy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ module appPlanDeploy2 'br/mock-registry-one:demo/plan:v2' = {
}
}

module appPlanDeploy3 'br/mock-registry-emulated:plan:v2' = {
//@[07:21) Module appPlanDeploy3. Type: module. Declaration start char: 0, length: 137
name: 'planDeploy3'
scope: rg
params: {
namePrefix: 'hello'
}
}

var websites = [
//@[04:12) Variable websites. Type: [object, object]. Declaration start char: 0, length: 110
{
Expand Down Expand Up @@ -152,3 +161,4 @@ module ipv6port 'br:[::1]:5000/passthrough/ipv6port:v1' = {
ipv6port: 'test'
}
}

Loading
Loading