Trying to move sites to new Geo using powershell in Azure Function

Copper Contributor

Hello, I am fairly new to Azure functions and I wanted to see if this was possible.  I have used PNP in Azure functions and I have an understanding of how that works.


In short I need to be able to call a function from the web that will pass in some metadata that will define the site to be moved and the geo that it will be moving to.  I have all of this working.  What I did not anticipate is trying to use the commands in a function (it works locally).

Connect-SPOService -Url -Credentials $cred
Start-SPOSiteContentMove -SourceSiteUrl "<source>" -ValidationOnly -DestinationDataLocation "<destination>"
This results in:
SPOSiteContentMove' is not recognized as the name of a cmdlet, function, script file, or operable program.
If I comment out that line it gives me the same error for the Connect-SPOService line.  Is this even possible in a function?
0 Replies