Here is the API I'm calling;
https://management.azure.com/subscriptions/< subscription >/providers/Microsoft.Compute/virtualMachines?api-version=2017-12-01
I've seen other pages and forums with a similar issue (such as Microsoft API), but not for Azure API.
Their code;
let
GetUserInfo = (Path)=>
let
Source = Json.Document(Web.Contents(Path)),
LL= @Source[value],
result = try @LL & @GetUserInfo(Source[#"@odata.nextLink"]) otherwise @LL
in
result,
Fullset = GetUserInfo("https://graph.microsoft.com/beta/users?$select=manager&$expand=manager"),
#"Converted to Table" = Table.FromList(Fullset, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "displayName", "manager"}, {"Column1.id", "Column1.displayName", "Column1.manager"}),
#"Expanded Column1.manager" = Table.ExpandRecordColumn(#"Expanded Column1", "Column1.manager", {"id", "displayName"}, {"id", "displayName"}),
#"Renamed Columns" = Table.RenameColumns(#"Expanded Column1.manager",{{"Column1.displayName", "Employee Full Name"}, {"Column1.id", "Employee Id"}, {"id", "Manager Id"}, {"displayName", "Manager Full name"}})
in
#"Renamed Columns"
Compared to the start of mine once I've connected the source by the simple web link;
let
Source = Json.Document(Web.Contents("https://management.azure.com/subscriptions/< subscription >/providers/Microsoft.Compute/virtualMachines?api-version=2017-12-01")),
#"Converted to Table" = Record.ToTable(Source)
in
#"Converted to Table"
If I were to adjust it, I think it should look something like this;
let
GetUserInfo = (Path)=>
let
Source = Json.Document(Web.Contents(Path)),
LL= @Source[value],
result = try @LL & @GetUserInfo(Source[#"@odata.nextLink"]) otherwise @LL
in
result,
Fullset = GetUserInfo("https://management.azure.com/subscriptions/< subscription >/providers/Microsoft.Compute/virtualMachines?api-version=2017-12-01"),
#"Converted to Table" = Record.ToTable(Source)
in
#"Converted to Table"
However, I am prompted with the following;
Expression.Error: The name 'Source' wasn't recognized. Make sure it's spelled correctly.
Thanks.