Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create error when using a resource id/name when using symbolic name templates #14100

Open
Tracked by #14190
stephaniezyen opened this issue May 15, 2024 · 2 comments
Open
Tracked by #14190
Assignees

Comments

@stephaniezyen
Copy link
Contributor

stephaniezyen commented May 15, 2024

As discussed in #12906 , we should create an error when using ".name" or ".id in symbolic name templates when using the listAccountSAS function:

listAccountSAS(storageAccount.name, '2023-01-01', { ... })

Include a link to documentation on symbolic name templates

@anthony-c-martin
Copy link
Member

The following should be blocked with an error for symbolic name templates, because it will error during deployment:

listAccountSAS(storageAccount.name, '2023-01-01', { ... })

The following is still technically valid in symbolic name templates, but not optimal. Ideally it would just raise a warning, but could be an error if it's too complex to differentiate:

listAccountSAS(storageAccount.id, '2023-01-01', { ... })

@anthony-c-martin
Copy link
Member

Do we also want to update the error message to "Use a full resource ID..." instead of "Use a resource reference..." for clarity's sake?

@stephaniezyen to answer this question - the latter is correct - we are trying to recommend:

// here we're using a resource reference
storageAccount.listAccountSAS('2023-01-01', { ... })

Instead of:

// here we're using a resource id
listAccountSAS(storageAccount.id, '2023-01-01', { ... })

@stephaniezyen stephaniezyen changed the title Update warning -> error for functions like "listAccountSAS" Create error when using a resource id/name when using symbolic name templates May 15, 2024
@stephaniezyen stephaniezyen self-assigned this Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants