sparse-intern-71089
02/08/2021, 10:06 PMtall-librarian-49374
02/08/2021, 10:10 PMtall-needle-56640
02/08/2021, 10:12 PMResourceGroup.Get()
?tall-needle-56640
02/08/2021, 10:16 PMnew ResourceGroup
and ResourceGroup.Get()
return the type ResourceGroup
, but GetResourceGroup
returns the type Output<ResourceGroupResult>
? Specifically, why does the latter have to be of type Output
?tall-needle-56640
02/08/2021, 10:19 PMOutput
screws that all up.tall-librarian-49374
02/09/2021, 7:11 AMtall-needle-56640
02/09/2021, 5:08 PMname
parameter represents a logical name. I guess I should have thought of that.
Can you comment on the differences in return types?tall-librarian-49374
02/09/2021, 5:35 PMGetResourceGroup
is an invoke, so it returns a Task as all other invokes.tall-needle-56640
02/09/2021, 5:48 PMGetResourceGroup
specifically, it just seems that if I can create a resource group and be returned a non-Output
type, why would I not be able to get a resource that is returned as a non-Output
type? Either way, an async operation occurred in the background, right? Having a way to get the same type back makes it easier to code for either situation.tall-librarian-49374
02/09/2021, 5:50 PMResourceGroup.Get()
does, right?tall-librarian-49374
02/09/2021, 5:51 PMnew ResourceGroup(…)
does not run an async operation with Azure API immediately. It just defines the resource for the engine.tall-librarian-49374
02/09/2021, 5:51 PMGetResourceGroup
does run against Azure APItall-needle-56640
02/09/2021, 6:48 PMResourceGroup.Get()
does do that, but it also expects the user to know the resourceID. This code does exactly what I want. I get the resource I want in the type I want:
var resourceGroup = Output.Create(GetResourceGroup.InvokeAsync(new GetResourceGroupArgs { ResourceGroupName = resourceGroupName }));
var rg = ResourceGroup.Get("resourceGroup", resourceGroup.Apply(r => r.Id));
It's just bizarre that I have to jump through a hoop to get what I want, when it seems like this could be encapsulated with
public static ResourceGroup Get(string name, ResourceGroupArgs args)