Click here to try the live example, may take a bit, due to a cold start.
Once you deploy to Azure, you want to grab the Url
for the PowerShell Azure Function you created, it looks like this https://powershell-azure-function-return-excel-file546f.azurewebsites.net/api/powershell-azure-function-return-excel-file
. Follow these few steps to grab it.
Click on the links/buttons pointed to by the red arrows to get the Function Url
.
Now that you have the Url
, you can paste it into a browser to download the workbook.
Click here to get the one I generated, may take a bit, due to a cold start.
Or use the PowerShell Invoke-RestMethod
to download the generated Excel file.
$uri = 'https://powershell-azure-function-return-excel-file546f.azurewebsites.net/api/powershell-azure-function-return-excel-file'
Invoke-RestMethod -Uri $uri -OutFile .\SalesReport.xlsx
.\SalesReport.xlsx