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

Support provisioning azure resources for dev #8

Merged
merged 5 commits into from
Oct 2, 2023

Conversation

davidfowl
Copy link
Member

  • Use the Azure management SDK to spin up resources for various app model components.
  • Added azure resources that we have components for i.e. ServiceBus, KeyVault and Storage (queues, blobs and tables)
  • If the azure subscription isn't specific in config provisioning will log a warning and skip. This means the app won't change.
  • Also preserved passing connection information to the dev host via configuration also still works (this was preserved)

Most of this logic was reverse engineered from various samples and many bicep files in a playground. This makes playing with azure resources much easier.

PS: There is no tear down of the resources when the app closes.

@karolz-ms I'd like to figure out a way to represent "external resources" in dcp (components that exist but are managed externally).

- Use the Azure management SDK to spin up resources for various app model components.
- Added azure resources that we have components for i.e. ServiceBus, KeyVault and Storage (queues, blobs and tables)
- If the azure subscription isn't specific in config provisoning will log a warning and skip. This means the app won't change.
- Also preserved passing connection information to the dev host via configuration also still works (this was preserved)
@davidfowl
Copy link
Member Author

davidfowl commented Oct 1, 2023

How do we get things added to the feed? Azure.ResourceManager.Authorization is missing? Queued a job to mirror this package

@mitchdenny
Copy link
Member

More of a general comment about the API approach here. I wonder whether it might be better to do something like this:

var builder = DistributedApplication.CreateBuilder(args);
var provisioner = builder.AddAzureProvisioner(sub, rg, location);

var storage = provisioner.AddAzureStorage(name);
// or
var storage = builder.AddAzureStorage(name, provisioner); // provisioner would be an optional argument

The idea is that it allows the developer some control over which subscription and RG is used for a specific resource. We probably also want the ability to supply a Bicep fragment and pass in properties to that.

@davidfowl
Copy link
Member Author

I think we should allow overrides on the component AddX methods to override the resource group that is used.

Can they be successful using the provisioner at all? Why not have them not use it and get already provisioned resources?

@davidfowl
Copy link
Member Author

davidfowl commented Oct 2, 2023

The idea is that it allows the developer some control over which subscription and RG is used for a specific resource. We probably also want the ability to supply a Bicep fragment and pass in properties to that.

if we get this feedback from more people as they use it. I think we should make sub, region and location(s) to be required config and we can see what problems arise from there.

We can design more API if we need to.

FWIW: I prefer this one:

var builder = DistributedApplication.CreateBuilder(args);
var provisioner = builder.AddAzureProvisioner(sub, rg, location);

var storage = provisioner.AddAzureStorage(name);

- Make the subscription, and location/region optional.
@davidfowl davidfowl merged commit a3dac0c into main Oct 2, 2023
@davidfowl davidfowl deleted the davidfowl/azure-with-provisioning branch October 2, 2023 04:15
@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants