azure-dev icon indicating copy to clipboard operation
azure-dev copied to clipboard

[Issue] azure sql not printed during `azd provision`

Open jongio opened this issue 3 years ago • 2 comments

Run azd up -t todo-csharp-sql or any template that uses Azure SQL

You'll see this: image

Azure SQL isn't in the list when it should be.

jongio avatar Oct 10 '22 23:10 jongio

The mapping from RP types to friendly names is here:

https://github.com/Azure/azure-dev/blob/e5acbfe8bcfe001abbbf9457e5d660dc1a727132/cli/azd/pkg/infra/azure_resource_types.go#L31-L63

If we don't return a value from this function, we don't display something in the output:

https://github.com/Azure/azure-dev/blob/e5acbfe8bcfe001abbbf9457e5d660dc1a727132/cli/azd/pkg/infra/provisioning/provisioning_progress_display.go#L117-L118

ellismg avatar Oct 11 '22 22:10 ellismg

Can we switch this to parse the enum so it can be dynamic and future proof?

ie. When we get AzureResourceTypeStaticWebSite we print Static Web Site.

  1. Remove "AzureResourceType"
  2. Take the rest and split on upper case letters and add a space between them.

We never know what future RP will be there and we don't want to have to do a CLI release to support any unknowns.

jongio avatar Oct 13 '22 03:10 jongio

@jongio The enum itself is a static list, so it still won't be future proof. I had omitted SQL when it was originally defined in the enum list because it wasn't used anywhere. In hindsight, I should have just mapped the translation.

To address the current issue, we should just map the translation for now, by adding an entry to GetResourceTypeDisplayName @hemarina, because doing the dynamic translation for all RP types is a lot more complicated, and I still haven't found a good way of doing so. See #180

weikanglim avatar Nov 09 '22 21:11 weikanglim

Can we do a bulk manual add for now that includes all resources?

jongio avatar Nov 10 '22 18:11 jongio

@vhvb1989 can you also fix this as part of #1186

rajeshkamal5050 avatar Jan 05 '23 16:01 rajeshkamal5050