Differences

This shows you the differences between the selected revisions of the page.

guide_microsoft_azure_webjob_sftp 2020-07-13 guide_microsoft_azure_webjob_sftp 2022-10-21 (current)
Line 27: Line 27:
If you update your WebJob frequently, or if you have multiple instances of similar WebJobs, you can automate the update using WinSCP [[scripting]]. If you update your WebJob frequently, or if you have multiple instances of similar WebJobs, you can automate the update using WinSCP [[scripting]].
-First, learn how to [[guide_microsoft_azure#website|setup FTPS access to the WebJob (WebSite)]].+First, learn how to [[guide_microsoft_azure#appservice|setup FTPS access to the WebJob (WebSite)]].
Example script: Example script:
Line 39: Line 39:
Make sure you update the example with your actual [[guide_microsoft_azure#appservice|FTP credentials]], %%FTP%% host name, the job type (see above) and name. Make sure you update the example with your actual [[guide_microsoft_azure#appservice|FTP credentials]], %%FTP%% host name, the job type (see above) and name.
-//Learn more about [[guide_automation|automating file transfers to FTPS server]].//+//Learn how to [[guide_automation|*]].//
===== [[environment]] WebJob Environment ===== ===== [[environment]] WebJob Environment =====
Line 70: Line 70:
//If your transfer/synchronization task is simple, use WinSCP scripting. For complex tasks, see below for solutions using WinSCP .NET assembly from a [[#powershell|PowerShell script]] or [[#consoleapp|console application]].// //If your transfer/synchronization task is simple, use WinSCP scripting. For complex tasks, see below for solutions using WinSCP .NET assembly from a [[#powershell|PowerShell script]] or [[#consoleapp|console application]].//
-//Start with learning how to [[guide_automation|automate file transfers (or synchronization) to FTP server or SFTP server]].//+//Start with learning how to [[guide_automation|*]].//
Comparing with generic WinSCP script examples, your Azure transfer job should: Comparing with generic WinSCP script examples, your Azure transfer job should:
Line 84: Line 84:
<code winscp> <code winscp>
# Connect # Connect
-open sftp://user:password@example.com/ -hostkey="ssh-rsa 2048 xxxxxxxxxxx...="+open sftp://user:password@example.com/ -hostkey="ssh-rsa 2048 xxxxxxxxxxx..."
cd backup cd backup
# Use a job run ID (timestamp) as a backup ID # Use a job run ID (timestamp) as a backup ID
Line 150: Line 150:
        UserName = "user"         UserName = "user"
        Password = "mypassword"         Password = "mypassword"
-        SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx...="+        SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..."
    }     }
       
Line 249: Line 249:
                UserName = "user",                 UserName = "user",
                Password = "mypassword",                 Password = "mypassword",
-                SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx...="+                SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..."
            };             };
Line 312: Line 312:
You can develop the WebJob (console) application as any other desktop console application. You can also start with //Azure WebJob// project template. You can develop the WebJob (console) application as any other desktop console application. You can also start with //Azure WebJob// project template.
-With Visual Studio, you can ease [[#deploying|the deployment]] using command //Publish as Azure WebJob//, which is available in the project context menu in //Solution Explorer//. It opens //[[https://docs.microsoft.com/en-us/azure/app-service/webjobs-dotnet-deploy-vs#configure|Add Azure WebJob]]// dialog that allows you to name your job and setup how it is run (including scheduling). Make sure you add all additional files needed for the job (i.e. ''winscp.exe'', ''run.bat'' and private key, as shown above) to the project with //Build Action// set to //Content// to have them deployed (see also [[library_install#vs|Using WinSCP .NET assembly from Visual Studio]]). Easier is to use the [[library_install#nuget|NuGet package]]. When you submit the dialog, a publish process starts on the background in //Web Publish Activity// pane. Next time you publish, after making changes to the project, only modified files are uploaded. See also [[https://docs.microsoft.com/en-us/azure/app-service/webjobs-dotnet-deploy-vs|Develop and deploy WebJobs using Visual Studio - Azure App Service]].+With Visual Studio, you can ease [[#deploying|the deployment]] using command //Publish as Azure WebJob//, which is available in the project context menu in //Solution Explorer//. It opens //[[https://learn.microsoft.com/en-us/azure/app-service/webjobs-dotnet-deploy-vs#configure|Add Azure WebJob]]// dialog that allows you to name your job and setup how it is run (including scheduling). Make sure you add all additional files needed for the job (i.e. ''winscp.exe'', ''run.bat'' and private key, as shown above) to the project with //Build Action// set to //Content// to have them deployed (see also [[library_install#vs|Using WinSCP .NET assembly from Visual Studio]]). Easier is to use the [[library_install#nuget|NuGet package]]. When you submit the dialog, a publish process starts on the background in //Web Publish Activity// pane. Next time you publish, after making changes to the project, only modified files are uploaded. See also [[https://learn.microsoft.com/en-us/azure/app-service/webjobs-dotnet-deploy-vs|Develop and deploy WebJobs using Visual Studio - Azure App Service]].
===== Further Reading ===== ===== Further Reading =====
-  * Guide to [[guide_microsoft_azure#website|connecting securely to a Microsoft Azure App Service (Web Site) with FTPS]]; +  * [[guide_microsoft_azure#appservice|*]]; 
-  * [[https://www.hanselman.com/blog/IntroducingWindowsAzureWebJobs.aspx|Introducing Windows Azure WebJobs]]; +  * [[https://www.hanselman.com/blog/introducing-windows-azure-webjobs|Introducing Windows Azure WebJobs]]; 
-  * [[https://docs.microsoft.com/en-us/azure/app-service/webjobs-dotnet-deploy-vs|Develop and deploy WebJobs using Visual Studio - Azure App Service]]; +  * [[https://learn.microsoft.com/en-us/azure/app-service/webjobs-dotnet-deploy-vs|Develop and deploy WebJobs using Visual Studio - Azure App Service]]; 
-  * [[https://docs.microsoft.com/en-us/azure/app-service/webjobs-create|Run background tasks with WebJobs in Azure App Service]].+  * [[https://learn.microsoft.com/en-us/azure/app-service/webjobs-create|Run background tasks with WebJobs in Azure App Service]].

Last modified: by martin