aspire icon indicating copy to clipboard operation
aspire copied to clipboard

Getting 'DotNet Component operations are not allowed for the subscription' when trying to deploy Preview 7 aspire-starter app to Azure

Open geokaps opened this issue 1 year ago • 2 comments

Description of the problem

  1. Using Aspire Preview 7 (Version="8.0.0-preview.7.24251.11), create a fresh new aspire sample app using dotnet new aspire-starter -n AspireStarter7
  2. Run it locally from the Aspire7.AppHost directory using dotnet run - Everything works normally.
  3. I'm using the latest version of azd at the time of this writing:
azd version 1.9.1 (commit aadbc26943c2e3e5437a6ffa528fe5264887a10c)
  1. From top-level solution directory Initialize the solution for Azure deployment using azd init -e aspire7
  2. Deploy the app using azd up

azd proceeds to try and deploy the starter app to my subscription (it's my personal Visual Studio Professional subscription) but the deployment fails:

(✓) Done: Resource group: rg-aspire7 (✓) Done: Container Registry: acrsk5cqekgs53si (✓) Done: Log Analytics workspace: law-sk5cqekgs53si (✓) Done: Container Apps Environment: cae-sk5cqekgs53si |===== | Creating/Updating resources

ERROR: error executing step command 'provision': deployment failed: error deploying infrastructure: deploying to subscription:

Deployment Error Details:
DotNetComponentsNotAllowedForSubscription: DotNet Component operations are not allowed for the subscription: '85e37ecf-bc9c-4aff-xxx-xxxxxxx'.  (<-- redacted)

TraceID: f3993b2f5d00ad24dfee4e792xxxxxx

Analysis

  1. I checked and double-checked my Azure Subscription to verify that the Microsoft.App resource provider is registered with the subscription. The Microsoft.App resource provider contains the Microsoft.App/managedEnvironments/dotNetComponents@2024-02-02-preview resource that azd up is looking for. I have tried to deploy the starter-app on multiple subscriptions and they all fail with this error.

  2. Using azd infra synth to generate the local bicep files, I can see in /infra/resources.bicep that the Aspire Dashboard is the resource that is causing the failure:

  resource aspireDashboard 'dotNetComponents' = {
    name: 'aspire-dashboard'
    properties: {
      componentType: 'AspireDashboard'
    }
  }
}
  1. If I comment out the aspireDashboard resource above in the resource.bicep file, the deployment will succeed.

  2. Any idea what is going on here? Thank you.

geokaps avatar May 16 '24 17:05 geokaps

I am pretty sure this is due to the dashboard feature not being fully rolled out to all regions/users just yet on ACA. Sound right @rajeshkamal5050

timheuer avatar May 16 '24 19:05 timheuer

Interesting observation @timheuer. Regarding the regions, I've tried deploying to both "East US" and "East US 2" with no luck. When I lookup the Resource Provider Details in my subscription for managedEnvironments/dotNetComponents, these 2 regions are included in the list of locations:

{
  "resourceType": "managedEnvironments/dotNetComponents",
  "locations": [
    "West US 2",
    "Southeast Asia",
    "Sweden Central",
    "Canada Central",
    "West Europe",
    "North Europe",
    "East US",
    "East US 2",
    "East Asia",
    "Australia East",
    "Germany West Central",
    "Japan East",
    "UK South",
    "West US",
    "Central US",
    "North Central US",
    "South Central US",
    "Korea Central",
    "Brazil South",
    "West US 3",
    "France Central",
    "South Africa North",
    "Norway East",
    "Switzerland North",
    "UAE North",
    "Canada East",
    "West Central US",
    "UK West",
    "Central India",
    "Italy North",
    "Poland Central"
  ],
  "apiVersions": [
    "2024-02-02-preview",
    "2023-11-02-preview"
  ],
  "defaultApiVersion": "2023-11-02-preview",
  "capabilities": "None"
}

I see that it specifies "capabilities": "None", but I'm not sure if that is relevant or what the purpose of that property is?

geokaps avatar May 16 '24 19:05 geokaps

Specifically it's this one that I think is causing the issue:

componentType: 'AspireDashboard'

that's the one that is not fully rolled out to public regions.

timheuer avatar May 16 '24 21:05 timheuer

Ah ok, now I think I understand @timheuer . I was following the docs at https://learn.microsoft.com/en-us/dotnet/aspire/deployment/azure/aca-deployment?tabs=visual-studio#deploy-the-net-aspire-dashboard and enabled deploying of the aspire dashboard alpha feature by doing

azd config set alpha.aspire.dashboard on

I know we are still in preview, but I thought that since this was in the docs, the feature would be available on Azure. When I turn the feature flag off (or comment out the resource in the bicep file), I can now deploy the sample, but without the dashboard :(

geokaps avatar May 16 '24 22:05 geokaps

@kvenkatrajan / @bradygaster I think it isn't fully rolled out yet right?

timheuer avatar May 16 '24 23:05 timheuer

That is correct. Rollout is in progress. We will keep this thread updated when its ready to use.

kvenkatrajan avatar May 17 '24 12:05 kvenkatrajan

@kvenkatrajan I think this is ready to go now right?

DamianEdwards avatar May 21 '24 21:05 DamianEdwards

Yes that's correct. @geokaps please feel free to test and report incase of any issues.

kvenkatrajan avatar May 21 '24 21:05 kvenkatrajan

I can confirm that I'm able to deploy the v8 GA aspire-starter sample along with the dashboard to the East-US region and all is well.

Congratulations to the entire .Net Aspire team and community! Well done!

geokaps avatar May 23 '24 19:05 geokaps