Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var publishSettings = GetPublishSettings(subscriptionId, resourcegroupName, websiteName);
- var sourceBaseOptions = new DeploymentBaseOptions();
- var targetBaseOptions = new DeploymentBaseOptions
- {
- ComputerName = publishSettings.ComputerName,
- UserName = publishSettings.Username,
- Password = publishSettings.Password,
- AuthenticationType = "basic",
- TraceLevel = Verbose
- };
- targetBaseOptions.Trace += TargetBaseOptions_Trace;
- var syncOptions = new DeploymentSyncOptions
- {
- DoNotDelete = false,
- WhatIf = false,
- UseChecksum = true
- };
- using (var deploymentObject = DeploymentManager.CreateObject(DeploymentWellKnownProvider.ContentPath, Path.GetFullPath(websitePath), sourceBaseOptions))
- {
- var summary = deploymentObject.SyncTo(DeploymentWellKnownProvider.ContentPath, publishSettings.SiteName, targetBaseOptions, syncOptions);
- if (summary.Errors > 0) throw new Exception("Website Deployment failed");
- if (summary.Errors == 0)
- {
- Console.WriteLine($"{publishSettings.SiteName}: erfolgreich");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement