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

initial checkin for Azure.Provisioning.CloudMachine (work in progress) #46077

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

christothes
Copy link
Member

Contributing to the Azure SDK

Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.

For specific information about pull request etiquette and best practices, see this section.

@christothes
Copy link
Member Author

/azp run net - provisioning

Copy link

Azure Pipelines failed to run 1 pipeline(s).

@KrzysztofCwalina
Copy link
Member

/azp run net - provisioning

Copy link

Azure Pipelines failed to run 1 pipeline(s).

Copy link
Member

@tg-msft tg-msft 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!

/// <summary>
/// The common principalId parameter.
/// </summary>
public BicepParameter PrincipalIdParameter => new BicepParameter("principalId", typeof(string));
Copy link
Member

Choose a reason for hiding this comment

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

Why are these public while everything else is private? Just a point in time thing or ...?


public CloudMachineInfrastructure(string? name = "cm") : base(name!)
{
_name = name ?? "cm";
Copy link
Member

Choose a reason for hiding this comment

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

It feels a little weird to make it nullable but give it a default but then add an explicit override here. I think this would be cleaner with a non-nullable param that defaults to "cm".

{
_name = name ?? "cm";
_identity = new($"{_name}_identity");
var managedServiceIdentity = new ManagedServiceIdentity
Copy link
Member

Choose a reason for hiding this comment

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

Style nit - most of this file is doing Foo f = new() rather than var f = new Foo().

var managedServiceIdentity = new ManagedServiceIdentity
{
ManagedServiceIdentityType = ManagedServiceIdentityType.UserAssigned,
UserAssignedIdentities = { { BicepFunction.Interpolate($"{_identity!.Id}").Compile().ToString(), new UserAssignedIdentityDetails() } }
Copy link
Member

Choose a reason for hiding this comment

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

Do you need the ! in _identity! after instantiating it above?

_serviceBusTopic_main = new($"{_name}_sb_topic_main", "2021-11-01")
{
Parent = _serviceBusNamespace,
// Name = "default",
Copy link
Member

Choose a reason for hiding this comment

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

Why is this commented out? I don't know if I'm aware of whatever's blocking this.

Add(_storage.AssignRole(StorageBuiltInRole.StorageBlobDataContributor, RoleManagementPrincipalType.User, PrincipalIdParameter));
Add(_storage.AssignRole(StorageBuiltInRole.StorageTableDataContributor, RoleManagementPrincipalType.User, PrincipalIdParameter));
Add(_container);
Add(_blobs);
Copy link
Member

Choose a reason for hiding this comment

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

It might be better to parent this to the storage account here to prepare for when things open up.

Add(_eventGridTopic_Blobs);

// Placeholders for now.
Add(new BicepOutput($"storage_name", typeof(string)) { Value = _storage.Name });
Copy link
Member

Choose a reason for hiding this comment

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

Do you want the name or the primary endpoint like _storage.PrimaryEndpoints.Value!.BlobUri?

@@ -11,6 +11,7 @@ trigger:
- sdk/provisioning/ci.data.yml
- sdk/provisioning/Azure.Provisioning
- sdk/provisioning/Azure.Provisioning.AppConfiguration
- sdk/provisioning/Azure.Provisioning.CloudMachine
Copy link
Member

Choose a reason for hiding this comment

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

Can you do me a favor and move this into ci.compute.yml instead? I'm trying to keep the pipelines balanced because I'm worried about blowing out azdo again with how big this one is getting.

Copy link
Member

Choose a reason for hiding this comment

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

(Or consider adding your own release pipeline since I don't think this will be going out with everything else.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants