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

Added deployment().properties.template.contentVersion property #5727

Conversation

slapointe
Copy link
Contributor

  • Added deployment().properties.template.contentVersion property to AzNamespaceType class
  • Added integration test to cover valid usage

Fixes #3114

Contributing a feature

  • I have opened a new issue for the proposal, or commented on an existing one, and ensured that the Bicep maintainers are good with the design of the feature being implemented
  • I have included "Fixes #{issue_number}" in the PR description, so GitHub can link to the issue and close it when the PR is merged
  • I have appropriate test coverage of my new feature

@slapointe
Copy link
Contributor Author

The 4 errors come from: Unhandled exception. Azure.Identity.CredentialUnavailableException: The ChainedTokenCredential failed to retrieve a token from the included credentials.

@@ -177,6 +177,10 @@ private static ObjectType GetDeploymentReturnType(ResourceScope targetScope)
new TypeProperty("name", LanguageConstants.String),
new TypeProperty("properties", new ObjectType("properties", TypeSymbolValidationFlags.Default, new []
{
new TypeProperty("template", new ObjectType("properties", TypeSymbolValidationFlags.Default, new []
Copy link
Collaborator

Choose a reason for hiding this comment

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

Although for templateLink is this same case, I think it would be better if object name in ObjecType constructor matched the property name.

Copy link
Member

Choose a reason for hiding this comment

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

Good point! We could rename this one "properties" -> "TemplateProperties", and the other (line 184) "properties" -> "TemplateLinkProperties". @slapointe would you mind fixing both?

Copy link
Collaborator

Choose a reason for hiding this comment

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

just keep the camelCase style: templateProperties, templateLinkProperties 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it.

There are a few occurences elsewhere in the same file like that. Do you want me to fix them all?

private static ObjectType GetEnvironmentReturnType()
        {
            return new ObjectType("environment", TypeSymbolValidationFlags.Default, new[]
            {
                new TypeProperty("activeDirectoryDataLake", LanguageConstants.String),
                new TypeProperty("authentication", new ObjectType("authentication", TypeSymbolValidationFlags.Default, new []
                {
                    new TypeProperty("audiences", new TypedArrayType(LanguageConstants.String, TypeSymbolValidationFlags.Default)),
                    new TypeProperty("identityProvider", LanguageConstants.String),
                    new TypeProperty("loginEndpoint", LanguageConstants.String),
                    new TypeProperty("tenant", LanguageConstants.String),
                }, null)),
                new TypeProperty("batch", LanguageConstants.String),
                new TypeProperty("gallery", LanguageConstants.String),
                new TypeProperty("graph", LanguageConstants.String),
                new TypeProperty("graphAudience", LanguageConstants.String),
                new TypeProperty("media", LanguageConstants.String),
                new TypeProperty("name", LanguageConstants.String),
                new TypeProperty("portal", LanguageConstants.String),
                new TypeProperty("resourceManager", LanguageConstants.String),
                new TypeProperty("sqlManagement", LanguageConstants.String),
                new TypeProperty("suffixes", new ObjectType("suffixes", TypeSymbolValidationFlags.Default, new []
                {
                    new TypeProperty("acrLoginServer", LanguageConstants.String),
                    new TypeProperty("azureDatalakeAnalyticsCatalogAndJob", LanguageConstants.String),
                    new TypeProperty("azureDatalakeStoreFileSystem", LanguageConstants.String),
                    new TypeProperty("azureFrontDoorEndpointSuffix", LanguageConstants.String),
                    new TypeProperty("keyvaultDns", LanguageConstants.String),
                    new TypeProperty("sqlServerHostname", LanguageConstants.String),
                    new TypeProperty("storage", LanguageConstants.String),
                }, null)),
                new TypeProperty("vmImageAliasDoc", LanguageConstants.String),
            }, null);
        }

In this example suffixes & authentication in GetEnvironmentReturnType

Copy link
Member

Choose a reason for hiding this comment

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

That would be great!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, let me know if that's good with you.

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 great! Just had one minor comment that would be good to fix up

Copy link
Collaborator

@miqm miqm left a comment

Choose a reason for hiding this comment

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

looks good to me!

@slapointe slapointe force-pushed the feature/deployment-properties-template-contentversion-property branch from c35f3ff to 7caef0c Compare February 2, 2022 13:37
@slapointe
Copy link
Contributor Author

I merged changes of @miqm that were conflicting with mine

@miqm
Copy link
Collaborator

miqm commented Feb 2, 2022

I merged changes of @miqm that were conflicting with mine

image

@anthony-c-martin
Copy link
Member

Looks great!

@anthony-c-martin anthony-c-martin merged commit d4063da into Azure:main Feb 3, 2022
@slapointe slapointe deleted the feature/deployment-properties-template-contentversion-property branch February 3, 2022 15:33
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.

deployment().properties doesn't contain template.contentVersion
3 participants