Aspire deployment without containers (only Azure Services) #16370
Replies: 1 comment
-
|
Hi @jprimke-AXAP, This is a known limitation. The There is no built-in way to skip ACR provisioning today. However, there are a few paths forward: Option 1 - Use You can intercept and modify the generated infrastructure to strip out the container registry and role assignment: builder.AddAzureAppServiceEnvironment("app-service-env")
.ConfigureInfrastructure(infra =>
{
// Remove ACR and its role assignment from the generated resources
var acr = infra.GetProvisionableResources()
.OfType<ContainerRegistry>()
.FirstOrDefault();
if (acr is not null)
infra.Remove(acr);
var roleAssignments = infra.GetProvisionableResources()
.OfType<RoleAssignment>()
.Where(r => r.RoleDefinitionId.Value?.Contains("7f951dda") == true); // AcrPull GUID
foreach (var ra in roleAssignments)
infra.Remove(ra);
});This is not guaranteed to work cleanly depending on your Aspire version, as removing the ACR may break other generated outputs that reference it. Option 2 - Pre-provision ACR manually and use Have your admin pre-create an ACR with the builder.AddAzureAppServiceEnvironment("app-service-env")
.WithImageRegistry("yourregistry.azurecr.io");Your deployment identity only needs Option 3 - Run Run As for future plans: the ability to deploy containerized .NET projects without ACR (e.g. by using deployment slots or direct zip deploy on App Service) is not on the public roadmap as far as I know, but this is worth raising as a feature request with the label |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
Our company does not allow the use of containers on Azure. When I try to use “AddAzureAppServiceEnvironment,” it still attempts to create a container registry and grant the ‘ACR_PULL’ permission to the associated managed identity. This is not permitted for the “Contributor” role.
Are there any plans to change this in the future?
Thank you very much for your support.
Best regards,
Joerg
Beta Was this translation helpful? Give feedback.
All reactions