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

chore: Integration Account - Provide script to upload schemas. #178

Merged

Conversation

mbraekman
Copy link
Contributor

This PR closes #160

In order to align with other scripts, the following parameters mentioned in the issue have been renamed:

  • IntegrationAccountName --> Name
  • IntegrationAccountResourceGroup --> ResourceGroup

The following parameters have been added:

  • SchemaFilePath: allows upserting a single schema
  • RemoveFileExtensions: switch indicating whether to remove the file extension.

Module:
A new module has been created for this: Arcus.Scripting.IntegrationAccount.
As this will be extended by all other scripts required for the open issues on this topic.

Documentation:
A new page (Integration Account) has been added in the preview folder + update on the index.md to refer to the new page.

Once this PR has been reviewed/approved the other issues will be taken care of and set up similar to this.

@mbraekman mbraekman requested a review from stijnmoreels as a code owner June 8, 2021 13:17
@stijnmoreels stijnmoreels self-assigned this Jun 9, 2021
@stijnmoreels
Copy link
Member

The .psd1 file should have not this as ModuleVersion:

# Version number of this module.
ModuleVersion = '0.1'

But:

# Version number of this module.
ModuleVersion = '#{Package.Version}#'

Copy link
Member

@stijnmoreels stijnmoreels left a comment

Choose a reason for hiding this comment

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

Maybe some unit tests can test those special-case guards for the SchemaFilePath and the SchemasFolder, and possible other guards.
But otherwise, awesome!

}
else {
if ($SchemasFolder -ne '' -and $SchemaFilePath -eq '') {
foreach ($schema in Get-ChildItem("$schemasFolder") -File) {
Copy link
Member

Choose a reason for hiding this comment

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

Just curious. Placing the string folder into another string, is this some extra-guard for string formatting or some kind?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, more because I made a mistake here. Tested this with a hard-coded value first but didn't replace the quotes surrounding the hard-coded value 😅

Import-Module Az.KeyVault
Import-Module -Name $PSScriptRoot\..\Arcus.Scripting.IntegrationAccount -ErrorAction Stop

InModuleScope Arcus.Scripting.IntegrationAccount {
Copy link
Member

Choose a reason for hiding this comment

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

SO GREAT! Directly integration tests from the start. Great. 👍
I was working on a separate script so we can re-use some of these Azure connecting functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, we can perhaps refactor this is the same branch where you're creating the reusable connectivity scripts.
If that's okay with you of course.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, of course! Let me know if you have time here, but I can do a follow-up PR too.

@mbraekman
Copy link
Contributor Author

The .psd1 file should have not this as ModuleVersion:

# Version number of this module.
ModuleVersion = '0.1'

But:

# Version number of this module.
ModuleVersion = '#{Package.Version}#'

Woops, missed that one 😅

@stijnmoreels
Copy link
Member

The .psd1 file should have not this as ModuleVersion:

# Version number of this module.
ModuleVersion = '0.1'

But:

# Version number of this module.
ModuleVersion = '#{Package.Version}#'

Woops, missed that one 😅

😄 I also change this locally to test it locally. I'll have a look in the future if we can maybe change this a bit so it's easier to test locally.

@mbraekman mbraekman requested a review from stijnmoreels July 15, 2021 06:04
@mbraekman
Copy link
Contributor Author

@stijnmoreels : I've added some unit tests, if you would so kind to review this, please?
Just to make sure I didn't make any stupid mistakes 😅
Thanks.

Copy link
Member

@stijnmoreels stijnmoreels left a comment

Choose a reason for hiding this comment

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

LGTM! Nice, clean but thorough tests. 💯

@mbraekman mbraekman merged commit d78e7b1 into arcus-azure:master Jul 19, 2021
@mbraekman mbraekman deleted the feature/integration-account-schemas branch July 19, 2021 06:38
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.

Provide script to upload schemas into an Integration Account
2 participants