dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.93k stars 480 forks source link

AddDaprStateStore with dash renders invalid bicep #6776

Open jedjohan opened 1 day ago

jedjohan commented 1 day ago

Is there an existing issue for this?

Describe the bug

Using dash in AddDaprStateStore name renders invalid symbolic name in bicep

Expected Behavior

It would be nice if AddDaprStateStore warned when using dashes in name, or if the azd up errors could be more descriptive

Steps To Reproduce

  1. create new aspire project
  2. add dapr statestore in AppHost Program.cs: builder.AddDaprStateStore("azure-cosmosdb-statestore", new DaprComponentOptions { LocalPath = "dapr-config/cosmos-statestore.yaml" });
  3. run 'azd up'

Exceptions (if any)

Packaging services (azd package)

Provisioning Azure resources (azd provision)
Provisioning Azure resources can take some time.

ERROR: error executing step command 'provision': initializing provisioning manager: failed to compile bicep template: failed running bicep build: exit code: 1, stdout: , stderr: C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\main.bicep(26,18) : Error BCP104: The referenced module has errors.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(84,15) : Error BCP068: Expected a resource type string. Specify a valid resource type of format "<types>@<apiVersion>".
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(84,15) : Error BCP029: The resource type is not valid. Specify a valid resource type of format "<types>@<apiVersion>".
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(84,101) : Error BCP018: Expected the "=" character at this location.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(85,3) : Error BCP007: This declaration type is not recognized. Specify a metadata, parameter, variable, resource, or output declaration.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(86,3) : Error BCP007: This declaration type is not recognized. Specify a metadata, parameter, variable, resource, or output declaration.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(87,3) : Error BCP007: This declaration type is not recognized. Specify a metadata, parameter, variable, resource, or output declaration.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(88,5) : Error BCP007: This declaration type is not recognized. Specify a metadata, parameter, variable, resource, or output declaration.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(89,5) : Error BCP007: This declaration type is not recognized. Specify a metadata, parameter, variable, resource, or output declaration.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(90,13) : Error BCP266: Expected a metadata identifier at this location.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(90,16) : Error BCP018: Expected the "=" character at this location.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(92,7) : Error BCP007: This declaration type is not recognized. Specify a metadata, parameter, variable, resource, or output declaration.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(93,9) : Error BCP007: This declaration type is not recognized. Specify a metadata, parameter, variable, resource, or output declaration.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(95,9) : Error BCP007: This declaration type is not recognized. Specify a metadata, parameter, variable, resource, or output declaration.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(96,1) : Error BCP007: This declaration type is not recognized. Specify a metadata, parameter, variable, resource, or output declaration.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(98,7) : Error BCP007: This declaration type is not recognized. Specify a metadata, parameter, variable, resource, or output declaration.
C:\Users\jedjo\AppData\Local\Temp\azd-infra261069995\resources.bicep(99,9) : Error BCP007: This declaration type is not recognized. Specify a metadata, parameter, variable, resource, or output declaration.

.NET Version info

.NET SDK:
 Version:           9.0.100
 Commit:            59db016f11
 Workload version:  9.0.100-manifests.3068a692
 MSBuild version:   17.12.7+5b8665660

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26100
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.100\

.NET workloads installed:
 [android]
   Installation Source: SDK 9.0.100, VS 17.13.35507.96
   Manifest Version:    35.0.0-rc.2.152/9.0.100-rc.2
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100-rc.2\microsoft.net.sdk.android\35.0.0-rc.2.152\WorkloadManifest.json
   Install Type:              Msi

 [aspire]
   Installation Source: SDK 9.0.100, VS 17.13.35507.96
   Manifest Version:    8.2.2/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
   Install Type:              Msi

 [ios]
   Installation Source: SDK 9.0.100, VS 17.13.35507.96
   Manifest Version:    18.0.9600-net9-rc2/9.0.100-rc.2
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100-rc.2\microsoft.net.sdk.ios\18.0.9600-net9-rc2\WorkloadManifest.json
   Install Type:              Msi

 [maccatalyst]
   Installation Source: SDK 9.0.100, VS 17.13.35507.96
   Manifest Version:    18.0.9600-net9-rc2/9.0.100-rc.2
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100-rc.2\microsoft.net.sdk.maccatalyst\18.0.9600-net9-rc2\WorkloadManifest.json
   Install Type:              Msi

 [maui-windows]
   Installation Source: SDK 9.0.100, VS 17.13.35507.96
   Manifest Version:    9.0.0-rc.2.24503.2/9.0.100-rc.2
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100-rc.2\microsoft.net.sdk.maui\9.0.0-rc.2.24503.2\WorkloadManifest.json
   Install Type:              Msi

Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.0
  Architecture: x64
  Commit:       9d5a6a9aa4

.NET SDKs installed:
  8.0.307 [C:\Program Files\dotnet\sdk]
  8.0.404 [C:\Program Files\dotnet\sdk]
  9.0.100-rc.2.24474.11 [C:\Program Files\dotnet\sdk]
  9.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0-rc.2.24474.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0-rc.2.24473.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.35 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.0-rc.2.24474.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Anything else?

No response

davidfowl commented 8 hours ago

Can you file this https://github.com/Azure/azure-dev/issues