Azure-sdk-for-net: [FEATURE REQ] IDeployment.GetById should work with subscription level deployments

Created on 23 Jul 2020  路  2Comments  路  Source: Azure/azure-sdk-for-net

Library or service name.
Azure.FluentAPI.

What library or service is this request related to? ARM Deployments at Subscription Scope

Is your feature request related to a problem? Please describe.
I would like IAzure.Deployments.GetById() to work with a subscription level deployment, or for IAzure.Deployments.Inner.GetBy*() to return a richer output object.

Background

Today, I am able to do an ARM Deployment at Subscription Scope using the Fluent API with the sample referenced here #13609. This works great, however the resultant object from this operation returns very little info, even when waiting for the deployment to complete.

For instance, when deploying an ARM Template to a Resource Group with the Fluent API, I receive an IDeployment object which contains a member of DeploymentOperations which contains a List() of all of the operations, including their ARM Resource ID, Name, ResourceName and ResourceType.

However, when I do a Subscription Level deployment using the Fluent API like so:

var deployment = azure.Deployments.Inner.BeginCreateOrUpdateAtSubscriptionScopeAsync("subScriptionDeploy", deploymentParam).Result;

The resultant object from this operation is an DeploymentExtendedInner object which does not have a list of Resource Operations at all.

If I fall back to using the non-fluent ResourceManagementClient classe' BeginCreateOrUpdateAtSubscriptionScopeAsync() method, which does the same operation but returns a DeploymentExtended object with a richer list of created or touched resources under Properties.OutputResources.

#### Environment:

Microsoft.Azure.Management.ResourceManager bv3.7.3-preview
Azure App Service
Visual Studio 2019

ARM Mgmt customer-reported needs-team-attention question

Most helpful comment

azure.Deployments.Inner.BeginCreateOrUpdateAtSubscriptionScopeAsync and ResourceManagementClient.BeginCreateOrUpdateAtSubscriptionScopeAsync are exactly same method (only come from different chain of references). And hence the API referred from Inner is actually not Fluent API.

And hence you would have to stick with the non-Fluent API for deployment operations as well.

IPage<DeploymentOperationInner> operations = azure.Deployments.Manager.Inner.DeploymentOperations.ListAtSubscriptionScopeAsync("dpA").Result;

All 2 comments

azure.Deployments.Inner.BeginCreateOrUpdateAtSubscriptionScopeAsync and ResourceManagementClient.BeginCreateOrUpdateAtSubscriptionScopeAsync are exactly same method (only come from different chain of references). And hence the API referred from Inner is actually not Fluent API.

And hence you would have to stick with the non-Fluent API for deployment operations as well.

IPage<DeploymentOperationInner> operations = azure.Deployments.Manager.Inner.DeploymentOperations.ListAtSubscriptionScopeAsync("dpA").Result;

Thanks Wei, that was very quick!

Was this page helpful?
0 / 5 - 0 ratings