Open 6gal6ler6 opened 4 weeks ago
Thank you for opening up this issue and for the positive feed.
I will try to research this and propose an implementation solution and in which milestone: v3.X
or v4.
it may fit
@Adam-it
This might help:
I created this small function with PnP PowerShell
that now I am Using in my App Deployment to update the app.
function Update-SharePointApp {
param(
[Parameter(Mandatory=$true)]
[string]$SharePointSite,
[Parameter(Mandatory=$true)]
[string]$AppName
)
try {
# Connect to SharePoint Online
Write-Host "Connecting to SharePoint Online site: $SharePointSite"
Connect-PnPOnline -Url $SharePointSite #ADD CONNECTION METHOD
# Get the app
Write-Host "Getting the app: $AppName"
$App = Get-PnPApp -Scope Site | Where-Object {$_.Title -eq $AppName}
# Update the app
Write-Host "Updating the app..."
Update-PnPApp -Identity $App.Id -Scope Site
Write-Host "App updated successfully."
}
catch {
Write-Host "An error occurred: $_"
}
}
Update-SharePointApp -SharePointSite "<MY_COOL_SPO_SITE>";
Hi @6gal6ler6, @Adam-it,
Should be able with using spo app upgrade
in src\services\CliActions.ts
(deploy action)
yes indeed what you @nicodecleyre suggest is the way to go πππ. First of all SPFx Toolkit uses CLI for M365 under the hood so we may use the spo app upgrade
command.
@6gal6ler6 thank you very much for the additional comment and research you gave. Unfortunately, PnP PS is not an option for SPFx Toolkit as PowerShell may not be used in node.js app directly and we may not also assume user will have PowerShell 7 installed on his local workspace. So we need to be using node.js based approach like CLI for M365.
I am still thinking/prototyping this feature in my head π. I apologize it is taking sooo long but I am trying to organize the chaos in my mind to wrap my head around more work.
the biggest challenge here is that spo app upgrade
requires to siteUrl to be passed. This by default will extend this action with an additional step one might no always want to do so we should for sure:
π― Aim of the feature
First, I want to thank all people who have been contributing to this amazing tool.
Now, lets get into my improvement idea, for an already amazing feature:
When using the feature
Deploy project
, it would be great if this could also allow the user to update the Application.I am not 100% sure if this is something that could be implemented.
Still, I think this will benefit developers by adding that as an option for them, so they donβt have to go to the SPO Site Catalogue to update the App every time the package is deployed.
π· Images (if possible) with expected result
Feature:
π€ Additional remarks or comments
No response