Skip to content

Follow-up fixes to RunAsExisting flow#7494

Merged
davidfowl merged 3 commits intomainfrom
safia/run-as-existing-fix
Feb 9, 2025
Merged

Follow-up fixes to RunAsExisting flow#7494
davidfowl merged 3 commits intomainfrom
safia/run-as-existing-fix

Conversation

@captainsafia
Copy link
Copy Markdown
Contributor

  • Inline Tags configuration for key vault
  • Set resource scope in user-secrets config
  • Remove fallback to default user group if existing resource group was not found
  • Fix resolution of resource group name from parameter resource

Comment thread src/Aspire.Hosting.Azure/Provisioning/Provisioners/BicepProvisioner.cs Outdated
…ioner.cs

Co-authored-by: David Fowler <davidfowl@gmail.com>
{
var existingResourceGroupName = existingResourceGroup is ParameterResource parameterResource
? parameterResource.Name
? parameterResource.Value
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I knew it was doing this from the error I was getting

? parameterResource.Value
: (string)existingResourceGroup;
resourceGroup = await context.GetResourceGroup(existingResourceGroupName, resourceLogger, cancellationToken).ConfigureAwait(false);
resourceGroup = await context.Subscription.GetResourceGroupAsync(existingResourceGroupName, cancellationToken).ConfigureAwait(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this handle if the resource group doesn't exist?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Depends on what you mean by handle. Before it would fallback to the default group. Now, it'll fail and you'll see something like this in the logs:

Provisioning sbemulator...
 Error provisioning sbemulator.
Azure.RequestFailedException: Resource group 'rg-aspire-deploy-not-real' could not be found.
Status: 404 (Not Found)
ErrorCode: ResourceGroupNotFound

Content:
{"error":{"code":"ResourceGroupNotFound","message":"Resource group 'rg-aspire-deploy-not-real' could not be found."}}

@davidfowl davidfowl merged commit dbf5137 into main Feb 9, 2025
@davidfowl davidfowl deleted the safia/run-as-existing-fix branch February 9, 2025 21:41
@github-actions github-actions Bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 10, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants