- Newest
- Most votes
- Most comments
Hello there,
Thank you for reaching out to us.
I see that you are unable to publish a .NET API to Elastic Beanstalk using the "Publish To AWS" right click option in Visual Studio 2022 as you are getting below error message. However it was working fine with Legacy method. Also, I see that you have already attempted some resolution steps however those were not helped in resolving the issue.
Unable to start a deployment session:
A task was canceled
I have checked about the error message and I found that this error might occur when there is no proper permissions to EC2 instance profile role or not selecting the appropriate instance profile in the Visual studio. Please refer the GitHub link for more information[1][2].
I will also suspect that this could be due to instance profile selection or permissions issue since it is failing at "Publish To AWS”. That said, I have referred our official document[3] that “Although not recommended, you may also need to specify AWS account credentials that your application will use to access AWS services after it has been deployed. The preferred approach is to specify an IAM role. In the Publish to Elastic Beanstalk wizard, you do this through the Identity and Access Management Role drop-down list on the AWS Options page. In the legacy Publish to Amazon Web Services wizard, you do this through the IAM Role drop-down list on the AWS Options page.
Since you are suspecting that this was caused by generating new keys and rebuilding my credential profiles. Hence, I would suggest you to please refer the document[3] and make sure that you are using credentials in correct way mentioned in the document. However, I would also suggest you to use preferred approach i.e. IAM role instead of access keys.
If you are unable to fix the issue, I would suggest you to please try steps mentioned in the document[4] and reach out to AWS Premium support by creating a support case with us. We would happy to troubleshoot further.
Thank you and have a nice day
References:
[1] https://github.com/aws/aws-toolkit-visual-studio/issues/352#issuecomment-1890982281
[2] https://github.com/aws/aws-toolkit-visual-studio/issues/352#issuecomment-2047712785
Relevant content
asked 3 years ago
- AWS OFFICIALUpdated 5 years ago

Thank you so much for your answer. Unfortunately, I had already seen these posts and tried the solutions. In my situation, the GUI never launches. I cannot change dropdown settings because the options never load. The first screen to appear is the error screen. I added permissions to the IAM role associated with the instance through the AWS console, but that did not change anything.
This does not work. I get the same error using an account with ALL permissions AWS wide enabled. Literally everything.