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

Port ARM snippets to bicep - part 2 #2207

Merged
merged 7 commits into from
Apr 14, 2021
Merged

Conversation

bhsubra
Copy link
Contributor

@bhsubra bhsubra commented Apr 11, 2021

Port arm snippets - part 2

@bhsubra bhsubra changed the title Part ARM snippets to bicep - part 2 Port ARM snippets to bicep - part 2 Apr 12, 2021
@MarcusFelling
Copy link
Collaborator

@anthony-c-martin @majastrz mind reviewing? Hoping to get this merged before publishing a contribution guide.

@anthony-c-martin
Copy link
Member

anthony-c-martin commented Apr 12, 2021

I noticed a bug in requesting completions for the snippets - following is the repro. I was testing this with the res-keyvault-secret snippet but I suspect it applies to all of them:

  1. Type res-kse. Instead of accepting the completion, press Esc to cancel the dialog.
  2. Request completions again with Ctrl+Space. res-keyvault-secret is offered as an option.
  3. Select res-keyvault-secret. The snippet is inserted, but the output is malformed:
    res-resource keyVault_keyVaultSecret 'Microsoft.KeyVault/vaults/secrets@2016-10-01' = {
      name: 'keyVault/keyVaultSecret'
      properties: {
        value: 'secretValue'
      }
    }

EDIT: I'll raise a bug for this, as I think it's unrelated to this set of changes.

@@ -0,0 +1,10 @@
// Log Analytics Workspace
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2015-11-01-preview' = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The symbolic name here is fixed, but it feels like customers will most likely want to change this. Should we offer a placeholder on the symbolic name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One challenge here is that it will make the authoring of the snippet bicep file harder because we'll get a parse error. However, my understanding was that we were going to have some sort of convention-based replacement. I see that the names of name placeholders do match the symbolic names, but I guess the logic to turn symbolic names into placeholders isn't there yet? @bhsubra?


In reply to: 611932375 [](ancestors = 611932375)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@majastrz , do you mean named placeholder for name E.g: ${name: logAnalyticsWorkspace}? We currently don't have that support, but I can try to add some logic to support the same.

Copy link
Contributor Author

@bhsubra bhsubra Apr 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to make this change in a follow up PR. Let me know if you have any concerns.

@bhsubra bhsubra force-pushed the dev/bhsubra/PortArmSnippets_Part2 branch from 7372ba7 to 7a6d8ca Compare April 13, 2021 20:56
Copy link
Member

@anthony-c-martin anthony-c-martin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome! Thanks for doing this!

@bhsubra bhsubra merged commit 10a7ae5 into main Apr 14, 2021
@bhsubra bhsubra deleted the dev/bhsubra/PortArmSnippets_Part2 branch April 14, 2021 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants