TFS InvokeMethod Delete Access to the path is denied - file

I am trying to call invokemethod to delete a file in the drop folder. However I am receiving access to the path is denied message. I am also doing copydirectories and delete directory before using invokmethod. Both copy and delete directories work with no permission issue.
I am guessing invokemethod use different user account. Any help is very much appreciated.

By default the build agent runs with the build service account of Network Service. You may want to change it to a domain account such as TFSBuild so you could assign write permissions on the paths you need your build artifacts.
Then make sure TFSBuild is running the build service and is a member of the Project Collection Build Service Accounts

You will also get access denied error, when you have the file in use.

Related

Deploy WPF Application Build to VM on Azure from TFS

I am wanting to deploy basically the bin folder to a VM that is hosted on Azure. I want to deploy from my TFS 2015 Server to a Window 7 VM which are both hosted in Azure. I have set up a Machine File Copy task and tried to get it to point to the correct VM but nothing seems to work. It continually comes back with the error :
2015-12-29T14:27:30.5763871Z ##[debug]Initiating copy on machine-name
2015-12-29T14:27:57.0124127Z ##[debug]Finished copy operation on machine-name
2015-12-29T14:27:57.0280368Z ##[debug]Deployment logs for copy operation on machine-name
2015-12-29T14:27:57.0280368Z ##[debug]System.AggregateException: Failed to execute the powershell script. Consult the logs below for details of the error.
2015-12-29T14:27:57.0280368Z System.Management.Automation.RuntimeException: Failed to connect to the path \\machine-name with the user username for copying. System error 53 has occurred.
2015-12-29T14:27:57.0280368Z The network path was not found.
I changed the machine name and username in the above snippet.
I have followed most of the steps in these articles:
http://www.codewrecks.com/blog/index.php/2015/06/20/build-vnext-support-for-deploying-bits-to-windows-machines/
http://blogs.msdn.com/b/visualstudioalm/archive/2015/07/31/dev-test-in-azure-and-deploy-to-production-on-premises.aspx
But I could not see the option for Azure File Copy so that's out the window. When I use PsPing I can connect from the TFS Server to the target VM when targeting the specific WinRM port 5985.
I am not sure if what I am trying to achieve is even possible with TFS + Azure, but I would have imagined this is exactly the type of scenario Azure was built for?!
Any help would be greatly appreciated.
EDIT: Here is the add Step Dialog:
You need to use the Azure File Copy task to copy files to Azure VMs. Open the build definition, and click Add build step... -> go to Deploy page on the ADD TASKS dialog. Then you will find the Azure File Copy task. See:
However, you mentioned that the task is missing, can you share me the screenshot of the ADD TASKS dialog?

BackupBuddy Plugin Error

When backing up the whole site. This is the Error
-- Backing up with BackupBuddy v2.2.33...
15:10:14: Error #5445589. Invalid backup serial (9au6kfm0rj). Verify backup directory writer permission. Fatal error.
A fatal error has been encountered. The backup has halted. --
Solutions from the support ->
Adjust permissions to allow write & directory creation access to your uploads folder. ie: /www/wp-content/uploads/
How can i adjust the permission? Any idea please?
Do you have FTP access to your site? If you access it with an FTP program like Filezilla or SmartFTP you should be able to browse to the uploads folder and right-click to bring up the options and change the permissions.
If you don't have your FTP details or have issues accessing that then the best bet is probably to email your webhost with the above information and ask can they change the permissions for you on that folder.

How do I change the path to a dropbox folder

I want to move my .mdf and .ldf into my dropbox folder.
I ran this script command:
ALTER DATABASE MyDatabase1 MODIFY FILE
(
Name = matrix,
Filename = 'C:\Users\mycomputer\Dropbox\MyDatabase1.mdf'
);
But I get this error:
The path specified by 'C:\Users\mycomputer\Dropbox\MyDatabase1.mdf' is
not in a valid directory.
I'm pretty sure it's just a permissions issue where the sql service running my script doesn't have the correct permissions. But I have no clue which object to grant all permissions to my DropBox. I tried mycomputer\users but that didn't work. Can someone help please?
As far as I know, Dropbox does not make snapshots of the files it copies.
This means the files could (and most probably would) be written to during the copy and they'll arrive in inconsistent state, rendering them unusable.
I believe you would want to use Log Shipping instead. This is a feature of SQL Server which allows transaction logs to be incrementally backed up and sent to another server (possibly by means of Dropbox), where they can be restored. This would allow you to have a snapshot of the database on another server.

Can not copy SQL Server files, Access is denied

I need to copy my SQL Server DBs to a folder. The files are attached to SQL Server, which I have detached using my code. When I try to copy these files using
My.Computer.FileSystem.CopyFile(filePathToCopyFrom1, targetFilePath1)
It returns error:
"Access to the folder D:\MyDbs is denied"
When I manually coped these files, it asked "You need Administror permission to copy these files" I clicked continue and it worked but how to fix this using my vb.net code?
I have given Full Control to administrator from Windows but still it did not work.
Thanks
Seems that the detaching process went well. You can copy through windows explorer, but not from you application. The key difference here is that the files are protected to be accessed by the administrator user only.
Then, you need to run your application using an administrator windows account so that the application inherits the permissions of the user to be able to perform this operation.
Remember, if you are using Windows Vista+ (which I assume you do) the root folder is almost off limits. You can run the App as Administrator, or copy it to a folder in the root. The other point is that where you copy from. If the DB is currently in Program files, it is very possible that you will get this problem as well, and then you will have to run the application as Administrator.
Right click on the application, and select Run as Administrator, or select properties and in Compatibility check the box that the program should be running as Administrator. If you use the latter, then a box will pop up every time you run it, unless you change the User Account Control settings.

Error Running a Batch File To Copy A File

I am trying to run a batch file to copy a backup file from one location to other.
I keep on getting the error:
Invalid drive specification
My path is as follows:
\\server\drive:\folder\folder\folder\*.bak drive:\folder\.bak
That typically doesn't work out too well. You'll want this:
cp \\server\C$\folder\folder\folder\copy.bak C:\folder\copied.bak
This presupposes that you actually have access to the folder \\server\C$\folder\folder\folder from your box. If you do not, then you need to configure permissions correctly on the server to give you access.
You only have access to administrative shares (\\server\C$ <- the $ denotes an admin share) if you have administrative rights on the server. If you don't you need to actively share the folder in question, i.e. on the server, navigate to drive:\folder\folder\folder and share it (context menu of the folder, menu item Sharing and Security). Note that you need at least temporary admin rights on the server in order to create a share.
Do not forget to configure the permissions for the share you create, so that the limited account you are using for the copy process has read rights.
Once this is et up, you should be able to copy the files using
Copy \\Server\NewShareName\*.bak c:\folder\.bak
If you have problems with the files being in use by another process, have a look at robocopy instead of the copy command.

Resources